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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux