diff --git a/src/i830_dri.c b/src/i830_dri.c index 9da1d40..23f45a5 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -325,8 +325,9 @@ I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; } - y1 = box->y1 - crtc->y; - y2 = box->y2 - crtc->y; + //calculate scan line numbers + y1 = (crtcbox->y1 <= box->y1) ? box->y1 - crtcbox->y1 : 0; + y2 = (box->y2 <= crtcbox->y2) ? box->y2 - crtcbox->y1 : crtcbox->y2 - crtcbox->y1; BEGIN_BATCH(5); /* The documentation says that the LOAD_SCAN_LINES command