summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-04-06 14:02:08 -0700
committerCarl Worth <cworth@cworth.org>2009-04-06 14:07:32 -0700
commit3e5586cace98f73a9f8403a6446d380899ecbce9 (patch)
tree3ab14f1fc57beb214d028b2e2bb2a173d3d1c267
parent4e9b75175be791c6098ef79be8e04a8c3baa40f9 (diff)
Fix new video sync-to-blank code for multi-head
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. (cherry picked from commit 5d9d9a2e466474a0508a15b294a91507ccb3ccc1)
-rw-r--r--src/i830_video.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/i830_video.c b/src/i830_video.c
index 3331dd30..13f3ab14 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();
}