[Intel-gfx] [PATCH] drm/i915: do not set redundant DP dpms mode

Simon Que sque at chromium.org
Tue Oct 23 22:18:46 CEST 2012


Add a check to intel_dp_dpms() to skip setting the DP's DPMS mode if
the current mode is the same as the new one.

Signed-off-by: Simon Que <sque at chromium.org>
---
 drivers/gpu/drm/i915/intel_dp.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c71e0f0..ba86b4f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1311,8 +1311,13 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
 	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_connector *connector;
 	uint32_t dp_reg = I915_READ(intel_dp->output_reg);
 
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+		if (connector->encoder == encoder && connector->dpms == mode)
+			return;
+
 	if (mode != DRM_MODE_DPMS_ON) {
 		ironlake_edp_backlight_off(intel_dp);
 		ironlake_edp_panel_off(intel_dp);
-- 
1.7.8.6




More information about the Intel-gfx mailing list