From patchwork Mon Sep 24 11:16:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1497391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id C74A2DF280 for ; Mon, 24 Sep 2012 11:16:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4E1C9F751 for ; Mon, 24 Sep 2012 04:16:29 -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 D695F9E84B for ; Mon, 24 Sep 2012 04:16:13 -0700 (PDT) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAU00K80PYHVD50@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 24 Sep 2012 20:16:12 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-54-506040fc9487 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EF.37.03860.CF040605; Mon, 24 Sep 2012 20:16:12 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MAU0080BPZ0YB00@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 24 Sep 2012 20:16:12 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: fix display power call issue. Date: Mon, 24 Sep 2012 20:16:11 +0900 Message-id: <1348485371-7642-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1348484866-6487-1-git-send-email-inki.dae@samsung.com> References: <1348484866-6487-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJMWRmVeSWpSXmKPExsVy+t9jQd0/DgkBBlufKFhc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujA9/fzAVrBKpuHHwA0sD43nBLkYODgkBE4nJZxO7GDmBTDGJ C/fWs3UxcnEICUxnlDj0fgobSEJIYD2TxMuvYDabgKrExBX3wWwRAVOJjklLWUBsZoFCiYU9 T8FsYQFbiRdbT4DVsIDUX3gJFucVcJZY0tvMDLFMQWLBvbdgNZwCLhIvv01hhdjlLLFp/yam CYy8CxgZVjGKphYkFxQnpeca6RUn5haX5qXrJefnbmIEe/yZ9A7GVQ0WhxgFOBiVeHg3nIkP EGJNLCuuzD3EKMHBrCTCO9EwIUCINyWxsiq1KD++qDQntfgQozQHi5I4r/CnwAAhgfTEktTs 1NSC1CKYLBMHp1QDY9Rc4V3ejebGW1h2inovjzu4ec+PKxE30h8pHNW2vrtqTfJzdq59XE2t G4NZbxhKsOyayyxQNTt0vkGxHJ/E9PlqBXZrjy6vuKQlnKD5JXfS8QNThP9d+6y13qpTMLhN 3WFSPLf14TscX2WiZ26tUZ3Esczk1m7fwj8/G1YLrCn563FZ8pixnBJLcUaioRZzUXEiAC32 1G/0AQAA Cc: kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Changelog v2: remove static prefix so that exynos_drm_best_encoder function could be called by other modules. Changelog v1: this patch fixes the issue that display power callback isn't called. with DRM_IOCTL_MODE_RMFB request, encoder->connector becomes NULL so display_ops->power_on() wouldn't be called so this patch makes exynos_drm_best_encoder function to be used to get a valid encoder of each connector. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_connector.c | 3 +-- drivers/gpu/drm/exynos/exynos_drm_connector.h | 2 ++ drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index 87cf378..04651f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c @@ -199,8 +199,7 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector, return ret; } -static struct drm_encoder *exynos_drm_best_encoder( - struct drm_connector *connector) +struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct exynos_drm_connector *exynos_connector = diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.h b/drivers/gpu/drm/exynos/exynos_drm_connector.h index 40a55c2..22f6cc4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.h +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.h @@ -31,6 +31,8 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev, struct drm_encoder *encoder); +struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector); + void exynos_drm_display_power(struct drm_connector *connector, int mode); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 96a10c3..db1f7ed 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -57,7 +57,7 @@ static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode) struct drm_connector *connector; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - if (connector->encoder == encoder) { + if (exynos_drm_best_encoder(connector) == encoder) { DRM_DEBUG_KMS("connector[%d] dpms[%d]\n", connector->base.id, mode);