[Intel-gfx] [PATCH 02/13] drm/atomic: Update legacy DPMS state during modesets.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu Jul 16 01:59:15 PDT 2015


This is required for DPMS to work correctly, during a modeset
the DPMS property should be turned off, unless the crtc
is made active in which case it should be set to DPMS on.

Cc: dri-devel at lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 70e69904291d..cdec643971a2 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -642,6 +642,12 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
 
 	/* clear out existing links */
 	for_each_connector_in_state(old_state, connector, old_conn_state, i) {
+		struct drm_crtc *crtc = connector->state->crtc;
+
+		if (crtc &&
+		    drm_atomic_crtc_needs_modeset(crtc->state))
+			connector->dpms = DRM_MODE_DPMS_OFF;
+
 		if (!connector->encoder)
 			continue;
 
@@ -653,14 +659,20 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
 
 	/* set new links */
 	for_each_connector_in_state(old_state, connector, old_conn_state, i) {
-		if (!connector->state->crtc)
+		struct drm_crtc *crtc = connector->state->crtc;
+
+		if (!crtc)
 			continue;
 
+		if (crtc->state->active &&
+		    drm_atomic_crtc_needs_modeset(crtc->state))
+			connector->dpms = DRM_MODE_DPMS_ON;
+
 		if (WARN_ON(!connector->state->best_encoder))
 			continue;
 
 		connector->encoder = connector->state->best_encoder;
-		connector->encoder->crtc = connector->state->crtc;
+		connector->encoder->crtc = crtc;
 	}
 
 	/* set legacy state in the crtc structure */
-- 
2.1.0



More information about the Intel-gfx mailing list