From patchwork Fri Aug 17 09:50:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1338291 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 C01A4DF266 for ; Fri, 17 Aug 2012 09:57:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9EB1A0DD6 for ; Fri, 17 Aug 2012 02:57:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id A5403A0E20 for ; Fri, 17 Aug 2012 02:51:05 -0700 (PDT) Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8W00BBS8OHZZ00@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 17 Aug 2012 18:51:02 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-df-502e1406f432 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 34.6E.18282.6041E205; Fri, 17 Aug 2012 18:51:02 +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 <0M8W005HH8OZZTB0@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 17 Aug 2012 18:51:02 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 07/13] drm/exynos: control display power at connector module. Date: Fri, 17 Aug 2012 18:50:53 +0900 Message-id: <1345197059-25583-8-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1345197059-25583-1-git-send-email-inki.dae@samsung.com> References: <1345197059-25583-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jQV02Eb0Ag1OvdCyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxrZ7h9gKOiQqmhtXMDUwHhfpYuTkkBAwkfj1ehU7hC0mceHe erYuRi4OIYHpjBJbNlwCSwgJrGeSePPFEMRmE1CVmLjiPhuILSJgKtExaSkLiM0sUCixsOcp mC0s4Csx8dJRMJsFqP7SzkWMIDavgItE994/jBDLFCQW3HsLNodTwFXi7vLJTBC7XCQaN/ew TmDkXcDIsIpRNLUguaA4KT3XSK84Mbe4NC9dLzk/dxMj2OfPpHcwrmqwOMQowMGoxMN7oEw3 QIg1say4MvcQowQHs5II74qPQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8Xv+BUgLpiSWp2amp BalFMFkmDk6pBka9/6wnJytfYZtU9cFcfr5Wos9n4aqkpPLDIYFdPK2SUs5ed8Nz32aeFs3R 7gz9zeBkKnLn0Oa4fvENtimcVYfLTt5dfMLvaL7QVObD6+bdqm5fcTHVaFfI63qdOwzLl02Z nXs+XqAz4Nnyb2sWx630txF/K/d4TrZp5vOLJRpWy47s3P7hE6cSS3FGoqEWc1FxIgBjbD9p 9QEAAA== X-TM-AS-MML: No 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 it doesn't need that display power is controlled by encoder's dpms so moves it into connector module so that the display power can be controlled by connector's dpms propely. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_connector.c | 11 ++++++++++- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 21 --------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c index 65acf0d..d2ac6ed 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c @@ -226,11 +226,20 @@ static struct drm_connector_helper_funcs exynos_connector_helper_funcs = { .best_encoder = exynos_drm_best_encoder, }; +static void exynos_drm_display_power(struct drm_encoder *encoder, int mode) +{ + struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); + struct exynos_drm_display_ops *display_ops = manager->display_ops; + + if (display_ops && display_ops->power_on) + display_ops->power_on(manager->dev, mode); +} + static void exynos_drm_connector_dpms(struct drm_connector *connector, int mode) { DRM_DEBUG_KMS("%s\n", __FILE__); - /* drm framework doesn't check NULL. */ + exynos_drm_display_power(connector->encoder, mode); } static int exynos_drm_connector_fill_modes(struct drm_connector *connector, diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 3dae250..7da5714 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -49,25 +49,6 @@ struct exynos_drm_encoder { int dpms; }; -static void exynos_drm_display_power(struct drm_encoder *encoder, int mode) -{ - struct drm_device *dev = encoder->dev; - struct drm_connector *connector; - struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); - - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - if (connector->encoder == encoder) { - struct exynos_drm_display_ops *display_ops = - manager->display_ops; - - DRM_DEBUG_KMS("connector[%d] dpms[%d]\n", - connector->base.id, mode); - if (display_ops && display_ops->power_on) - display_ops->power_on(manager->dev, mode); - } - } -} - static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) { struct drm_device *dev = encoder->dev; @@ -88,13 +69,11 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) case DRM_MODE_DPMS_ON: if (manager_ops && manager_ops->apply) manager_ops->apply(manager->dev); - exynos_drm_display_power(encoder, mode); exynos_encoder->dpms = mode; break; case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_OFF: - exynos_drm_display_power(encoder, mode); exynos_encoder->dpms = mode; break; default: