From patchwork Tue Aug 12 06:33:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4710891 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1A0769F319 for ; Tue, 12 Aug 2014 06:33:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16BD220123 for ; Tue, 12 Aug 2014 06:33:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B421F2011D for ; Tue, 12 Aug 2014 06:33:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7DBA89DFE; Mon, 11 Aug 2014 23:33:16 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 5690C89D81 for ; Mon, 11 Aug 2014 23:33:16 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NA600HHDKV8E7C0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 12 Aug 2014 15:33:08 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id B6.4D.19786.425B9E35; Tue, 12 Aug 2014 15:33:08 +0900 (KST) X-AuditID: cbfee68e-b7fab6d000004d4a-6d-53e9b524208f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D8.C3.04943.425B9E35; Tue, 12 Aug 2014 15:33:08 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NA600B1FKV7TI20@mmp1.samsung.com>; Tue, 12 Aug 2014 15:33:08 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/mipi-dsi: consider low power transmission. Date: Tue, 12 Aug 2014 15:33:05 +0900 Message-id: <1407825186-5792-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1407825186-5792-1-git-send-email-inki.dae@samsung.com> References: <1407825186-5792-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkSFdl68tgg7UPFSxurTvHatF77iST xZWv79ksJt2fwOLA4rH92wNWj/vdx5k8+rasYgxgjuKySUnNySxLLdK3S+DK+Hj3K3PBNMGK m+fb2BsYN/F1MXJySAiYSPw88pwZwhaTuHBvPVsXIxeHkMBSRok/c1tYYYpuHWpmgUgsYpTY 2PGVEcLpZpI4MbERrJ1NQFVi4or7bCC2iICyxN+JqxhBbGYBL4nGy+tYQGxhAWeJ89tbwWwW oPoVP46B1fMCxb/P3cLexcgBtE1BYs4kG5Awp4CLxMElE5hAbCGgkt3vjjKD7JUQ+M4mMffq XCaIOQIS3yYfYoHolZXYdADqG0mJgytusExgFF7AyLCKUTS1ILmgOCm9yEivODG3uDQvXS85 P3cTIzBsT/971reD8eYB60OMyUDjJjJLiSbnA8M+ryTe0NjMyMLUxNTYyNzSjDRhJXHeRQ+T goQE0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUwTu3ezzvNuSSXP/zQ4hx9HzHLNc2b2ipqdc3C Pxs75XHMbLBszq9d++2YF1/6rjdrggyZIzr12Z/bRRSevm8cM2t1w72PkdzFiz7Pif6jVO7+ omU/nzOrTHmsUFdS8t2+Q7z8deL5Zit2rUxRSll8vHL5RNZctossK8LEvoTcfvzGfeunF3OU WIozEg21mIuKEwGTbzfQcQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e+xgK7K1pfBBvvnSlrcWneO1aL33Ekm iytf37NZTLo/gcWBxWP7twesHve7jzN59G1ZxRjAHNXAaJORmpiSWqSQmpecn5KZl26r5B0c 7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDtE9JoSwxpxQoFJBYXKykb4dpQmiIm64FTGOE rm9IEFyPkQEaSFjDmPHx7lfmgmmCFTfPt7E3MG7i62Lk5JAQMJG4daiZBcIWk7hwbz1bFyMX h5DAIkaJjR1fGSGcbiaJExMbmUGq2ARUJSauuM8GYosIKEv8nbiKEcRmFvCSaLy8DmySsICz xPntrWA2C1D9ih/HwOp5geLf525h72LkANqmIDFnkg1ImFPAReLgkglMILYQUMnud0eZJzDy LmBkWMUomlqQXFCclJ5rqFecmFtcmpeul5yfu4kRHBXPpHYwrmywOMQowMGoxMM74++LYCHW xLLiytxDjBIczEoivFGNL4OFeFMSK6tSi/Lji0pzUosPMZoCHTWRWUo0OR8YsXkl8YbGJmZG lkbmhhZGxuZK4rwHWq0DhQTSE0tSs1NTC1KLYPqYODilGhiz7guH5E8Q7K7aHFQhZRUstJ7r z8uFxgYneKPiZjwXP//Bc/nS0ltextYOvY2voovXPD+fPC3v0qYb9247nuNo3T1FTiNbWZPx ZNuZ2jAjocuhp5x/JbD9PbrJ88jiyg9C5Vnb9bbFdmrf35zq8Hr6Da2rGR84PwW/khez7Gat CL1qU990VFmJpTgj0VCLuag4EQB6zCpxoAIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: a.hajda@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 This patch adds a new flag, MIPI_DSI_MODE_LPM, to transmit data in low power. With this flag, msg.flags has MIPI_DSI_MSG_USE_LPM so that host driver of each SoC can clear or set relevant register bit for low power transmission. All host controllers shall support continuous clock behavior on the Clock Lane, and optionally may support non-continuous clock behavior. Both of them can transmit data in high speed or low power. With each clock behavior, non-continuous or continuous clock mode, host controller will transmit data in high speed by default so if peripheral want to receive data in low power, the peripheral driver should set MIPI_DSI_MODE_LPM flag. Signed-off-by: Inki Dae --- drivers/gpu/drm/drm_mipi_dsi.c | 6 ++++++ include/drm/drm_mipi_dsi.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index e633df2..6cc0720 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -232,6 +232,9 @@ int mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel, break; } + if (dsi->mode_flags & MIPI_DSI_MODE_LPM) + msg.flags = MIPI_DSI_MSG_USE_LPM; + return ops->transfer(dsi->host, &msg); } EXPORT_SYMBOL(mipi_dsi_dcs_write); @@ -262,6 +265,9 @@ ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel, if (!ops || !ops->transfer) return -ENOSYS; + if (dsi->mode_flags & MIPI_DSI_MODE_LPM) + msg.flags = MIPI_DSI_MSG_USE_LPM; + return ops->transfer(dsi->host, &msg); } EXPORT_SYMBOL(mipi_dsi_dcs_read); diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index efa1b55..90d9f71 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -96,6 +96,8 @@ void mipi_dsi_host_unregister(struct mipi_dsi_host *host); #define MIPI_DSI_MODE_EOT_PACKET BIT(9) /* device supports non-continuous clock behavior (DSI spec 5.6.1) */ #define MIPI_DSI_CLOCK_NON_CONTINUOUS BIT(10) +/* transmit data in low power */ +#define MIPI_DSI_MODE_LPM BIT(11) enum mipi_dsi_pixel_format { MIPI_DSI_FMT_RGB888,