diff mbox

[05/11] drm/i915: Do not try to enable PSR when Panel doesn't suport it.

Message ID 1400199190-2424-6-git-send-email-rodrigo.vivi@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi May 16, 2014, 12:13 a.m. UTC
Also do not cache aux info. That info could be related to another panel.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Chris Wilson May 16, 2014, 10:21 a.m. UTC | #1
On Thu, May 15, 2014 at 08:13:04PM -0400, Rodrigo Vivi wrote:
> Also do not cache aux info. That info could be related to another panel.

You should kill the bool sink_support then. There are other places that
it used that could be invalid.

I'm not sure though that we can cope with eDP panels being swapped at
runtime.
-Chris
Rodrigo Vivi May 16, 2014, 4:39 p.m. UTC | #2
On Fri, May 16, 2014 at 3:21 AM, Chris Wilson <chris@chris-wilson.co.uk>wrote:

> On Thu, May 15, 2014 at 08:13:04PM -0400, Rodrigo Vivi wrote:
> > Also do not cache aux info. That info could be related to another panel.
>
> You should kill the bool sink_support then. There are other places that
> it used that could be invalid.


the point here was to keep the info for debugfs in a simple way.


>
> I'm not sure though that we can cope with eDP panels being swapped at
> runtime.
>

the point wan't swap, but the possibility of having more than one eDP in
the future, but anyway other parts of the could should be changed to
support this.

so maybe just get back to the origial version keeping it on sink_support...


> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index fe28eb7..8b2f1a4 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1605,11 +1605,9 @@  static void intel_dp_get_config(struct intel_encoder *encoder,
 	}
 }
 
-static bool is_edp_psr(struct drm_device *dev)
+static bool is_edp_psr(struct intel_dp *intel_dp)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
-
-	return dev_priv->psr.sink_support;
+	return intel_dp->psr_dpcd[0] & DP_PSR_IS_SUPPORTED;
 }
 
 static bool intel_edp_is_psr_enabled(struct drm_device *dev)
@@ -1813,6 +1811,11 @@  void intel_edp_psr_enable(struct intel_dp *intel_dp)
 		return;
 	}
 
+	if (!is_edp_psr(intel_dp)) {
+		DRM_DEBUG_KMS("PSR not supported by this panel\n");
+		return;
+	}
+
 	/* Setup PSR once */
 	intel_edp_psr_setup(intel_dp);
 
@@ -1854,9 +1857,6 @@  void intel_edp_psr_update(struct drm_device *dev)
 		if (encoder->type == INTEL_OUTPUT_EDP) {
 			intel_dp = enc_to_intel_dp(&encoder->base);
 
-			if (!is_edp_psr(dev))
-				return;
-
 			if (!intel_edp_psr_match_conditions(intel_dp))
 				intel_edp_psr_disable(intel_dp);
 			else