aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-14 18:13:13 -0400
committerDave Airlie <airlied@redhat.com>2013-06-24 21:01:30 -0400
commit372835a8527f85b3eff20a18c2c339e827dfd4e4 (patch)
treea9c1661e5236eb523d1d4d85af1d0dab29a97c04 /drivers/gpu/drm/drm_crtc_helper.c
parentcbdfebc972adb7c09b56e6aae06d81b5c1edd2cb (diff)
drm/crtc-helper: explicit DPMS on after modeset
Atm the crtc helper implementation of set_config has really inconsisten semantics: If just an fb update is good enough, dpms state will be left as-is, but if we do a full modeset we force everything to dpms on. This change has already been applied to the i915 modeset code in commit e3de42b68478a8c95dd27520e9adead2af9477a5 Author: Imre Deak <imre.deak@intel.com> Date: Fri May 3 19:44:07 2013 +0200 drm/i915: force full modeset if the connector is in DPMS OFF mode which according to Greg KH seems to aim for a new record in most Bugzilla: links in a commit message. The history of this dpms forcing is pretty interesting. This patch here is an almost-revert of commit 811aaa55ba21ab37407018cfc01770d6b037d3fb Author: Keith Packard <keithp@keithp.com> Date: Thu Feb 3 16:57:28 2011 -0800 drm: Only set DPMS ON when actually configuring a mode which fixed the bug of trying to dpms on disabled outputs, but introduced the new discrepancy between an fb update only and full modesets. The actual introduction of this goes back to commit bf9dc102e284a5aa78c73fc9d72e11d5ccd8669f Author: Keith Packard <keithp@keithp.com> Date: Fri Nov 26 10:45:58 2010 -0800 drm: Set connector DPMS status to ON in drm_crtc_helper_set_config And if you'd dig around in the i915 driver code there's even more fun around forcing dpms on and losing our heads and temper of the resulting inconsistencies. Especially the DP re-training code had tons of funny stuff in it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1ace9c11a3ed..738a4294d820 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -754,12 +754,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
754 ret = -EINVAL; 754 ret = -EINVAL;
755 goto fail; 755 goto fail;
756 } 756 }
757 DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
758 for (i = 0; i < set->num_connectors; i++) {
759 DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
760 drm_get_connector_name(set->connectors[i]));
761 set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON);
762 }
763 } 757 }
764 drm_helper_disable_unused_functions(dev); 758 drm_helper_disable_unused_functions(dev);
765 } else if (fb_changed) { 759 } else if (fb_changed) {
@@ -777,6 +771,22 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
777 } 771 }
778 } 772 }
779 773
774 /*
775 * crtc set_config helpers implicit set the crtc and all connected
776 * encoders to DPMS on for a full mode set. But for just an fb update it
777 * doesn't do that. To not confuse userspace, do an explicit DPMS_ON
778 * unconditionally. This will also ensure driver internal dpms state is
779 * consistent again.
780 */
781 if (set->crtc->enabled) {
782 DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
783 for (i = 0; i < set->num_connectors; i++) {
784 DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
785 drm_get_connector_name(set->connectors[i]));
786 set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON);
787 }
788 }
789
780 kfree(save_connectors); 790 kfree(save_connectors);
781 kfree(save_encoders); 791 kfree(save_encoders);
782 kfree(save_crtcs); 792 kfree(save_crtcs);