>From bd305d5b2f55431ee7a7de1a6540604a2d6ba6a5 Mon Sep 17 00:00:00 2001
From: Owain G. Ainsworth <o...@openbsd.org>
Date: Wed, 21 Jan 2009 21:51:36 +0000
Subject: [PATCH] Fix vblank crtc selection with DRI1 when only one pipe is 
enabled.

On Mobile chipsets, we often enable PipeB instead of PipeA, but the test
in here was insufficient, falling back to pipe A if the area
intersection returned zero. Therefore, in the case where a window went
off to the top of the left of the screen, it would freeze, waiting on
the wrong vblank.

Fix this mess by checking the sarea for a crtc being zero sized, and in
that case always default to the other one.
---
 src/mesa/drivers/dri/intel/intel_buffers.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c 
b/src/mesa/drivers/dri/intel/intel_buffers.c
index 0cb3162..c0cbbdb 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -177,6 +177,14 @@ intelWindowMoved(struct intel_context *intel)
         flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
       }
 
+      /* Do the stupid test: Is one of them actually disabled?
+       */
+      if (sarea->planeA_w == 0 || sarea->planeA_h == 0) {
+        flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
+      } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) {
+        flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+      }
+
       /* Check to see if we changed pipes */
       if (flags != dPriv->vblFlags && dPriv->vblFlags &&
          !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
-- 
1.6.0.5

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to