Skip to contentSkip to conversation

xv: Fix interlace computation

PATCH In review Adam Jackson 2 participants 3 messages Jan 3, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xv: Fix interlace computation

scrn->currentMode is a hack for xf86vidmode and in general is wrong for RANDRful drivers. Use the mode on the associated CRTC instead.

---
 src/intel_video.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/intel_video.c +1 -1
index cdff149..d086cbf 100644
@@ -1348,7 +1348,7 @@ intel_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap,
 			event = MI_WAIT_FOR_PIPEB_SVBLANK;
 	}
 
-	if (scrn->currentMode->Flags & V_INTERLACE) {
+	if (crtc->mode && (crtc->mode->Flags & V_INTERLACE)) {
 		/* DSL count field lines */
 		y1 /= 2;
 		y2 /= 2;
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 2/2 dri2: Fix interlace computation

scrn->currentMode is a hack for xf86vidmode and in general is wrong for RANDRful drivers. Use the mode on the associated CRTC instead.

---
 src/intel_dri.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
src/intel_dri.c +3 -4
index 7096369..0e74b7d 100644
@@ -433,8 +433,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 
 	/* Wait for the scanline to be outside the region to be copied */
 	if (pixmap_is_scanout(get_drawable_pixmap(dst)) &&
-	    intel->swapbuffers_wait &&
-	    scrn->currentMode) {
+	    intel->swapbuffers_wait) {
 		BoxPtr box;
 		BoxRec crtcbox;
 		int y1, y2;
@@ -449,7 +448,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 		 * Make sure the CRTC is valid and this is the real front
 		 * buffer
 		 */
-		if (crtc != NULL && !crtc->rotatedData) {
+		if (crtc != NULL && crtc->mode && !crtc->rotatedData) {
 			pipe = intel_crtc_to_pipe(crtc);
 
 			/*
@@ -485,7 +484,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 				    event = MI_WAIT_FOR_PIPEB_SVBLANK;
 			}
 
-			if (scrn->currentMode->Flags & V_INTERLACE) {
+			if (crtc->mode->Flags & V_INTERLACE) {
 				/* DSL count field lines */
 				y1 /= 2;
 				y2 /= 2;
Signature · 1 line
1.7.3.4
#2 lore raw

Re: [PATCH 2/2] dri2: Fix interlace computation

Quoted 2 lines · Adam Jackson

scrn->currentMode is a hack for xf86vidmode and in general is wrong for RANDRful drivers. Use the mode on the associated CRTC instead.

Thanks Adam, that looks much saner than scrn->currentMode. Fixed up the Ptr/Rec confusion and pushed.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre