From patchwork Thu Apr 21 06:26:57 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: 8896791 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2DBA6BF29F for ; Thu, 21 Apr 2016 07:49:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59049202EB for ; Thu, 21 Apr 2016 07:49:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 51BA9200E6 for ; Thu, 21 Apr 2016 07:49:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A5B76EBFB; Thu, 21 Apr 2016 07:48:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id A99276E262 for ; Thu, 21 Apr 2016 06:27:46 +0000 (UTC) Received: by mail-pa0-x231.google.com with SMTP id zm5so25892085pac.0 for ; Wed, 20 Apr 2016 23:27:46 -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=8uZdqYaUqKkqpMM7f86TeSx7HIeiBEZ0J6HAi4LPMKU=; b=Gq60e5jCAbgeiMk3WfPJWAiRzZGxP7z16eRmjDaVBc2cJb1KwPcFL9AatfekJV2dFb 0RjQaTQW92ecrAHRBIPxl9Jwn2YvrzRp0jWOYrZTEgLrHU86J7YPPX0xMMz8hzQS3KtL MMnezml/5og1faCqdS6mME+PzytPWSKVxkus/uDKUOXHwH4BulmPV5mC5ZcJDkKfr9hb mn3Weh+l3BA9Y7MMoIQ1qynpBHtyifT0A5YWL4gVC8l09qmuy5PImkbFEWmvZehVr6Zz ajVb/xOWwhrdxq+GAI29OFET1tmzHGFUsBCxKPLbnyLrLjKY88UL6N8ncRkM9i84rth9 dG1Q== 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=8uZdqYaUqKkqpMM7f86TeSx7HIeiBEZ0J6HAi4LPMKU=; b=SEd+W70BtC8m+RDLH714TAfgHMVTByEVKI1jYJIbccHrvowNoTvYNEcaEmv3sMRc/b +iEwdFsWWt4cyre3JiNgXQP3Rrh4Of7i266E8DhaIHeGYQ050HazM3WhmSYaoY9BBw09 Pgtf9SLJoOaTjda+OkkjI/QpY7PqJajaKkNYsAHWusiAiNbLCEl7zld9qU8xFheBWl1v mbI+f27NROpgNlmxapox7Hji86dDD1VugQjvkGyI4OG2iS6jeS5P+W+XSjJtUZHIwgnw 6sp6IjF3jc5+J2j8wIfn/rTkoYOHB17ZatUR3Tm0bhJnA/Y93OpwF6/26KFth6mheJVT GJeg== X-Gm-Message-State: AOPr4FXfl0tkA4w5ng5YM+dJ7Q98ygv039NzQeWSmJPdkjchtQuhkqdezRkRF9YS7Le69A== X-Received: by 10.66.249.228 with SMTP id yx4mr18185991pac.29.1461220065955; Wed, 20 Apr 2016 23:27:45 -0700 (PDT) Received: from localhost.localdomain ([202.83.17.75]) by smtp.gmail.com with ESMTPSA id n10sm1822733pax.18.2016.04.20.23.27.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 23:27:45 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH v3] drm/dsi: Implement set tear scanline Date: Thu, 21 Apr 2016 11:56:57 +0530 Message-Id: <1461220017-8897-1-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 2.1.2 X-Mailman-Approved-At: Thu, 21 Apr 2016 07:48:56 +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 a set_tear_scanline command. Cc: Archit Taneja Cc: John Stultz [thierry.reding: suggested to create helper function (v1)] Cc: Thierry Reding [sumit.semwal: create a single patch for compilation fix (v2)] Cc: Sumit Semwal [vinay simha bn: subject line changed (v3)] 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);