aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2013-05-03 13:44:07 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-22 03:09:22 -0400
commite3de42b68478a8c95dd27520e9adead2af9477a5 (patch)
tree9fd2c21217c6fb158e738e3856228fddc442b5a6 /drivers/gpu/drm/i915/intel_display.c
parent2d05eae1c92f93ace0fc6f282c55527d293297dd (diff)
drm/i915: force full modeset if the connector is in DPMS OFF mode
Currently the driver's assumed behavior for a modeset with an attached FB is that the corresponding connector will be switched to DPMS ON mode if it happened to be in DPMS OFF (or another power save mode). This wasn't enforced though if only the FB changed, everything else (format, connector etc.) remaining the same. In this case we only set the new FB base and left the connector in the old power save mode. Fix this by forcing a full modeset whenever there is an attached FB and any affected connector is in a power save mode. V_2: Run the test for encoders in power save mode outside the the test for fb change: user space may have just disabled the encoders but left everything else in place. Make sure the connector list is not empty before running this test. Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Egbert Eich <eich@suse.de> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61642 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59834 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59339 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64178 Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> [danvet: Apply Jani's s/connector_off/is_crtc_connector_off bikeshed.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 300942a7d144..ad1117bebd7e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8140,6 +8140,21 @@ static void intel_set_config_restore_state(struct drm_device *dev,
8140 } 8140 }
8141} 8141}
8142 8142
8143static bool
8144is_crtc_connector_off(struct drm_crtc *crtc, struct drm_connector *connectors,
8145 int num_connectors)
8146{
8147 int i;
8148
8149 for (i = 0; i < num_connectors; i++)
8150 if (connectors[i].encoder &&
8151 connectors[i].encoder->crtc == crtc &&
8152 connectors[i].dpms != DRM_MODE_DPMS_ON)
8153 return true;
8154
8155 return false;
8156}
8157
8143static void 8158static void
8144intel_set_config_compute_mode_changes(struct drm_mode_set *set, 8159intel_set_config_compute_mode_changes(struct drm_mode_set *set,
8145 struct intel_set_config *config) 8160 struct intel_set_config *config)
@@ -8147,7 +8162,11 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
8147 8162
8148 /* We should be able to check here if the fb has the same properties 8163 /* We should be able to check here if the fb has the same properties
8149 * and then just flip_or_move it */ 8164 * and then just flip_or_move it */
8150 if (set->crtc->fb != set->fb) { 8165 if (set->connectors != NULL &&
8166 is_crtc_connector_off(set->crtc, *set->connectors,
8167 set->num_connectors)) {
8168 config->mode_changed = true;
8169 } else if (set->crtc->fb != set->fb) {
8151 /* If we have no fb then treat it as a full mode set */ 8170 /* If we have no fb then treat it as a full mode set */
8152 if (set->crtc->fb == NULL) { 8171 if (set->crtc->fb == NULL) {
8153 DRM_DEBUG_KMS("crtc has no fb, full mode set\n"); 8172 DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
@@ -8157,8 +8176,9 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
8157 } else if (set->fb->pixel_format != 8176 } else if (set->fb->pixel_format !=
8158 set->crtc->fb->pixel_format) { 8177 set->crtc->fb->pixel_format) {
8159 config->mode_changed = true; 8178 config->mode_changed = true;
8160 } else 8179 } else {
8161 config->fb_changed = true; 8180 config->fb_changed = true;
8181 }
8162 } 8182 }
8163 8183
8164 if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y)) 8184 if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y))