public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: Set primary plane enable at dpcntrl.
@ 2014-01-23 18:16 Rodrigo Vivi
  2014-01-23 18:16 ` [PATCH 2/4] drm/i915: move psr_setup_done to psr struct Rodrigo Vivi
                   ` (3 more replies)
  0 siblings, 4 replies; 49+ messages in thread
From: Rodrigo Vivi @ 2014-01-23 18:16 UTC (permalink / raw)
  To: intel-gfx

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.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dde98020..6592ad7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2095,6 +2095,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);
@@ -2192,6 +2195,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);
@@ -8586,6 +8592,10 @@ 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));
 
+	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;
-- 
1.8.1.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 49+ messages in thread
* [PATCH 1/2] drm/i915: move psr_setup_done to psr struct
@ 2013-12-17 19:57 Rodrigo Vivi
  2013-12-17 20:31 ` [PATCH] drm/i915: Add Baytrail PSR Support Rodrigo Vivi
  0 siblings, 1 reply; 49+ messages in thread
From: Rodrigo Vivi @ 2013-12-17 19:57 UTC (permalink / raw)
  To: intel-gfx

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 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, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 53288f6..cae3225 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -715,6 +715,7 @@ struct i915_fbc {
 struct i915_psr {
 	bool sink_support;
 	bool source_ok;
+	bool setup_done;
 };
 
 enum intel_pch {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 9b40113..f062a59 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1567,7 +1567,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 */
@@ -1582,7 +1582,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)
@@ -3702,7 +3702,7 @@ 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;
+	dev_priv->psr.setup_done = false;
 
 	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
 		i2c_del_adapter(&intel_dp->adapter);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 46aea6c..f7b5b2f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -485,7 +485,6 @@ struct intel_dp {
 	int backlight_off_delay;
 	struct delayed_work panel_vdd_work;
 	bool want_panel_vdd;
-	bool psr_setup_done;
 	struct intel_connector *attached_connector;
 };
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2014-02-12 16:29 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-23 18:16 [PATCH 1/4] drm/i915: Set primary plane enable at dpcntrl Rodrigo Vivi
2014-01-23 18:16 ` [PATCH 2/4] drm/i915: move psr_setup_done to psr struct Rodrigo Vivi
2014-01-24 14:50   ` Ville Syrjälä
2014-01-24 16:02     ` Rodrigo Vivi
2014-01-23 18:16 ` [PATCH 3/4] drm/i915: Update PSR on resume Rodrigo Vivi
2014-02-05 19:04   ` [PATCH 1/2] " Rodrigo Vivi
2014-01-23 18:16 ` [PATCH 4/4] drm/i915: Add Baytrail PSR Support Rodrigo Vivi
2014-01-23 19:19   ` [PATCH] " Rodrigo Vivi
2014-01-24 14:53     ` Ville Syrjälä
2014-01-24 16:05       ` Rodrigo Vivi
2014-01-24 17:41         ` Ville Syrjälä
2014-01-28 19:47           ` [PATCH 4/4] " Rodrigo Vivi
2014-01-29 12:47             ` [PATCH] " Rodrigo Vivi
2014-01-29 13:12               ` Chris Wilson
2014-01-29 13:24                 ` Rodrigo Vivi
2014-01-29 13:27                   ` Chris Wilson
2014-01-29 13:54                     ` Rodrigo Vivi
2014-01-29 14:02                       ` Chris Wilson
2014-01-29 14:23                         ` Rodrigo Vivi
2014-01-29 14:26                           ` Chris Wilson
2014-01-29 19:20                             ` Daniel Vetter
2014-01-29 14:55                 ` Rodrigo Vivi
2014-01-29 19:21                   ` Daniel Vetter
2014-02-01 11:34                     ` Chris Wilson
2014-02-04 10:49                       ` Daniel Vetter
2014-01-29 14:56               ` Ville Syrjälä
2014-01-29 15:47                 ` Rodrigo Vivi
2014-01-29 16:38                   ` Ville Syrjälä
2014-01-29 17:48                     ` Rodrigo Vivi
2014-01-29 18:24                       ` Ville Syrjälä
2014-01-29 15:50                 ` Rodrigo Vivi
2014-01-30 13:02                   ` Chris Wilson
2014-01-30 17:01                     ` Rodrigo Vivi
2014-02-04 10:53                       ` Daniel Vetter
2014-02-04 13:03                         ` Rodrigo Vivi
2014-02-04 13:54                           ` Daniel Vetter
2014-02-05 19:04                             ` [PATCH 2/2] " Rodrigo Vivi
2014-02-07 17:24                               ` Ville Syrjälä
2014-02-07 18:05                                 ` Rodrigo Vivi
2014-02-07 18:39                                   ` Ville Syrjälä
2014-02-12 16:29                 ` [PATCH] " Daniel Vetter
2014-01-23 19:19 ` [PATCH] drm/i915: Set primary plane enable at dpcntrl Rodrigo Vivi
2014-01-24 14:58   ` Ville Syrjälä
2014-01-28 19:46     ` [PATCH 1/4] " Rodrigo Vivi
  -- strict thread matches above, loose matches on Subject: below --
2013-12-17 19:57 [PATCH 1/2] drm/i915: move psr_setup_done to psr struct Rodrigo Vivi
2013-12-17 20:31 ` [PATCH] drm/i915: Add Baytrail PSR Support Rodrigo Vivi
2013-12-18 10:03   ` Chris Wilson
2013-12-18 10:27     ` Rodrigo Vivi
2013-12-18 10:30       ` Rodrigo Vivi
2013-12-18 10:37       ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox