From 52a81f8b73557d2cda5139805f9e62a5fad3a1f2 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Thu, 21 Mar 2013 06:06:35 -0400 Subject: [PATCH] drm/i915: Do full Modeset if a Connector on CRTC is in Power Save State. Whenever intel_crtc_set_config() does a full mode set it activates all encoders that are connected to the CRTC, thus if there were in a power save state before they get enabled. If however a full modeset is not required these encoders are left in their power save state. This asymetry in behavior sometimes causes unexpected bahavior. The easist way to fix this is to check for the power save states of the associated connectors and set the full modeset flag if one of them is in a power save state. Signed-off-by: Egbert Eich --- drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2939524..bc4a146 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8513,6 +8513,22 @@ next_encoder: return 0; } +static bool intel_set_config_pm_connectors(struct drm_device *dev, struct drm_crtc *crtc) +{ + struct intel_connector *intel_connector; + list_for_each_entry(intel_connector, &dev->mode_config.connector_list, base.head) { + struct intel_encoder *intel_encoder = intel_connector->new_encoder; + + if (intel_encoder && + &intel_encoder->new_crtc->base == crtc && + intel_connector->base.dpms != DRM_MODE_DPMS_ON) { + return true; + } + } + return false; +} + + static int intel_crtc_set_config(struct drm_mode_set *set) { struct drm_device *dev; @@ -8563,6 +8579,14 @@ static int intel_crtc_set_config(struct drm_mode_set *set) if (ret) goto fail; + /* if any connectors on the crtc are in any other state than DRM_MODE_DPMS_ON + * make sure they are activated when setting the config. The easiest way to + * do this is to run a full modeset */ + if (intel_set_config_pm_connectors(dev,set->crtc)) { + DRM_DEBUG_KMS("connectors on this crtc in power save mode, full mode set\n"); + config->mode_changed = true; + } + if (config->mode_changed) { if (set->mode) { DRM_DEBUG_KMS("attempting to set mode from" -- 1.8.1.4