[Intel-gfx] [PATCH 21/22] Fix XV scan line calculation when rotated

Daniel Vetter daniel.vetter at ffwll.ch
Thu Jul 2 14:15:54 CEST 2009


From: Barry Scott <barry.scott at onelan.co.uk>

This patch fixes the problems I was seeing with XV when rotated.

The box is in screen coordinates and must be transformed into crtc coordinates
to calculate the correct scan line numbers.
---
 src/i830_video.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/i830_video.c b/src/i830_video.c
index 00a1fcd..855d12b 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2223,6 +2223,7 @@ i830_wait_for_scanline(ScrnInfoPtr pScrn, PixmapPtr pPixmap,
     BoxPtr box;
     int y1, y2;
     int pipe = -1, event, load_scan_lines_pipe;
+    pixman_box16_t box_in_crtc_coordinates;
 
     if (pixmap_is_scanout(pPixmap)) 
 	pipe = i830_crtc_to_pipe(crtc);
@@ -2237,8 +2238,12 @@ i830_wait_for_scanline(ScrnInfoPtr pScrn, PixmapPtr pPixmap,
 	}
 
 	box = REGION_EXTENTS(unused, clipBoxes);
-	y1 = box->y1 - crtc->y;
-	y2 = box->y2 - crtc->y;
+	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 - crtc->y;
+	y2 = box_in_crtc_coordinates.y2 - crtc->y;
 
 	BEGIN_BATCH(5);
 	/* The documentation says that the LOAD_SCAN_LINES command
-- 
1.6.3.3




More information about the Intel-gfx mailing list