All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/4] drm/i915: Set primary plane enable at dpcntrl.
Date: Tue, 28 Jan 2014 17:46:55 -0200	[thread overview]
Message-ID: <1390938415-4595-1-git-send-email-rodrigo.vivi@gmail.com> (raw)
In-Reply-To: <20140124145805.GI9454@intel.com>

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ä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 122f871..1a9aa19 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);
@@ -8625,6 +8631,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;
-- 
1.8.1.2

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

      reply	other threads:[~2014-01-28 19:46 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Rodrigo Vivi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390938415-4595-1-git-send-email-rodrigo.vivi@gmail.com \
    --to=rodrigo.vivi@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.