[Intel-gfx] [Patch] Fix new video sync-to-blank code for multi-head

Carl Worth cworth at cworth.org
Mon Apr 6 23:06:50 CEST 2009


We need to account for a non-zero Y offset for the CRTC. Without
this, we don't sync to the correct region, so tearing becomes
visible again.
---

On Mon, 2009-04-06 at 11:50 -0700, Eric Anholt wrote:
> This looks to me like it'll result in tearing for a monitor positioned
> below 0,0, since we're not offsetting by the crtc origin (so the
> exclusion window ends up way off the end of the screen for an
> above/below configuration).

Thanks for the review, Eric.

This patch fixes that, and seems straightforward-enough that I will just
push it, (on top of the two previous patches which I already pushed).

Since fixing this required me to test with a multi-pipe setup, I did
find that I'm getting tearing on pipe B always, (regardless of its Y
offset). So maybe something's wrong with the
MI_LOAD_SCAN_LINES_DISPLAY_PIPEB value, (though I did just double-check
it against the 965 specifications at least.

-Carl

 src/i830_video.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/i830_video.c b/src/i830_video.c
index 3331dd3..13f3ab1 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2517,6 +2517,7 @@ I830PutImage(ScrnInfoPtr pScrn,
 
         if (sync) {
 	    BoxPtr box;
+	    int y1, y2;
             int event, pipe;
 	    I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
 
@@ -2529,14 +2530,16 @@ I830PutImage(ScrnInfoPtr pScrn,
 	    }
 
 	    box = REGION_EXTENTS(unused, clipBoxes);
+	    y1 = box->y1 - crtc->y;
+	    y2 = box->y2 - crtc->y;
 
             BEGIN_BATCH(5);
 	    /* The documentation says that the LOAD_SCAN_LINES command
 	     * always comes in pairs. Don't ask me why. */
 	    OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe);
-	    OUT_BATCH((box->y1 << 16) | box->y2);
+	    OUT_BATCH((y1 << 16) | y2);
 	    OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe);
-	    OUT_BATCH((box->y1 << 16) | box->y2);
+	    OUT_BATCH((y1 << 16) | y2);
             OUT_BATCH(MI_WAIT_FOR_EVENT | event);
             ADVANCE_BATCH();
         }
-- 
1.6.2.1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090406/345928fd/attachment.sig>


More information about the Intel-gfx mailing list