diff mbox

drm/i915: paper over a pipe-enable vs pageflip race

Message ID 1349371203-15130-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Oct. 4, 2012, 5:20 p.m. UTC
I've discovered this on my ivb machine while stress-testing the new
flip_tests. Only harmful effect observed is that the timestamp is a
bit bogus.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Imre Deak Oct. 8, 2012, 5:19 p.m. UTC | #1
On Thu, 2012-10-04 at 19:20 +0200, Daniel Vetter wrote:
> I've discovered this on my ivb machine while stress-testing the new
> flip_tests. Only harmful effect observed is that the timestamp is a
> bit bogus.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I've seen the same issue on an ivb ultrabook machine and the patch gets
rid of it, so:

Tested-by: Imre Deak <imre.deak@intel.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 67912fe..9cecfd7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3253,6 +3253,16 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
>  
>  	if (HAS_PCH_CPT(dev))
>  		intel_cpt_verify_modeset(dev, intel_crtc->pipe);
> +
> +	/*
> +	 * There seems to be a race in PCH platform hw (at least on some
> +	 * outputs) where an enabled pipe still completes any pageflip right
> +	 * away (as if the pipe is off) instead of waiting for vblank. As soon
> +	 * as the first vblank happend, everything works as expected. Hence just
> +	 * wait for one vblank before returning to avoid strange things
> +	 * happening.
> +	 */
> +	intel_wait_for_vblank(dev, intel_crtc->pipe);
>  }
>  
>  static void ironlake_crtc_disable(struct drm_crtc *crtc)
Daniel Vetter Oct. 8, 2012, 5:32 p.m. UTC | #2
On Mon, Oct 08, 2012 at 08:19:20PM +0300, Imre Deak wrote:
> On Thu, 2012-10-04 at 19:20 +0200, Daniel Vetter wrote:
> > I've discovered this on my ivb machine while stress-testing the new
> > flip_tests. Only harmful effect observed is that the timestamp is a
> > bit bogus.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I've seen the same issue on an ivb ultrabook machine and the patch gets
> rid of it, so:
> 
> Tested-by: Imre Deak <imre.deak@intel.com>

Applied with the commit message extended as per our irc discussion, and
with your irc r-b applied. Thanks for testing&review.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 67912fe..9cecfd7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3253,6 +3253,16 @@  static void ironlake_crtc_enable(struct drm_crtc *crtc)
 
 	if (HAS_PCH_CPT(dev))
 		intel_cpt_verify_modeset(dev, intel_crtc->pipe);
+
+	/*
+	 * There seems to be a race in PCH platform hw (at least on some
+	 * outputs) where an enabled pipe still completes any pageflip right
+	 * away (as if the pipe is off) instead of waiting for vblank. As soon
+	 * as the first vblank happend, everything works as expected. Hence just
+	 * wait for one vblank before returning to avoid strange things
+	 * happening.
+	 */
+	intel_wait_for_vblank(dev, intel_crtc->pipe);
 }
 
 static void ironlake_crtc_disable(struct drm_crtc *crtc)