From patchwork Mon Aug 18 08:11:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4732731 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EA09C0338 for ; Mon, 18 Aug 2014 08:11:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B954B20120 for ; Mon, 18 Aug 2014 08:11:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ED8552012D for ; Mon, 18 Aug 2014 08:11:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C3596E123; Mon, 18 Aug 2014 01:11:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id C871889E3B for ; Mon, 18 Aug 2014 01:11:38 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAH00FJ1TFDQCC0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 18 Aug 2014 17:11:37 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 28.53.25328.935B1F35; Mon, 18 Aug 2014 17:11:37 +0900 (KST) X-AuditID: cbfee68d-b7f2f6d0000062f0-17-53f1b539ebed Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D2.A8.05196.935B1F35; Mon, 18 Aug 2014 17:11:37 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NAH00301TFC8V30@mmp2.samsung.com>; Mon, 18 Aug 2014 17:11:37 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/mipi-dsi: consider low power transmission Date: Mon, 18 Aug 2014 17:11:34 +0900 Message-id: <1408349495-25568-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1408349495-25568-1-git-send-email-inki.dae@samsung.com> References: <1408349495-25568-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkUNdy68dgg47Nsha31p1jteg9d5LJ 4srX92wWk+5PYHFg8dj+7QGrx/3u40wefVtWMQYwR3HZpKTmZJalFunbJXBlPDjwiKVgomDF /LUbGRsY1/B1MXJySAiYSPx618sOYYtJXLi3nq2LkYtDSGApo8T3pwsZuxg5wIpmLoyBiE9n lDi55D1UUTeTROObBYwg3WwCqhITV9xnA7FFBJQl/k5cBRZnFvCSaLy8jgXEFhZwkph4dRPY Nhag+rZDO5hAbF4BF4kvE95ALVOQmDPJBiTMKeAqMeXtWbASIaCSj183soPslRD4ziYxbc82 Zog5AhLfJh9igeiVldh0gBniGUmJgytusExgFF7AyLCKUTS1ILmgOCm9yFCvODG3uDQvXS85 P3cTIzBoT/971ruD8fYB60OMyUDjJjJLiSbnA4M+ryTe0NjMyMLUxNTYyNzSjDRhJXHepIdJ QUIC6YklqdmpqQWpRfFFpTmpxYcYmTg4pRoYLXOdJ93jufv+vtzG5YY1FxfOXS7b77U5ehsf n5eoO/vHpuNhFR/r9m676FNWcvUth2DEx64j/oFz1j4oO1Xd8ynTPGBe8T7P3/K15gJ8vZsn nVXuYzHM0ZwyIe6Nfb3Z0TscV7d4yD6JlxORaJb5+Wup3/qSkBjlV5zKbvpLdi6ym1I+Ve+v EktxRqKhFnNRcSIAxp2MT3ACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoK7l1o/BBtP+ilrcWneO1aL33Ekm iytf37NZTLo/gcWBxWP7twesHve7jzN59G1ZxRjAHNXAaJORmpiSWqSQmpecn5KZl26r5B0c 7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDtE9JoSwxpxQoFJBYXKykb4dpQmiIm64FTGOE rm9IEFyPkQEaSFjDmPHgwCOWgomCFfPXbmRsYFzD18XIwSEhYCIxc2FMFyMnkCkmceHeerYu Ri4OIYHpjBInl7yHcrqZJBrfLGAEqWITUJWYuOI+G4gtIqAs8XfiKrA4s4CXROPldSwgtrCA k8TEq5vYQWwWoPq2QzuYQGxeAReJLxPeMEIsVpCYM8kGJMwp4Cox5e1ZsBIhoJKPXzeyT2Dk XcDIsIpRNLUguaA4KT3XSK84Mbe4NC9dLzk/dxMjOCaeSe9gXNVgcYhRgINRiYfX4/WHYCHW xLLiytxDjBIczEoivOuaPgYL8aYkVlalFuXHF5XmpBYfYjQFOmois5Rocj4wXvNK4g2NTcyM LI3MDS2MjM2VxHkPtloHCgmkJ5akZqemFqQWwfQxcXBKNTBOXfU5sI17R6//te3KNeyKDx0Z fk0sVxRalsFyolzDbPF68QdPGy5f0rTYbKSz7etN8W7GwCoX3bBFi7T9H7tNfHby8srFIb3y 7XduKOcf1Nm5dmJa0N4X271PFVjZHg9ReLthXeCWeK9V9dxbTHhuTAxOOy8+a8Z3izVfxMSe bNja2/PGtydBiaU4I9FQi7moOBEAJ0XwyZ8CAAA= 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 drivers 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 of 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 wants 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 6aa6a9e..eb6dfe5 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -231,6 +231,9 @@ ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, const void *data, 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); @@ -260,6 +263,9 @@ ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data, 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 2bb55b8..8569dc5 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,