From patchwork Tue Jun 7 07:45:31 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: 9159997 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 BDC8960572 for ; Tue, 7 Jun 2016 07:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B02FF27248 for ; Tue, 7 Jun 2016 07:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A519A281F9; Tue, 7 Jun 2016 07:54:14 +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 ABBBF27248 for ; Tue, 7 Jun 2016 07:54:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D9426E6BB; Tue, 7 Jun 2016 07:54:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14CFA6E364 for ; Tue, 7 Jun 2016 07:46:16 +0000 (UTC) Received: by mail-pa0-x241.google.com with SMTP id di3so13618002pab.0 for ; Tue, 07 Jun 2016 00:46:16 -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=Zn72uHzifxGIfv8aJ483ugn9hrutkbO4C5r77DC3AFk=; b=Igox3n0/t7VN0SajJagZi8Ac/j1WnnSpLsoByukV1FefbaFKXapcgLAaDJWqK8wWak DrYwYXeCHtIjEjyhUYOzILOlF4gr2IcbFvm3xB2h/XV32Aqmy5043BiB2RV5xdZr98Kc 2omIGtDW3SUoqj7LupyY7Vz39+F7azavIE6mQmvHfUd+ZrptQ/h7VBZTanqqxWGZ/afA 81cFB4G1SMUCsPP/TP5+r9M8AdmOO04gw4833YZdZkMQwgRFSYlE9coSlY0etBag6LyF xDirgGjEPKNT5+6AsNrNN8yCiW2L7Z5wiZj/BSmVQG3Vjn3GGoz//NObqPQTxGklQL8E h5Ug== 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=Zn72uHzifxGIfv8aJ483ugn9hrutkbO4C5r77DC3AFk=; b=mprM71vfeRR+qx1xSAJOv0oSGjRQGfQ2FqMp67kXGmd1d3ivL2ODP+8yrUOdoCQ2I/ iMoZbveSw/hSkcwvfOrMfK1hJG5X2E+OlG3xUHCdnxZAqln6sgSxq+knxU80kpFUCx7r iY+JL0s538qAU8IHn47TMCWcIOl8v5ueQKUJdovy931YoOw8aISERVsPcty5pnBWP3mP 4z6/ZYEx+pLHTPnZUIG1i6m/jKxNxLrzo2ALgK7NPRF06xY6nZGPfrtiIM9MVjFDHo8p IXXEjhRtAg1EOMR6X0yVDzEbQ/mAMr8mrpy4r1xWoSzkCNnM3ZAAVdiEIKJ/Txe5NBDX yy5Q== X-Gm-Message-State: ALyK8tKL5NtBfVeWHRqgGnc1ozJBM4EEESAKMLVJSOBgZ6ma7rFPROuGKPCHYFQaP/bV/w== X-Received: by 10.66.4.129 with SMTP id k1mr29304005pak.45.1465285575161; Tue, 07 Jun 2016 00:46:15 -0700 (PDT) Received: from localhost.localdomain ([202.83.17.75]) by smtp.gmail.com with ESMTPSA id ry2sm30561311pac.9.2016.06.07.00.46.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 00:46:14 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH v3] drm/dsi: Implement set tear scanline Date: Tue, 7 Jun 2016 13:15:31 +0530 Message-Id: <1465285532-12676-1-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 2.1.2 X-Mailman-Approved-At: Tue, 07 Jun 2016 07:53:57 +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 a set_tear_scanline command. Cc: Archit Taneja Cc: John Stultz Cc: Thierry Reding Cc: Sumit Semwal Cc: Jani Nikula Signed-off-by: Vinay Simha BN Reviewed-by: Jani Nikula Reviewed-by: Sumit Semwal --- v1: * helper function suggested by Thierry for set_tear_scanline * Also includes small build fixes from Sumit Semwal. v2: * one scanline parameter suggested by jani v3: * passing the payload properly as suggested by jani -- --- drivers/gpu/drm/drm_mipi_dsi.c | 22 ++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index f5d8083..7938ce7 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -983,6 +983,28 @@ 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 + * @param: STS[10:0] + * Return: 0 on success or a negative error code on failure + */ +int mipi_dsi_set_tear_scanline(struct mipi_dsi_device *dsi, u16 param) +{ + u8 payload[3] = { MIPI_DCS_SET_TEAR_SCANLINE, param >> 8, + param & 0xff }; + 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..ec55285 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -263,6 +263,7 @@ 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, u16 param); 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);