[PATCH 1/3] drm/radeon/kms: use crtc-specific dpms functions in prepare and commit

Ilija Hadzic ihadzic at research.bell-labs.com
Tue Oct 25 19:40:51 PDT 2011


it's better that radeon_crtc_commit and radeon_crtc_prepare call
crtc-specific dpms functions instead of hard-coding them to
radeon_crtc_dpms.

Signed-off-by: Ilija Hadzic <ihadzic at research.bell-labs.com>
---
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 41a5d48..0690a5b 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -1036,8 +1036,11 @@ static void radeon_crtc_prepare(struct drm_crtc *crtc)
 	* The hardware wedges sometimes if you reconfigure one CRTC
 	* whilst another is running (see fdo bug #24611).
 	*/
-	list_for_each_entry(crtci, &dev->mode_config.crtc_list, head)
-		radeon_crtc_dpms(crtci, DRM_MODE_DPMS_OFF);
+	list_for_each_entry(crtci, &dev->mode_config.crtc_list, head) {
+		struct drm_crtc_helper_funcs *crtc_funcs = crtci->helper_private;
+		if  (crtc_funcs->dpms)
+			crtc_funcs->dpms(crtci, DRM_MODE_DPMS_OFF);
+	}
 }
 
 static void radeon_crtc_commit(struct drm_crtc *crtc)
@@ -1049,8 +1052,11 @@ static void radeon_crtc_commit(struct drm_crtc *crtc)
 	* Reenable the CRTCs that should be running.
 	*/
 	list_for_each_entry(crtci, &dev->mode_config.crtc_list, head) {
-		if (crtci->enabled)
-			radeon_crtc_dpms(crtci, DRM_MODE_DPMS_ON);
+		if (crtci->enabled) {
+			struct drm_crtc_helper_funcs *crtc_funcs = crtci->helper_private;
+			if  (crtc_funcs->dpms)
+				crtc_funcs->dpms(crtci, DRM_MODE_DPMS_ON);
+		}
 	}
 }
 
-- 
1.7.7



More information about the dri-devel mailing list