From patchwork Mon Jun 6 17:41:37 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: 9159647 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 29E9560572 for ; Tue, 7 Jun 2016 00:41:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B3D828326 for ; Tue, 7 Jun 2016 00:41:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F76728350; Tue, 7 Jun 2016 00:41: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 8CE0028326 for ; Tue, 7 Jun 2016 00:41:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADCAB6E689; Tue, 7 Jun 2016 00:40:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 481B86E61D for ; Mon, 6 Jun 2016 17:41:51 +0000 (UTC) Received: by mail-pa0-x243.google.com with SMTP id ug1so2215020pab.1 for ; Mon, 06 Jun 2016 10:41:51 -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=wmNV51knW3iW0ncKHeHrI0bdXaqRWzGDBMcj3/0JhU0=; b=q1RCj1VvvUIomveUVkXOCIhKjFhntNif+/jCtmg49zj+5ZED6IFkGHp+KxgPbCEAQV xKoOvKLtkbXwRJZ+jyGaB60PC9PJ9J0ekqaMpq5prNdszgYxR3J6hM3XIWak/GuCYorO Y5o72VLmPN9hC/VgZ2ROO1Kbj4U8S1lxbIZqxDj75B9XmvYigJ4nNEViswndgcH84KCz 4/vCN1kAC0uarmNsR2Y2F+6bU72zCIUSo61+7v1+hVPvPoRLxZvR0NI/p3IQ3NTTmTzv YsjFQ4D6//wB4Qdfz5mSR7FTduzsQum2asmaqrveQNGOcj5HwYBkmHcj636KoJANodtf Dsow== 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=wmNV51knW3iW0ncKHeHrI0bdXaqRWzGDBMcj3/0JhU0=; b=N3tO9gKgRdp5VPuXfSNPhwToUpqQiU32hc99V4nZnvHR3PUwDBW3gNSNPMenHEbiVM eZMsC2j+2z6TT/id34t+BwhGcnjCJeKlGK8ZP7o0C9IBhgBI49xP5FmtRTmzRvS7msTU qJvwfyFbLQIJ+JbcdR9Z9I3Fk1gXjW5aV0QvZXFHke024zLyFP/sgVsVpwM7xvfvvj9a xdWiL8UmaEas8uehFbAhUrsKSfNlDgyCV7eMOIMTFPbrBXZulPH8F15Sm7gH9zirD3KS HsqeWcRS/dxWSfbvynQkZ1wRgROhX7PYCgwcoToyukmS882YQjbwYNuvMZ1ta2IlL17r AIGA== X-Gm-Message-State: ALyK8tL7nvQl7gAJcNDDQoX0hy5TOjdecGLNu7A0LWwzR0p4AN245E1UWKm6t2EzjiVDkA== X-Received: by 10.66.139.133 with SMTP id qy5mr25551261pab.4.1465234910347; Mon, 06 Jun 2016 10:41:50 -0700 (PDT) Received: from localhost.localdomain ([122.172.144.137]) by smtp.gmail.com with ESMTPSA id d71sm29103654pfd.80.2016.06.06.10.41.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jun 2016 10:41:49 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH v2] drm/dsi: Implement set tear scanline Date: Mon, 6 Jun 2016 23:11:37 +0530 Message-Id: <1465234897-21365-1-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Tue, 07 Jun 2016 00:40:40 +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. Also includes small build fixes from Sumit Semwal. Cc: Archit Taneja Cc: John Stultz Cc: Thierry Reding Cc: Sumit Semwal Cc: Jani Nikula Signed-off-by: Vinay Simha BN --- v1: * helper function suggested by Thierry for set_tear_scanline v2: * one scanline parameter 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..c02d083 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);