From a1ac7f527f71bf96b1e4de88f9d222fe730222b6 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Tue, 30 Apr 2013 17:48:55 +0300 Subject: [PATCH] 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. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60002 Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 1128f83..f6be4fc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8376,6 +8376,21 @@ static void intel_set_config_restore_state(struct drm_device *dev, } } +static bool +connector_off(struct drm_crtc *crtc, struct drm_connector *connectors, + int num_connectors) +{ + int i; + + for (i = 0; i < num_connectors; i++) + if (connectors[i].encoder && + connectors[i].encoder->crtc == crtc && + connectors[i].dpms != DRM_MODE_DPMS_ON) + return true; + + return false; +} + static void intel_set_config_compute_mode_changes(struct drm_mode_set *set, struct intel_set_config *config) @@ -8393,8 +8408,12 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set, } else if (set->fb->pixel_format != set->crtc->fb->pixel_format) { config->mode_changed = true; - } else + } else if (connector_off(set->crtc, *set->connectors, + set->num_connectors)) { + config->mode_changed = true; + } else { config->fb_changed = true; + } } if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y)) -- 1.7.10.4