Skip to contentSkip to conversation

PSR Baytrail

PATCH In review Rodrigo Vivi 3 participants 20 messages Feb 28, 2014 – Mar 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover PSR Baytrail

Hi all this series enable PSR on Baytrail.

This is basically the patch "drm/i915: Add Baytrail PSR support." patch split in small patches to make the review easier.

This version contains almost all suggestions and bikesheds I got on that single patch and more fixes.

Thanks,
Rodrigo.

Rodrigo Vivi (11):
drm/i915: Set primary plane enable at dpcntrl. drm/i915: move psr_setup_done to psr struct
drm/i915: Force full PSR setup on resume.
drm/i915: Use HAS_PSR to avoid unecessary interactions. drm/i915: Don't let update_psr function actually enable PSR. drm/i915: Do not try to enable PSR when Panel doesn't suport it. drm/i915: Baytrail PSR: regs setup, enable and disable functions. drm/i915: PSR Baytrail debugfs.
drm/i915: PSR Baytrail: Disable it on Pipe B
drm/i915: PSR Baytrail: Force exit by inactivating it. drm/i915: Enable PSR on Baytrail.

 drivers/gpu/drm/i915/i915_debugfs.c  |  36 ++++-
 drivers/gpu/drm/i915/i915_drv.h      |  11 +-
 drivers/gpu/drm/i915/i915_gem.c      |  12 ++
 drivers/gpu/drm/i915/i915_reg.h      |  37 +++++
 drivers/gpu/drm/i915/i915_suspend.c  |   3 +
 drivers/gpu/drm/i915/intel_display.c |  39 ++++-
 drivers/gpu/drm/i915/intel_dp.c      | 284 ++++++++++++++++++++++++++++++-----
 drivers/gpu/drm/i915/intel_drv.h     |   3 +-
 8 files changed, 382 insertions(+), 43 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/11 drm/i915: Set primary plane enable at dpcntrl.

This patch allows system to safely recover after kms_psr_sink_crc check or any other similar case that might fail when PSR is enabled.

Ville made and sent me this patch after noticing that primary plane enabled bit was set during test case and unset after failure. What was causing a hard and non-recoverable blank screen.

After the failure when alternating from fbcon to x section it was possible to see and move mouse cursor, but nothing else. Everything else was fully black. A for dpms off/on also haleped to get screen back. But this patch seeting primary plane enabled bit propertly seemed more clean.

v2: Fix identation issue.
v3: Add the XXX comment.

Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index 2e05d1e..e23ff4c 100644
@@ -2118,6 +2118,9 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 	if (IS_G4X(dev))
 		dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
 
+	if (intel_crtc->primary_enabled)
+		dspcntr |= DISPLAY_PLANE_ENABLE;
+
 	I915_WRITE(reg, dspcntr);
 
 	linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
@@ -2215,6 +2218,9 @@ static int ironlake_update_plane(struct drm_crtc *crtc,
 	else
 		dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
 
+	if (intel_crtc->primary_enabled)
+		dspcntr |= DISPLAY_PLANE_ENABLE;
+
 	I915_WRITE(reg, dspcntr);
 
 	linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
@@ -8633,6 +8639,13 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
 	intel_ring_emit(ring, i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset);
 	intel_ring_emit(ring, (MI_NOOP));
 
+	/* XXX: Ugly hack to avoid PSR test case eventually breaking things up
+	 * to be removed whenever it is fixed. */
+	if (IS_VALLEYVIEW(dev) && intel_crtc->primary_enabled)
+		I915_WRITE(DSPCNTR(intel_crtc->plane),
+			   I915_READ(DSPCNTR(intel_crtc->plane))
+			   | DISPLAY_PLANE_ENABLE);
+
 	intel_mark_page_flip_active(intel_crtc);
 	__intel_ring_advance(ring);
 	return 0;
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/11 drm/i915: move psr_setup_done to psr struct

In reply to Rodrigo Vivi

v2: Avoid more than one setup. Removing initialization
and trusting allocation. (By Paulo Zanoni).
v3: rebase.

---
 drivers/gpu/drm/i915/i915_drv.h  | 1 +
 drivers/gpu/drm/i915/intel_dp.c  | 6 ++----
 drivers/gpu/drm/i915/intel_drv.h | 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 05cfcc1..c5abff7 100644
@@ -782,6 +782,7 @@ struct i915_fbc {
 struct i915_psr {
 	bool sink_support;
 	bool source_ok;
+	bool setup_done;
 };
 
 enum intel_pch {
drivers/gpu/drm/i915/intel_dp.c +2 -4
index c512d78..83b3c13 100644
@@ -1657,7 +1657,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct edp_vsc_psr psr_vsc;
 
-	if (intel_dp->psr_setup_done)
+	if (dev_priv->psr.setup_done)
 		return;
 
 	/* Prepare VSC packet as per EDP 1.3 spec, Table 3.10 */
@@ -1672,7 +1672,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
 	I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP |
 		   EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP);
 
-	intel_dp->psr_setup_done = true;
+	dev_priv->psr.setup_done = true;
 }
 
 static void intel_edp_psr_enable_sink(struct intel_dp *intel_dp)
@@ -3881,8 +3881,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	WARN(error, "intel_dp_i2c_init failed with error %d for port %c\n",
 	     error, port_name(port));
 
-	intel_dp->psr_setup_done = false;
-
 	if (!intel_edp_init_connector(intel_dp, intel_connector, &power_seq)) {
 		i2c_del_adapter(&intel_dp->adapter);
 		if (is_edp(intel_dp)) {
drivers/gpu/drm/i915/intel_drv.h +0 -1
index a4ffc02..180d602 100644
@@ -498,7 +498,6 @@ struct intel_dp {
 	unsigned long last_power_cycle;
 	unsigned long last_power_on;
 	unsigned long last_backlight_off;
-	bool psr_setup_done;
 	bool use_tps3;
 	struct intel_connector *attached_connector;
 
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/11 drm/i915: Force full PSR setup on resume.

In reply to Rodrigo Vivi
---
 drivers/gpu/drm/i915/i915_suspend.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_suspend.c +3 -0
index 56785e8..77a2194 100644
@@ -288,6 +288,9 @@ static void i915_restore_display(struct drm_device *dev)
 		I915_WRITE(PP_CONTROL, dev_priv->regfile.savePP_CONTROL);
 	}
 
+	/* Force a full PSR setup on resume */
+	dev_priv->psr.setup_done = false;
+
 	/* only restore FBC info on the platform that supports FBC*/
 	intel_disable_fbc(dev);
 
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/11 drm/i915: Use HAS_PSR to avoid unecessary interactions.

In reply to Rodrigo Vivi

Let's be more conservative and protect platforms that don't support PSR from unecessary interactions.

---
 drivers/gpu/drm/i915/intel_dp.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +8 -5
index 83b3c13..51be6e7 100644
@@ -1741,11 +1741,6 @@ static bool intel_edp_psr_match_conditions(struct intel_dp *intel_dp)
 
 	dev_priv->psr.source_ok = false;
 
-	if (!HAS_PSR(dev)) {
-		DRM_DEBUG_KMS("PSR not supported on this platform\n");
-		return false;
-	}
-
 	if ((intel_encoder->type != INTEL_OUTPUT_EDP) ||
 	    (dig_port->port != PORT_A)) {
 		DRM_DEBUG_KMS("HSW ties PSR to DDI A (eDP)\n");
@@ -1818,6 +1813,11 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp_to_dev(intel_dp);
 
+	if (!HAS_PSR(dev)) {
+		DRM_DEBUG_KMS("PSR not supported on this platform\n");
+		return;
+	}
+
 	if (intel_edp_psr_match_conditions(intel_dp) &&
 	    !intel_edp_is_psr_enabled(dev))
 		intel_edp_psr_do_enable(intel_dp);
@@ -1845,6 +1845,9 @@ void intel_edp_psr_update(struct drm_device *dev)
 	struct intel_encoder *encoder;
 	struct intel_dp *intel_dp = NULL;
 
+	if (!HAS_PSR(dev))
+		return;
+
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head)
 		if (encoder->type == INTEL_OUTPUT_EDP) {
 			intel_dp = enc_to_intel_dp(&encoder->base);
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 5/11 drm/i915: Don't let update_psr function actually enable PSR.

In reply to Rodrigo Vivi

Being more conservative by enabling PSR only on psr_enable function.

---
 drivers/gpu/drm/i915/intel_dp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +7 -3
index 51be6e7..68baa8c 100644
@@ -1799,9 +1799,6 @@ static void intel_edp_psr_do_enable(struct intel_dp *intel_dp)
 	    intel_edp_is_psr_enabled(dev))
 		return;
 
-	/* Setup PSR once */
-	intel_edp_psr_setup(intel_dp);
-
 	/* Enable PSR on the panel */
 	intel_edp_psr_enable_sink(intel_dp);
 
@@ -1818,6 +1815,9 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp)
 		return;
 	}
 
+	/* Setup PSR once */
+	intel_edp_psr_setup(intel_dp);
+
 	if (intel_edp_psr_match_conditions(intel_dp) &&
 	    !intel_edp_is_psr_enabled(dev))
 		intel_edp_psr_do_enable(intel_dp);
@@ -1842,12 +1842,16 @@ void intel_edp_psr_disable(struct intel_dp *intel_dp)
 
 void intel_edp_psr_update(struct drm_device *dev)
 {
+	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_encoder *encoder;
 	struct intel_dp *intel_dp = NULL;
 
 	if (!HAS_PSR(dev))
 		return;
 
+	if (!dev_priv->psr.setup_done)
+		return;
+
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head)
 		if (encoder->type == INTEL_OUTPUT_EDP) {
 			intel_dp = enc_to_intel_dp(&encoder->base);
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 6/11 drm/i915: Do not try to enable PSR when Panel doesn't suport it.

In reply to Rodrigo Vivi

Also do not cache aux info. That info could be related to another panel.

---
 drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +7 -7
index 68baa8c..0799882 100644
@@ -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)
@@ -1815,6 +1813,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);
 
@@ -1856,9 +1859,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
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 7/11 drm/i915: Baytrail PSR: regs setup, enable and disable functions.

In reply to Rodrigo Vivi

This patch just introduce registers and functions for PSR Baytrail.

It is important to highlight this patch doesn't work alone. Baytrail PSR has some critical PSR-exit trigger issues that are fixed on following patches.
Also, only on last one we mark baytrail/valleyview as HAS_PSR.

Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.h      |   5 ++
 drivers/gpu/drm/i915/i915_reg.h      |  37 +++++++++
 drivers/gpu/drm/i915/intel_display.c |   2 +
 drivers/gpu/drm/i915/intel_dp.c      | 151 +++++++++++++++++++++++++++++++----
 drivers/gpu/drm/i915/intel_drv.h     |   1 +
 5 files changed, 179 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +5 -0
index c5abff7..18f457e 100644
@@ -779,10 +779,15 @@ struct i915_fbc {
 	} no_fbc_reason;
 };
 
+struct intel_dp;
+
 struct i915_psr {
 	bool sink_support;
 	bool source_ok;
 	bool setup_done;
+	void (*setup)(struct intel_dp *intel_dp);
+	void (*enable_sink)(struct intel_dp *intel_dp);
+	void (*enable_source)(struct intel_dp *intel_dp);
 };
 
 enum intel_pch {
drivers/gpu/drm/i915/i915_reg.h +37 -0
index 2f564ce..d6b203f 100644
@@ -1984,6 +1984,43 @@
 #define VSYNCSHIFT(trans) _TRANSCODER2(trans, _VSYNCSHIFT_A)
 #define PIPESRC(trans) _TRANSCODER2(trans, _PIPEASRC)
 
+/* VLV eDP PSR registers */
+#define _PSRCTLA				(VLV_DISPLAY_BASE + 0x60090)
+#define _PSRCTLB				(VLV_DISPLAY_BASE + 0x61090)
+#define  VLV_EDP_PSR_ENABLE			(1<<0)
+#define  VLV_EDP_PSR_RESET			(1<<1)
+#define  VLV_EDP_PSR_MODE_MASK			(7<<2)
+#define  VLV_EDP_PSR_MODE_HW_TIMER		(1<<3)
+#define  VLV_EDP_PSR_MODE_SW_TIMER		(1<<2)
+#define  VLV_EDP_PSR_SINGLE_FRAME_UPDATE	(1<<7)
+#define  VLV_EDP_PSR_ACTIVE_ENTRY		(1<<8)
+#define  VLV_EDP_PSR_SRC_TRANSMITTER_STATE	(1<<9)
+#define  VLV_EDP_PSR_DBL_FRAME			(1<<10)
+#define  VLV_EDP_PSR_FRAME_COUNT_MASK		(0xff<<16)
+#define  VLV_EDP_PSR_IDLE_FRAME_SHIFT		16
+#define  VLV_EDP_PSR_INT_TRANSITION		(1<<24)
+#define VLV_PSRCTL(pipe) _PIPE(pipe, _PSRCTLA, _PSRCTLB)
+
+#define _VSCSDPA			(VLV_DISPLAY_BASE + 0x600a0)
+#define _VSCSDPB			(VLV_DISPLAY_BASE + 0x610a0)
+#define  VLV_EDP_PSR_SDP_FREQ_MASK	(3<<30)
+#define  VLV_EDP_PSR_SDP_FREQ_ONCE	(1<<31)
+#define  VLV_EDP_PSR_SDP_FREQ_EVFRAME	(1<<30)
+#define VLV_VSCSDP(pipe)	_PIPE(pipe, _VSCSDPA, _VSCSDPB)
+
+#define _PSRSTATA			(VLV_DISPLAY_BASE + 0x60094)
+#define _PSRSTATB			(VLV_DISPLAY_BASE + 0x61094)
+#define  VLV_EDP_PSR_LAST_STATE_MASK	(7<<3)
+#define  VLV_EDP_PSR_CURR_STATE_MASK	7
+#define  VLV_EDP_PSR_DISABLED		(0<<0)
+#define  VLV_EDP_PSR_INACTIVE		(1<<0)
+#define  VLV_EDP_PSR_IN_TRANS_TO_ACTIVE	(2<<0)
+#define  VLV_EDP_PSR_ACTIVE_NORFB_UP	(3<<0)
+#define  VLV_EDP_PSR_ACTIVE_SF_UPDATE	(4<<0)
+#define  VLV_EDP_PSR_EXIT		(5<<0)
+#define  VLV_EDP_PSR_IN_TRANS		(1<<7)
+#define VLV_PSRSTAT(pipe) _PIPE(pipe, _PSRSTATA, _PSRSTATB)
+
 /* HSW+ eDP PSR registers */
 #define EDP_PSR_BASE(dev)                       (IS_HASWELL(dev) ? 0x64800 : 0x6f800)
 #define EDP_PSR_CTL(dev)			(EDP_PSR_BASE(dev) + 0)
drivers/gpu/drm/i915/intel_display.c +2 -0
index e23ff4c..26196b8 100644
@@ -10533,6 +10533,8 @@ static void intel_setup_outputs(struct drm_device *dev)
 	if (SUPPORTS_TV(dev))
 		intel_tv_init(dev);
 
+	intel_edp_psr_init(dev);
+
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
 		encoder->base.possible_crtcs = encoder->crtc_mask;
 		encoder->base.possible_clones =
drivers/gpu/drm/i915/intel_dp.c +134 -17

222 lines not on this page · raw message

drivers/gpu/drm/i915/intel_drv.h +1 -0
index 180d602..2e4516d 100644
@@ -757,6 +757,7 @@ void intel_edp_panel_off(struct intel_dp *intel_dp);
 void intel_edp_psr_enable(struct intel_dp *intel_dp);
 void intel_edp_psr_disable(struct intel_dp *intel_dp);
 void intel_edp_psr_update(struct drm_device *dev);
+void intel_edp_psr_init(struct drm_device *dev);
 
 
 /* intel_dsi.c */
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 8/11 drm/i915: PSR Baytrail debugfs.

In reply to Rodrigo Vivi

Add debugfs support for Baytrail considering that on Baytrail we can have PSR on pipe A or pipe B and we don't have any kind of performance counter as we have on other platforms that support PSR.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +31 -5
index d90a707..9d86808 100644
@@ -1900,6 +1900,8 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 	struct drm_device *dev = node->minor->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 psrperf = 0;
+	u32 statA = 0;
+	u32 statB = 0;
 	bool enabled = false;
 
 	intel_runtime_pm_get(dev_priv);
@@ -1907,14 +1909,38 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 	seq_printf(m, "Sink_Support: %s\n", yesno(dev_priv->psr.sink_support));
 	seq_printf(m, "Source_OK: %s\n", yesno(dev_priv->psr.source_ok));
 
-	enabled = HAS_PSR(dev) &&
-		I915_READ(EDP_PSR_CTL(dev)) & EDP_PSR_ENABLE;
-	seq_printf(m, "Enabled: %s\n", yesno(enabled));
+	if (HAS_PSR(dev)) {
+		if (IS_VALLEYVIEW(dev)) {
+			statA = I915_READ(VLV_PSRSTAT(PIPE_A)) &
+				VLV_EDP_PSR_CURR_STATE_MASK;
+			statB = I915_READ(VLV_PSRSTAT(PIPE_B)) &
+				VLV_EDP_PSR_CURR_STATE_MASK;
+			enabled = ((statA == VLV_EDP_PSR_ACTIVE_NORFB_UP) ||
+				   (statA == VLV_EDP_PSR_ACTIVE_SF_UPDATE) ||
+				   (statB == VLV_EDP_PSR_ACTIVE_NORFB_UP) ||
+				   (statB == VLV_EDP_PSR_ACTIVE_SF_UPDATE));
+		} else
+			enabled = I915_READ(EDP_PSR_CTL(dev)) & EDP_PSR_ENABLE;
+	}
+	seq_printf(m, "Enabled: %s", yesno(enabled));
 
-	if (HAS_PSR(dev))
+	if (IS_VALLEYVIEW(dev)) {
+		if ((statA == VLV_EDP_PSR_ACTIVE_NORFB_UP) ||
+		    (statA == VLV_EDP_PSR_ACTIVE_SF_UPDATE))
+			seq_puts(m, " pipe A");
+		if ((statB == VLV_EDP_PSR_ACTIVE_NORFB_UP) ||
+		    (statB == VLV_EDP_PSR_ACTIVE_SF_UPDATE))
+			seq_puts(m, " pipe B");
+	}
+
+	seq_puts(m, "\n");
+
+	/* VLV PSR has no kind of performance counter */
+	if (HAS_PSR(dev) && !IS_VALLEYVIEW(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT(dev)) &
 			EDP_PSR_PERF_CNT_MASK;
-	seq_printf(m, "Performance_Counter: %u\n", psrperf);
+		seq_printf(m, "Performance_Counter: %u\n", psrperf);
+	}
 
 	intel_runtime_pm_put(dev_priv);
 	return 0;
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 9/11 drm/i915: PSR Baytrail: Disable it on Pipe B

In reply to Rodrigo Vivi

Baytrail supports per-pipe PSR configuration, however PSR on PIPE_B isn't working properly. So let's keep it disabled for now.

---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +7 -0
index aabab25..3adc127 100644
@@ -1852,6 +1852,13 @@ static bool intel_edp_psr_match_conditions(struct intel_dp *intel_dp)
 		return false;
 	}
 
+	/* Baytrail supports per-pipe PSR configuration, however PSR on
+	* PIPE_B isn't working properly. So let's keep it disabled for now. */
+	if (IS_VALLEYVIEW(dev) && intel_crtc->pipe != PIPE_A) {
+		DRM_DEBUG_KMS("PSR on BYT isn't enabled on pipe B.\n");
+		return false;
+	}
+
 	dev_priv->psr.source_ok = true;
 	return true;
 }
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 10/11 drm/i915: PSR Baytrail: Force exit by inactivating it.

In reply to Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Cc Chris Wilson <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.h      |  2 +
 drivers/gpu/drm/i915/i915_gem.c      | 12 +++++
 drivers/gpu/drm/i915/intel_display.c | 24 ++++++++-
 drivers/gpu/drm/i915/intel_dp.c      | 99 +++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 5 files changed, 128 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 18f457e..a4e666c 100644
@@ -785,6 +785,8 @@ struct i915_psr {
 	bool sink_support;
 	bool source_ok;
 	bool setup_done;
+	bool active;
+	struct delayed_work work;
 	void (*setup)(struct intel_dp *intel_dp);
 	void (*enable_sink)(struct intel_dp *intel_dp);
 	void (*enable_source)(struct intel_dp *intel_dp);
drivers/gpu/drm/i915/i915_gem.c +12 -0
index 3618bb0..c6bfc81 100644
@@ -1251,6 +1251,14 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
 		goto unlock;
 	}
 
+	/* Here we don't reschedule work to get PSR back because userspace
+	* can set domain and take as much as time it wants to write it.
+	* We only reschedule it back on next finish_page_flip. There is the
+	* risk of PSR be inactive forever depending on how compositor works,
+	* but this is the safest way to avoid loosing screen updates.
+	*/
+	intel_edp_psr_exit(dev, false);
+
 	/* Try to flush the object off the GPU without holding the lock.
 	 * We will repeat the flush holding the lock in the normal manner
 	 * to catch cases where we are gazumped.
@@ -1296,6 +1304,8 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
 	if (ret)
 		return ret;
 
+	intel_edp_psr_exit(dev, true);
+
 	obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
 	if (&obj->base == NULL) {
 		ret = -ENOENT;
@@ -3982,6 +3992,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
 	if (ret)
 		return ret;
 
+	intel_edp_psr_exit(dev, true);
+
 	obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
 	if (&obj->base == NULL) {
 		ret = -ENOENT;
drivers/gpu/drm/i915/intel_display.c +22 -2
index 26196b8..5e4c768 100644
@@ -4433,6 +4433,8 @@ static void intel_connector_check_state(struct intel_connector *connector)
  * consider. */
 void intel_connector_dpms(struct drm_connector *connector, int mode)
 {
+	struct drm_device *dev = connector->dev;
+	struct intel_encoder *intel_encoder;
 	/* All the simple cases only support two dpms states. */
 	if (mode != DRM_MODE_DPMS_ON)
 		mode = DRM_MODE_DPMS_OFF;
@@ -4443,9 +4445,15 @@ void intel_connector_dpms(struct drm_connector *connector, int mode)
 	connector->dpms = mode;
 
 	/* Only need to change hw state when actually enabled */
-	if (connector->encoder)
-		intel_encoder_dpms(to_intel_encoder(connector->encoder), mode);
+	if (connector->encoder) {
+
+		intel_encoder = to_intel_encoder(connector->encoder);
+		intel_encoder_dpms(intel_encoder, mode);
 
+		if (intel_encoder->type == INTEL_OUTPUT_EDP &&
+		    mode == DRM_MODE_DPMS_OFF)
+			intel_edp_psr_exit(dev, false);
+	}
 	intel_modeset_check_state(connector->dev);
 }
 
@@ -7512,6 +7520,8 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
 	if (!visible && !intel_crtc->cursor_visible)
 		return;
 
+	intel_edp_psr_exit(dev, true);
+
 	if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		I915_WRITE(CURPOS_IVB(pipe), pos);
 		ivb_update_cursor(crtc, base);
@@ -8224,12 +8234,15 @@ void intel_mark_idle(struct drm_device *dev)
 		gen6_rps_idle(dev->dev_private);
 }
 
+
 void intel_mark_fb_busy(struct drm_i915_gem_object *obj,
 			struct intel_ring_buffer *ring)
 {
 	struct drm_device *dev = obj->base.dev;
 	struct drm_crtc *crtc;
 
+	intel_edp_psr_exit(dev, true);
+
 	if (!i915.powersave)
 		return;
 
@@ -8330,6 +8343,10 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
 	queue_work(dev_priv->wq, &work->work);
 
 	trace_i915_flip_complete(intel_crtc->plane, work->pending_flip_obj);
+
+	/* Get PSR back after set_domain inactivated it
+	 * without rescheduling it back. */
+	intel_edp_psr_update(dev);
 }
 
 void intel_finish_page_flip(struct drm_device *dev, int pipe)
@@ -8696,6 +8713,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	if (work == NULL)
 		return -ENOMEM;
 
+	/* Exit PSR early in page flip */
+	intel_edp_psr_exit(dev, true);
+
 	work->event = event;
 	work->crtc = crtc;
 	work->old_fb_obj = to_intel_framebuffer(old_fb)->obj;
drivers/gpu/drm/i915/intel_dp.c +91 -8

133 lines not on this page · raw message

drivers/gpu/drm/i915/intel_drv.h +1 -0
index 2e4516d..47b8c9f 100644
@@ -757,6 +757,7 @@ void intel_edp_panel_off(struct intel_dp *intel_dp);
 void intel_edp_psr_enable(struct intel_dp *intel_dp);
 void intel_edp_psr_disable(struct intel_dp *intel_dp);
 void intel_edp_psr_update(struct drm_device *dev);
+void intel_edp_psr_exit(struct drm_device *dev, bool schedule_back);
 void intel_edp_psr_init(struct drm_device *dev);
 
 
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes. sw-finish and busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted? Can you please explain that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#12 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Are y

Quoted 9 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted? Can you please explain that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#13 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

In reply to Chris Wilson
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Ok, so here you are suggesting that I on trigger psr_exit if it is write domain, right?
I agree.

Quoted 3 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted?

I also agree but it is better late than never... or than letting userspace fully control the psr exit.
Most of the cases are coverred by psr_exit at set_domain. The remaining cases where userspace set domain once, sleep for while (like 10 seconds) and than write something
was coverred by my test that checked crc and it was different from crc base already.

Quoted 3 lines

Can you please explain
that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.

The perfect solution is the hardware tracking the changes and doing psr_exit by itself,
but unfortunatelly se don't have this scenario so we can live with what we have.

If the idea is to allow userspace to let kernel know when to exit psr I'm in favor of a more generic
ioctl called pre_damage to or a front_buffer_rend something to warn when some damage will occur
and we can disable psr, fbc and do whatever we want before the damage

if you prefer I can remove this patch and add the patch with ioclts that let psr_exit full control to userspace.
These patches are ready already. I just really don't like this option because I don't like the idea to depend
on userspace to get this hardware feature working.

Any other suggestion or ideas or cases, that I might be missing or not seeing, are welcome!

Quoted 4 lines

-Chris

--
Chris Wilson, Intel Open Source Technology Centre

Thanks

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#14 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 39 lines · Rodrigo Vivi
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Ok, so here you are suggesting that I on trigger psr_exit if it is write domain, right?
I agree.

Quoted 3 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted?

I also agree but it is better late than never... or than letting userspace fully control the psr exit.
Most of the cases are coverred by psr_exit at set_domain. The remaining cases where userspace set domain once, sleep for while (like 10 seconds) and than write something
was coverred by my test that checked crc and it was different from crc base already.

Quoted 3 lines

Can you please explain
that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.

The perfect solution is the hardware tracking the changes and doing psr_exit by itself,
but unfortunatelly se don't have this scenario so we can live with what we have.

If the idea is to allow userspace to let kernel know when to exit psr I'm in favor of a more generic
ioctl called pre_damage to or a front_buffer_rend something to warn when some damage will occur
and we can disable psr, fbc and do whatever we want before the damage

Quoted 5 lines

if you prefer I can remove this patch and add the patch with ioclts that let psr_exit full control to userspace.
These patches are ready already. I just really don't like this option because I don't like the idea to depend
on userspace to get this hardware feature working.

This is the level of detail that I want in the changelog and in nearby comments. Keeping track of the weaknesses of the implementation is vital.

For example there are problems with this approach if userspace flips between two GTT mmapped buffers, it currently has no reason to call set-domain again (and it never calls sw-finish along this path). So PSR is enabled again, and userspace may continue to directly write into the scanout without the kernel ever detecting and issuing the psr_exit().

I do not believe there is a way to change the coherency semantics of the GTT domain without userspace being aware, or else run afoul of a popular corner case.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#15 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 46 lines · Chris Wilson
Quoted 39 lines · Rodrigo Vivi
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Ok, so here you are suggesting that I on trigger psr_exit if it is write domain, right?
I agree.

Quoted 3 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted?

I also agree but it is better late than never... or than letting userspace fully control the psr exit.
Most of the cases are coverred by psr_exit at set_domain. The remaining cases where userspace set domain once, sleep for while (like 10 seconds) and than write something
was coverred by my test that checked crc and it was different from crc base already.

Quoted 3 lines

Can you please explain
that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.

The perfect solution is the hardware tracking the changes and doing psr_exit by itself,
but unfortunatelly se don't have this scenario so we can live with what we have.

If the idea is to allow userspace to let kernel know when to exit psr I'm in favor of a more generic
ioctl called pre_damage to or a front_buffer_rend something to warn when some damage will occur
and we can disable psr, fbc and do whatever we want before the damage

Quoted 5 lines

if you prefer I can remove this patch and add the patch with ioclts that let psr_exit full control to userspace.
These patches are ready already. I just really don't like this option because I don't like the idea to depend
on userspace to get this hardware feature working.

Quoted 3 lines

This is the level of detail that I want in the changelog and in nearby comments. Keeping track of the weaknesses of the implementation is vital.

agree

Quoted 5 lines

For example there are problems with this approach if userspace flips between two GTT mmapped buffers, it currently has no reason to call set-domain again (and it never calls sw-finish along this path). So PSR is enabled again, and userspace may continue to directly write into the scanout without the kernel ever detecting and issuing the psr_exit().

I see...

Quoted 3 lines

I do not believe there is a way to change the coherency semantics of the GTT domain without userspace being aware, or else run afoul of a popular corner case.

so, what do you suggest?
ioctls for exit?

Quoted 4 lines

-Chris

--
Chris Wilson, Intel Open Source Technology Centre

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#16 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 59 lines · Rodrigo Vivi
Quoted 46 lines · Chris Wilson
Quoted 39 lines · Rodrigo Vivi
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Ok, so here you are suggesting that I on trigger psr_exit if it is write domain, right?
I agree.

Quoted 3 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted?

I also agree but it is better late than never... or than letting userspace fully control the psr exit.
Most of the cases are coverred by psr_exit at set_domain. The remaining cases where userspace set domain once, sleep for while (like 10 seconds) and than write something
was coverred by my test that checked crc and it was different from crc base already.

Quoted 3 lines

Can you please explain
that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.

The perfect solution is the hardware tracking the changes and doing psr_exit by itself,
but unfortunatelly se don't have this scenario so we can live with what we have.

If the idea is to allow userspace to let kernel know when to exit psr I'm in favor of a more generic
ioctl called pre_damage to or a front_buffer_rend something to warn when some damage will occur
and we can disable psr, fbc and do whatever we want before the damage

Quoted 5 lines

if you prefer I can remove this patch and add the patch with ioclts that let psr_exit full control to userspace.
These patches are ready already. I just really don't like this option because I don't like the idea to depend
on userspace to get this hardware feature working.

Quoted 3 lines

This is the level of detail that I want in the changelog and in nearby comments. Keeping track of the weaknesses of the implementation is vital.

agree

Quoted 5 lines

For example there are problems with this approach if userspace flips between two GTT mmapped buffers, it currently has no reason to call set-domain again (and it never calls sw-finish along this path). So PSR is enabled again, and userspace may continue to directly write into the scanout without the kernel ever detecting and issuing the psr_exit().

Quoted 8 lines

I see...

Quoted 3 lines

I do not believe there is a way to change the coherency semantics of the GTT domain without userspace being aware, or else run afoul of a popular corner case.

so, what do you suggest?
ioctls for exit?

We have it, it's called dirtyfb. But we need to keep the current userspace stuff mostly working first, hence all this trouble. We can fix the gtt trouble with a delayed work (one vblank or so) which
a) does a psr_exit
b) shots down gtt mappings of the offending frontbuffer

Then we can intercept the next write in gem_fault.

Of course that will be horrible if we don't track correctly which buffers are actually relevant for psr.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#17 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 75 lines · Daniel Vetter
Quoted 59 lines · Rodrigo Vivi
Quoted 46 lines · Chris Wilson
Quoted 39 lines · Rodrigo Vivi
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Rodrigo Vivi

Baytrail cannot easily detect screen updates and force PSR exit. So we inactivate it on {busy_ioctl, set_domain, sw_finish and mark_busy} and update to enable it back it later with a delayed workqueue.

Why are we not checking if the object being accessed is indeed being used for PSR? In set-domain, you only care about writes.

Ok, so here you are suggesting that I on trigger psr_exit if it is write domain, right?
I agree.

Quoted 3 lines

sw-finish and
busy are too late for psr_exit, the damage has already been done and presumably the content may already be corrupted?

I also agree but it is better late than never... or than letting userspace fully control the psr exit.
Most of the cases are coverred by psr_exit at set_domain. The remaining cases where userspace set domain once, sleep for while (like 10 seconds) and than write something
was coverred by my test that checked crc and it was different from crc base already.

Quoted 3 lines

Can you please explain
that it is safe to do an psr_exit after the damage is already in the scanount based on the panel refresh cycle.

The perfect solution is the hardware tracking the changes and doing psr_exit by itself,
but unfortunatelly se don't have this scenario so we can live with what we have.

If the idea is to allow userspace to let kernel know when to exit psr I'm in favor of a more generic
ioctl called pre_damage to or a front_buffer_rend something to warn when some damage will occur
and we can disable psr, fbc and do whatever we want before the damage

Quoted 5 lines

if you prefer I can remove this patch and add the patch with ioclts that let psr_exit full control to userspace.
These patches are ready already. I just really don't like this option because I don't like the idea to depend
on userspace to get this hardware feature working.

Quoted 3 lines

This is the level of detail that I want in the changelog and in nearby comments. Keeping track of the weaknesses of the implementation is vital.

agree

Quoted 5 lines

For example there are problems with this approach if userspace flips between two GTT mmapped buffers, it currently has no reason to call set-domain again (and it never calls sw-finish along this path). So PSR is enabled again, and userspace may continue to directly write into the scanout without the kernel ever detecting and issuing the psr_exit().

Quoted 8 lines

I see...

Quoted 3 lines

I do not believe there is a way to change the coherency semantics of the GTT domain without userspace being aware, or else run afoul of a popular corner case.

so, what do you suggest?
ioctls for exit?

We have it, it's called dirtyfb. But we need to keep the current userspace stuff mostly working first, hence all this trouble. We can fix the gtt trouble with a delayed work (one vblank or so) which
a) does a psr_exit
b) shots down gtt mappings of the offending frontbuffer

Quoted 5 lines

Then we can intercept the next write in gem_fault.

Of course that will be horrible if we don't track correctly which buffers are actually relevant for psr.
-Daniel

I'm not sure I fully got your idea/plan here.

Should I try a psr_exit with delayed back at dirtyfb? and create a new test case?
Or this it self isn't enough?

Btw, i'm using daily a hsw ult with psr enable and a kde environment using the same psr_exit strategy here for baytrail with psr enabled for more than 2 weeks without any issue so far.

Quoted 4 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#18 lore raw

Re: [PATCH 10/11] drm/i915: PSR Baytrail: Force exit by inactivating it.

Quoted 14 lines · Rodrigo Vivi
Quoted 11 lines

We have it, it's called dirtyfb. But we need to keep the current userspace stuff mostly working first, hence all this trouble. We can fix the gtt trouble with a delayed work (one vblank or so) which
a) does a psr_exit
b) shots down gtt mappings of the offending frontbuffer

Then we can intercept the next write in gem_fault.

Of course that will be horrible if we don't track correctly which buffers are actually relevant for psr.
-Daniel

I'm not sure I fully got your idea/plan here.

Quoted 7 lines

Should I try a psr_exit with delayed back at dirtyfb? and create a new test case?
Or this it self isn't enough?

Btw, i'm using daily a hsw ult with psr enable and a kde environment using the same psr_exit strategy here for baytrail with psr enabled for more than 2 weeks without any issue so far.

Current userspace doesn't use dirtyfb, so we can't solely rely on that. Iirc you currently have a psr_exit in set_domain. My idea above was that we also need to have it in i915_gem_fault and further we need to shot down ptes in psr_exit for the frontbuffer.

For an igt the following should trick this bug:
1) set_domain(GTT, GTT) on the frontbuffer
2) rendering something
-> check that the kernel has correctly done a psr_exit with the sink crc stuff

This is the testcase we already have. Now comes the interesting part Chris pointed out:
3) have a long delay to make sure we are again in psr mode.
4) Write new stuff to the frontbuffer, _without_ doing a set_domain(GTT, GTT). Userspace is allowed to do this.
-> check again sink crcs

Note that this issue doesn't exist with cpu memory mapped frontbuffer rendering, since userspace is required to regularly call the sw_finish ioctl, i.e. after both steps 2) and 4). But even for cpu mmaps userspace is allowed to optimize the set_domain(CPU, CPU) call away before step 3).

Of course if any other rendering happens in between step 2) and 3) userspace must again do a set_domain call. So this case here is highly contrived ;-)

I hope this explains this issue better.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#19 lore raw

PATCH 11/11 drm/i915: Enable PSR on Baytrail.

In reply to Rodrigo Vivi

This patch is the last in series that finnaly enable PSR on Baytrail by adding it to HAS_PSR and calling the propper enable and disable functions on the right places.

---
 drivers/gpu/drm/i915/i915_drv.h | 3 ++-
 drivers/gpu/drm/i915/intel_dp.c | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +2 -1
index a4e666c..194ee3e 100644
@@ -1919,7 +1919,8 @@ struct drm_i915_file_private {
 
 #define HAS_DDI(dev)		(INTEL_INFO(dev)->has_ddi)
 #define HAS_FPGA_DBG_UNCLAIMED(dev)	(INTEL_INFO(dev)->has_fpga_dbg)
-#define HAS_PSR(dev)		(IS_HASWELL(dev) || IS_BROADWELL(dev))
+#define HAS_PSR(dev)		(IS_HASWELL(dev) || IS_BROADWELL(dev) || \
+				 IS_VALLEYVIEW(dev))
 #define HAS_PC8(dev)		(IS_HASWELL(dev)) /* XXX HSW:ULX */
 #define HAS_RUNTIME_PM(dev)	(IS_HASWELL(dev))
 
drivers/gpu/drm/i915/intel_dp.c +4 -0
index f386860..70b2fbf 100644
@@ -2080,6 +2080,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)
 	enum port port = dp_to_dig_port(intel_dp)->port;
 	struct drm_device *dev = encoder->base.dev;
 
+	if (IS_VALLEYVIEW(dev))
+		vlv_edp_psr_disable(intel_dp);
+
 	/* Make sure the panel is off before trying to change the mode. But also
 	 * ensure that we have vdd while we switch off the panel. */
 	intel_edp_backlight_off(intel_dp);
@@ -2136,6 +2139,7 @@ static void vlv_enable_dp(struct intel_encoder *encoder)
 	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
 
 	intel_edp_backlight_on(intel_dp);
+	intel_edp_psr_enable(intel_dp);
 }
 
 static void g4x_pre_enable_dp(struct intel_encoder *encoder)
Signature · 1 line
1.8.3.1