aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-07-27 07:24:29 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-27 10:23:29 -0400
commit8c10342cb48f3140d9abeadcfd2fa6625d447282 (patch)
tree6c30fe623fad2bc59a866c48017c9f07bcc9b31c /drivers/gpu/drm/drm_atomic_helper.c
parent9a69a9ac20f7f3435dd18019f902351c61a9ad1d (diff)
drm/atomic: Update legacy DPMS state during modesets, v3.
This is required for DPMS to work correctly, during a modeset the DPMS property should be turned off, unless the state is crtc is made active in which case it should be set to DPMS on. Changes since v1: - Set DPMS to off when a connector is removed from a crtc too. - Update the legacy dpms property too. - Add an exception for the legacy dpms paths, it updates its own state. Changes since v2: - Do not preserve dpms property. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 57847ae8ce8c..0b475fae067d 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -660,15 +660,29 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
660 struct drm_crtc_state *old_crtc_state; 660 struct drm_crtc_state *old_crtc_state;
661 int i; 661 int i;
662 662
663 /* clear out existing links */ 663 /* clear out existing links and update dpms */
664 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 664 for_each_connector_in_state(old_state, connector, old_conn_state, i) {
665 if (!connector->encoder) 665 if (connector->encoder) {
666 continue; 666 WARN_ON(!connector->encoder->crtc);
667
668 connector->encoder->crtc = NULL;
669 connector->encoder = NULL;
670 }
667 671
668 WARN_ON(!connector->encoder->crtc); 672 crtc = connector->state->crtc;
673 if ((!crtc && old_conn_state->crtc) ||
674 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) {
675 struct drm_property *dpms_prop =
676 dev->mode_config.dpms_property;
677 int mode = DRM_MODE_DPMS_OFF;
669 678
670 connector->encoder->crtc = NULL; 679 if (crtc && crtc->state->active)
671 connector->encoder = NULL; 680 mode = DRM_MODE_DPMS_ON;
681
682 connector->dpms = mode;
683 drm_object_property_set_value(&connector->base,
684 dpms_prop, mode);
685 }
672 } 686 }
673 687
674 /* set new links */ 688 /* set new links */