diff --git a/src/i830_video.c b/src/i830_video.c index 1ff80a0..3509006 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -2488,6 +2488,7 @@ I830PutImage(ScrnInfoPtr pScrn, if (sync) { BoxPtr box; + pixman_box16_t box_in_crtc_coordinates; int y1, y2; int pipe = -1, event, load_scan_lines_pipe; @@ -2510,8 +2511,15 @@ I830PutImage(ScrnInfoPtr pScrn, } box = REGION_EXTENTS(unused, clipBoxes); - y1 = box->y1 - crtc->y; - y2 = box->y2 - crtc->y; + + /* Make sure we don't wait for a scanline that will never occur */ + box_in_crtc_coordinates = *box; + if (crtc->transform_in_use) + pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &box_in_crtc_coordinates); + y1 = (box_in_crtc_coordinates.y1 < 0) ? + 0 : box_in_crtc_coordinates.y1; + y2 = (box_in_crtc_coordinates.y2 <= crtc->mode.VDisplay) ? + box_in_crtc_coordinates.y2 : crtc->mode.VDisplay; BEGIN_BATCH(5); /* The documentation says that the LOAD_SCAN_LINES command