From patchwork Mon Apr 25 12:08:17 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: 8928851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1E559F1C1 for ; Mon, 25 Apr 2016 13:42:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2AF5201D3 for ; Mon, 25 Apr 2016 13:42:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EA0322013A for ; Mon, 25 Apr 2016 13:42:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AA8D6E222; Mon, 25 Apr 2016 13:42:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B7A26E5A7 for ; Mon, 25 Apr 2016 12:08:48 +0000 (UTC) Received: by mail-pa0-x232.google.com with SMTP id iv1so14654021pac.2 for ; Mon, 25 Apr 2016 05:08:48 -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=945GRC3pBb9ht7+cGhn69CffzouYbr0diGqesLlc4G0=; b=KHpNGzsaxW9hdheqyqBc6q1K4ca1AvuLC9MvjvMCqrGodOEV8KJkknyupw493+VmfA 5tRQIGsIIbbhu2PRWaKmv3hwU6vkE4aKEAY+A/8LwrXEGygUty2uPIDwJkdgtWv5d1n4 H1fun5GF3Nq0dxMHZ9+ciALECg2j/eVjP6omlWU0PDDUHKgNXkcolfv8kO7YowCfp7Wa xmiZHe91yXQixE1pZMtdovmzicBBK+xYA0Sl0iue0Og6oF2EeYE5Xb2cYBxkUT34mFMt LbMx6RuZE6y34xO8/skhWxaYNt5WBoMfTC4AmEHnID88gkqtpF6L7UlLzUb8ba5SsOnb bifg== 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=945GRC3pBb9ht7+cGhn69CffzouYbr0diGqesLlc4G0=; b=Enz042Xn3jfu4Tw/M1/NKFz4OUlh2DApOx9VRmtzkGz/DxtyxUhH7vvux6jYpHTJZs DohOFf6EB7dhAAzaHX4RckuIu2Jy9YNcL45qeMcMMpR5vV/Hc5PqXm/GOVzLeGeZblYz fg+0l91QGnqHrQXMa/eVTdtLRkPqGzFa2MVMC1tBwSdACna/czFlWSOQ61Q6a5E5CVil CdBpq5oLxtPg4Tf9x/IkLQhF2EhcfHb6zFUTpcIpSTSLFI/JJxpvcUF6kr4JiuMvI+BF VyOj8Tq+sI1Y4pgRPEL/0tnMODhO0XFzjJZXsg+rDmOeaoCk9/zAWh38CJKAaERZbxwY jUQQ== X-Gm-Message-State: AOPr4FX65W+zYszsV7taGkDBBYq2OuWjohKIAiVHnEYcgzIaug/eAm547ITHGtSrCtMY2g== X-Received: by 10.67.1.65 with SMTP id be1mr48252463pad.46.1461586126726; Mon, 25 Apr 2016 05:08:46 -0700 (PDT) Received: from localhost.localdomain ([202.83.17.75]) by smtp.gmail.com with ESMTPSA id lq10sm29545583pab.36.2016.04.25.05.08.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 05:08:45 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH v4] drm/dsi: Implement set tear scanline Date: Mon, 25 Apr 2016 17:38:17 +0530 Message-Id: <1461586097-4508-1-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 2.1.2 X-Mailman-Approved-At: Mon, 25 Apr 2016 13:42:37 +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-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 --- v2: * Added fix for compilation issue from Sumit Semwal v3: * Simple subject line change v4 * commit message changes from john stultz --- 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);