From patchwork Thu Jun 2 01:48:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinay Simha B N X-Patchwork-Id: 9149519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7980160221 for ; Thu, 2 Jun 2016 08:24:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 692E82654B for ; Thu, 2 Jun 2016 08:24:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E1352823E; Thu, 2 Jun 2016 08:24:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E3382665D for ; Thu, 2 Jun 2016 08:24:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF7896EB28; Thu, 2 Jun 2016 08:24:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09CF66EAF6 for ; Thu, 2 Jun 2016 01:48:33 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id b124so5976480pfb.0 for ; Wed, 01 Jun 2016 18:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=3WTsA54ber8f1KwFbU9E6RFjprZ3ClZapdvu2EkCjDo=; b=SWJf/2y0doIESP1IkOSTrTBQ42paYiRuWWYwdC7/EYEswOqvRuthIwI/cXT0brySdX Q3ITLBw9VBX6TDLY3WgXI0H+KwKpwaWmBzQmjaKUpSosawypxKI2gOiRfNeOBK2I95AZ ZeSn3CBXLydlg1tQm0GTm5F2TSCIEyEWirXIkcG1/MCd5WyUGpA/QEi+6Dgk3i8fVOX4 lgc57kpKg7khStBPD4L7vgfJ/vLuuPzSt+O5xSyYp/b/NEnGjU2/A2BgLlX/M1UFwSBP z7bZXWeqcSzPeL4JUSZarI5jLLkT07m6kRWcsH1vF3X9sHQhSY3WEfl0A+UtAXe3Pnwy zYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3WTsA54ber8f1KwFbU9E6RFjprZ3ClZapdvu2EkCjDo=; b=W4Vo9chMfr9I414OyxnMjXyFXirEIU4AnYdhN9PYIbIX13yFvJSyBKMGqdyFTxebiV jwAb+FCBCUSPLniTk4KncE/K1nT0TT81AedBsfm61NkN0DCzwF8HSHjIZh72gOb8EUft C3tHaQGP11BeSLT64IOPQ4CrarAiA0BUkcyznbJXRzNkmeR1Py7CwIYzS1mGdhpL6B8m e8cDnY9sOxwJ6Rs/6IZvJRgF2mkP2L+K9BJIdGuI3VBNFptWfEWIiTkW6Y5Jl8lYjrK/ qoejKo0JPrMKPVoi04nN+ztMnjuoo657dZSO5aQ+xypgc3Z3T4ryEZRrSVlzKY2qaC+5 s2jQ== X-Gm-Message-State: ALyK8tLs4K6BojG1eV01yH/wSU0GQt34vTrMqFDucNqoUXCY46Zv++wvtPExXSaoscJ7Kw== X-Received: by 10.98.64.21 with SMTP id n21mr14488033pfa.161.1464832112077; Wed, 01 Jun 2016 18:48:32 -0700 (PDT) Received: from localhost.localdomain ([122.172.131.85]) by smtp.gmail.com with ESMTPSA id 74sm50977432pfv.8.2016.06.01.18.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 18:48:31 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH 1/2] drm/dsi: Implement set tear scanline Date: Thu, 2 Jun 2016 07:18:18 +0530 Message-Id: <1464832099-22402-1-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 02 Jun 2016 08:23:59 +0000 Cc: open list , "open list:DRM DRIVERS" , Vinay Simha BN , Archit Taneja X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Provide a small convenience wrapper that transmits ia set_tear_scanline command as suggested by Thierry Reding. Also includes small build fixes from Sumit Semwal. Cc: Archit Taneja Cc: John Stultz Cc: Thierry Reding Cc: Sumit Semwal Signed-off-by: Vinay Simha BN --- drivers/gpu/drm/drm_mipi_dsi.c | 23 +++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index f5d8083..2f0b85c 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -983,6 +983,29 @@ int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_on); /** + * mipi_dsi_set_tear_scanline() - turn on the display module's Tearing Effect + * output signal on the TE signal line when display module reaches line N + * defined by STS[n:0]. + * @dsi: DSI peripheral device + * @param1: STS[10:8] + * @param2: STS[7:0] + * Return: 0 on success or a negative error code on failure + */ +int mipi_dsi_set_tear_scanline(struct mipi_dsi_device *dsi, + u8 param1, u8 param2) +{ + u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, param1, param2}; + ssize_t err; + + err = mipi_dsi_generic_write(dsi, &payload, sizeof(payload)); + if (err < 0) + return err; + + return 0; +} +EXPORT_SYMBOL(mipi_dsi_set_tear_scanline); + +/** * mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image * data used by the interface * @dsi: DSI peripheral device diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 7a9840f..2788dbe 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -263,6 +263,8 @@ int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, u16 end); int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, u16 end); +int mipi_dsi_set_tear_scanline(struct mipi_dsi_device *dsi, u8 param1, + u8 param2); int mipi_dsi_dcs_set_tear_off(struct mipi_dsi_device *dsi); int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, enum mipi_dsi_dcs_tear_mode mode);