xf86-video-intel: 6 commits - src/i830_driver.c src/i830_video.c src/i830_video.h src/i965_hwmc.c

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 15 12:36:46 PDT 2009


 src/i830_driver.c |    3 -
 src/i830_video.c  |  149 ++++++++++++------------------------------------------
 src/i830_video.h  |   12 +---
 src/i965_hwmc.c   |   28 +++-------
 4 files changed, 48 insertions(+), 144 deletions(-)

New commits:
commit 38ab403d7a1c461c8ac65a056bee2dd5c7f2f58e
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 15 11:39:32 2009 -0700

    Enable XVMC by default on gen4.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index ede4344..867047c 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1387,7 +1387,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 	xf86DPMSInit(screen, xf86DPMSSet, 0);
 
 #ifdef INTEL_XVMC
-	intel->XvMCEnabled = FALSE;
+	if (IS_I965G(intel))
+		intel->XvMCEnabled = TRUE;
 	from = ((intel->directRenderingType == DRI_DRI2) &&
 		xf86GetOptValBool(intel->Options, OPTION_XVMC,
 				  &intel->XvMCEnabled) ? X_CONFIG : X_DEFAULT);
commit f171069608bf174d920921fa102b8619794ed272
Author: Zhenyu Wang <zhenyuw at linux.intel.com>
Date:   Mon Sep 28 18:35:57 2009 +0800

    i965 XvMC cleanup
    
    Remove bo pin for surface buffer access, and remove access
    attempt for possible unmapped framebuffer. Using xv buffer
    pointer to pass current xvmc surface bo handler, which is
    assigned to src image bo and handle that the same way as in Xv.
    
    Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
    [anholt: Fixed up for conflict against the XV rework.  Not tested, because
    both mplayer and xine segfault with XVMC currently.]
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/i830_video.c b/src/i830_video.c
index 848099d..b0403d4 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1165,10 +1165,10 @@ int is_planar_fourcc(int id)
 	}
 }
 
-static int xvmc_passthrough(int id, Rotation rotation)
+static int xvmc_passthrough(int id)
 {
 #ifdef INTEL_XVMC
-	return id == FOURCC_XVMC && rotation == RR_Rotate_0;
+	return id == FOURCC_XVMC;
 #else
 	return 0;
 #endif
@@ -1331,17 +1331,24 @@ i830_wait_for_scanline(ScrnInfoPtr scrn, PixmapPtr pixmap,
 
 static Bool
 i830_setup_video_buffer(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
-			int alloc_size, int id)
+			int alloc_size, int id, unsigned char *buf)
 {
 	intel_screen_private *intel = intel_get_screen_private(scrn);
+
 	/* Free the current buffer if we're going to have to reallocate */
 	if (adaptor_priv->buf && adaptor_priv->buf->size < alloc_size) {
 		drm_intel_bo_unreference(adaptor_priv->buf);
 		adaptor_priv->buf = NULL;
 	}
 
-	if (xvmc_passthrough(id, adaptor_priv->rotation)) {
+	if (xvmc_passthrough(id)) {
 		i830_free_video_buffers(adaptor_priv);
+		if (IS_I965G(intel)) {
+			adaptor_priv->buf =
+				drm_intel_bo_gem_create_from_name(intel->bufmgr,
+								  "xvmc surface",
+								  (uintptr_t)buf);
+		}
 	} else {
 		if (adaptor_priv->buf == NULL) {
 			adaptor_priv->buf = drm_intel_bo_alloc(intel->bufmgr,
@@ -1447,7 +1454,7 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
 	i830_dst_pitch_and_size(scrn, adaptor_priv, width, height, dstPitch,
 				dstPitch2, &size, id);
 
-	if (!i830_setup_video_buffer(scrn, adaptor_priv, size, id))
+	if (!i830_setup_video_buffer(scrn, adaptor_priv, size, id, buf))
 		return FALSE;
 
 	/* fixup pointers */
@@ -1482,7 +1489,7 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
 	npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left;
 
 	if (is_planar_fourcc(id)) {
-		if (!xvmc_passthrough(id, adaptor_priv->rotation)) {
+		if (!xvmc_passthrough(id)) {
 			top &= ~1;
 			nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
 			I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2,
@@ -1600,14 +1607,6 @@ I830PutImage(ScrnInfoPtr scrn,
 		}
 
 		if (IS_I965G(intel)) {
-			if (xvmc_passthrough(id, adaptor_priv->rotation)) {
-				/* XXX: KMS */
-				adaptor_priv->YBufOffset = (uintptr_t) buf;
-				adaptor_priv->UBufOffset =
-				    adaptor_priv->YBufOffset + height * width;
-				adaptor_priv->VBufOffset =
-				    adaptor_priv->UBufOffset + height * width / 4;
-			}
 			I965DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
 						 width, height, dstPitch, x1,
 						 y1, x2, y2, src_w, src_h,
diff --git a/src/i965_hwmc.c b/src/i965_hwmc.c
index 76acb86..3fe4f41 100644
--- a/src/i965_hwmc.c
+++ b/src/i965_hwmc.c
@@ -48,7 +48,7 @@
 #define XVMC_VLD  0x00020000
 #endif
 
-static PutImageFuncPtr XvPutImage;
+static PutImageFuncPtr savedXvPutImage;
 
 static int create_context(ScrnInfoPtr scrn,
 			  XvMCContextPtr context, int *num_privates,
@@ -156,36 +156,26 @@ static int put_image(ScrnInfoPtr scrn,
 		     short src_h, short drw_w, short drw_h,
 		     int id, unsigned char *buf, short width,
 		     short height, Bool sync, RegionPtr clipBoxes, pointer data,
-		     DrawablePtr pDraw)
+		     DrawablePtr drawable)
 {
-	intel_screen_private *intel = intel_get_screen_private(scrn);
 	struct intel_xvmc_command *cmd = (struct intel_xvmc_command *)buf;
-	dri_bo *bo;
 
 	if (id == FOURCC_XVMC) {
-		bo = intel_bo_gem_create_from_name(intel->bufmgr, "surface",
-						   cmd->handle);
-		dri_bo_pin(bo, 0x1000);
-		/* XXX: KMS */
-#if 0
-		buf = intel->FbBase + bo->offset;
-#endif
+		/* Pass the GEM object name through the pointer arg. */
+		buf = (void *)(uintptr_t)cmd->handle;
 	}
-	XvPutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
-		   drw_w, drw_h, id, buf, width, height, sync, clipBoxes,
-		   data, pDraw);
 
-	if (id == FOURCC_XVMC) {
-		dri_bo_unpin(bo);
-		dri_bo_unreference(bo);
-	}
+	savedXvPutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
+			drw_w, drw_h, id, buf,
+			width, height, sync, clipBoxes,
+			data, drawable);
 
 	return Success;
 }
 
 static Bool init(ScrnInfoPtr screen_info, XF86VideoAdaptorPtr adaptor)
 {
-	XvPutImage = adaptor->PutImage;
+	savedXvPutImage = adaptor->PutImage;
 	adaptor->PutImage = put_image;
 
 	return TRUE;
commit aaedeffe00d9414bb03723dbc30b4938a07ce5fa
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Wed Oct 14 18:09:08 2009 +0200

    Xv overlay: fix planar YUV copy for right rotated crtcs
    
    While copying and rotating the buffer, array access was out of bounds when
    rotated to the right (RR_Rotate_270).  My buffer handling changes probably
    made this bug much more likely to actually result in a SIGSEGV.
    
    I've checked the logs and the bug exists since rotation has been supported,
    i.e.  this looks like a candidate for cherry-picking for all supported
    releases.
    
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/i830_video.c b/src/i830_video.c
index 191f44e..848099d 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -887,13 +887,13 @@ I830CopyPackedData(intel_adaptor_private *adaptor_priv,
 				dst[(((h - i) * 2) - 3) + (j * dstPitch)] =
 				    src[(j * 2) + 1 + (i * srcPitch)];
 				dst[(((h - i) * 2) - 3) +
-				    ((j - 1) * dstPitch)] =
+				    ((j + 1) * dstPitch)] =
 				    src[(j * 2) + 1 + ((i + 1) * srcPitch)];
 				/* Copy V */
 				dst[(((h - i) * 2) - 1) + (j * dstPitch)] =
 				    src[(j * 2) + 3 + (i * srcPitch)];
 				dst[(((h - i) * 2) - 1) +
-				    ((j - 1) * dstPitch)] =
+				    ((j + 1) * dstPitch)] =
 				    src[(j * 2) + 3 + ((i + 1) * srcPitch)];
 			}
 		}
commit 703e3326bb41528cc57c0d25003707df209fc714
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Wed Oct 14 15:56:55 2009 +0200

    Xv overlay: further cleanups
    
    Kill some unnecessary stuff. Small code changes, but no functional ones.
    
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/i830_video.c b/src/i830_video.c
index 69276de..191f44e 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -140,17 +140,13 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {
 	{15, TrueColor}, {16, TrueColor}, {24, TrueColor}
 };
 
-#define CLONE_ATTRIBUTES 1
-static XF86AttributeRec CloneAttributes[CLONE_ATTRIBUTES] = {
-	{XvSettable | XvGettable, -1, 1, "XV_PIPE"}
-};
-
-#define NUM_ATTRIBUTES 4
+#define NUM_ATTRIBUTES 5
 static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = {
 	{XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
 	{XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
 	{XvSettable | XvGettable, 0, 255, "XV_CONTRAST"},
-	{XvSettable | XvGettable, 0, 1023, "XV_SATURATION"}
+	{XvSettable | XvGettable, 0, 1023, "XV_SATURATION"},
+	{XvSettable | XvGettable, -1, 1, "XV_PIPE"}
 };
 
 #define NUM_TEXTURED_ATTRIBUTES 3
@@ -390,18 +386,16 @@ void I830InitVideo(ScreenPtr screen)
 		}
 	}
 
-	/* Set up overlay video if we can do it at this depth. */
-	if (!OVERLAY_NOEXIST(intel) && scrn->bitsPerPixel != 8) {
-		intel->use_drmmode_overlay = drmmode_has_overlay(scrn);
-		if (intel->use_drmmode_overlay) {
-			overlayAdaptor = I830SetupImageVideoOverlay(screen);
-			if (overlayAdaptor != NULL) {
-				xf86DrvMsg(scrn->scrnIndex, X_INFO,
-					   "Set up overlay video\n");
-			} else {
-				xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-					   "Failed to set up overlay video\n");
-			}
+	/* Set up overlay video if it is available */
+	intel->use_drmmode_overlay = drmmode_has_overlay(scrn);
+	if (intel->use_drmmode_overlay) {
+		overlayAdaptor = I830SetupImageVideoOverlay(screen);
+		if (overlayAdaptor != NULL) {
+			xf86DrvMsg(scrn->scrnIndex, X_INFO,
+				   "Set up overlay video\n");
+		} else {
+			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+				   "Failed to set up overlay video\n");
 		}
 	}
 
@@ -470,7 +464,6 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
 
 	adapt->pPortPrivates[0].ptr = (pointer) (adaptor_priv);
 	adapt->nAttributes = NUM_ATTRIBUTES;
-	adapt->nAttributes += CLONE_ATTRIBUTES;
 	if (IS_I9XX(intel))
 		adapt->nAttributes += GAMMA_ATTRIBUTES;	/* has gamma */
 	adapt->pAttributes =
@@ -480,9 +473,6 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
 	memcpy((char *)att, (char *)Attributes,
 	       sizeof(XF86AttributeRec) * NUM_ATTRIBUTES);
 	att += NUM_ATTRIBUTES;
-	memcpy((char *)att, (char *)CloneAttributes,
-	       sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES);
-	att += CLONE_ATTRIBUTES;
 	if (IS_I9XX(intel)) {
 		memcpy((char *)att, (char *)GammaAttributes,
 		       sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
commit 1c2aedfce9e6a7561347e873d125b6889dee7941
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Wed Oct 14 15:56:54 2009 +0200

    Xv: fixup the disabled drmmode overlay code
    
    This code didn't survive the global renaming of vars to saner names.
    Fix it up.
    
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/i830_video.c b/src/i830_video.c
index 6e51ba7..69276de 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -214,7 +214,7 @@ static Bool drmmode_has_overlay(ScrnInfoPtr scrn)
 
 	gp.param = I915_PARAM_HAS_OVERLAY;
 	gp.value = &has_overlay;
-	drmCommandWriteRead(p830->drmSubFD, DRM_I915_GETPARAM, &gp, sizeof(gp));
+	drmCommandWriteRead(intel->drmSubFD, DRM_I915_GETPARAM, &gp, sizeof(gp));
 
 	return has_overlay ? TRUE : FALSE;
 #else
@@ -226,7 +226,7 @@ static void drmmode_overlay_update_attrs(ScrnInfoPtr scrn)
 {
 #ifdef DRM_MODE_OVERLAY_LANDED
 	intel_screen_private *intel = intel_get_screen_private(scrn);
-	intel_adaptor_private *adaptor_priv = GET_PORT_PRIVATE(scrn);
+	intel_adaptor_private *adaptor_priv = intel_get_adaptor_private(scrn);
 	struct drm_intel_overlay_attrs attrs;
 	int ret;
 
@@ -242,7 +242,7 @@ static void drmmode_overlay_update_attrs(ScrnInfoPtr scrn)
 	attrs.gamma4 = adaptor_priv->gamma4;
 	attrs.gamma5 = adaptor_priv->gamma5;
 
-	ret = drmCommandWriteRead(p830->drmSubFD, DRM_I915_OVERLAY_ATTRS,
+	ret = drmCommandWriteRead(intel->drmSubFD, DRM_I915_OVERLAY_ATTRS,
 				  &attrs, sizeof(attrs));
 
 	if (ret != 0)
@@ -259,7 +259,7 @@ static void drmmode_overlay_off(ScrnInfoPtr scrn)
 
 	request.flags = 0;
 
-	ret = drmCommandWrite(p830->drmSubFD, DRM_I915_OVERLAY_PUT_IMAGE,
+	ret = drmCommandWrite(intel->drmSubFD, DRM_I915_OVERLAY_PUT_IMAGE,
 			      &request, sizeof(request));
 
 	if (ret != 0)
@@ -276,7 +276,7 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
 {
 #ifdef DRM_MODE_OVERLAY_LANDED
 	intel_screen_private *intel = intel_get_screen_private(scrn);
-	intel_adaptor_private *adaptor_priv = GET_PORT_PRIVATE(scrn);
+	intel_adaptor_private *adaptor_priv = intel_get_adaptor_private(scrn);
 	struct drm_intel_overlay_put_image request;
 	int ret;
 	int planar = is_planar_fourcc(id);
@@ -327,7 +327,7 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
 			request.flags |= I915_OVERLAY_Y_SWAP;
 	}
 
-	ret = drmCommandWrite(p830->drmSubFD, DRM_I915_OVERLAY_PUT_IMAGE,
+	ret = drmCommandWrite(intel->drmSubFD, DRM_I915_OVERLAY_PUT_IMAGE,
 			      &request, sizeof(request));
 
 	/* drop the newly displaying buffer right away */
commit 909990f40a437cbd7026a10e32af1ea120f4c2a7
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Wed Oct 14 15:56:53 2009 +0200

    Xv overlay: remove some more dead stuff from ums overlay support
    
    Mostly unused definitions and variables, but also some strange ums
    debug code. Also kill some now obsolete comments.
    
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/i830_video.c b/src/i830_video.c
index 76055cf..6e51ba7 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -204,27 +204,6 @@ static XF86ImageRec Images[NUM_IMAGES] = {
 #endif
 };
 
-#if VIDEO_DEBUG
-static void CompareOverlay(intel_screen_private *intel, uint32_t * overlay, int size)
-{
-	int i;
-	uint32_t val;
-	int bad = 0;
-
-	for (i = 0; i < size; i += 4) {
-		val = INREG(0x30100 + i);
-		if (val != overlay[i / 4]) {
-			OVERLAY_DEBUG
-			    ("0x%05x value doesn't match (0x%lx != 0x%lx)\n",
-			     0x30100 + i, val, overlay[i / 4]);
-			bad++;
-		}
-	}
-	if (!bad)
-		OVERLAY_DEBUG("CompareOverlay: no differences\n");
-}
-#endif
-
 /* kernel modesetting overlay functions */
 static Bool drmmode_has_overlay(ScrnInfoPtr scrn)
 {
@@ -458,12 +437,6 @@ void I830InitVideo(ScreenPtr screen)
 	xfree(adaptors);
 }
 
-#define PFIT_CONTROLS 0x61230
-#define PFIT_AUTOVSCALE_MASK 0x200
-#define PFIT_ON_MASK 0x80000000
-#define PFIT_AUTOSCALE_RATIO 0x61238
-#define PFIT_PROGRAMMED_SCALE_RATIO 0x61234
-
 static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
 {
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
@@ -534,11 +507,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
 	adaptor_priv->brightness = -19;	/* (255/219) * -16 */
 	adaptor_priv->contrast = 75;	/* 255/219 * 64 */
 	adaptor_priv->saturation = 146;	/* 128/112 * 128 */
-	adaptor_priv->current_crtc = NULL;
 	adaptor_priv->desired_crtc = NULL;
 	adaptor_priv->buf = NULL;
-	adaptor_priv->oldBuf = NULL;
-	adaptor_priv->oldBuf_pinned = FALSE;
 	adaptor_priv->gamma5 = 0xc0c0c0;
 	adaptor_priv->gamma4 = 0x808080;
 	adaptor_priv->gamma3 = 0x404040;
@@ -553,19 +523,6 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
 
 	intel->adaptor = adapt;
 
-	/* With LFP's we need to detect whether we're in One Line Mode, which
-	 * essentially means a resolution greater than 1024x768, and fix up
-	 * the scaler accordingly. */
-	adaptor_priv->scaleRatio = 0x10000;
-	adaptor_priv->oneLineMode = FALSE;
-
-	/*
-	 * Initialise adaptor_priv->overlayOK.  Set it to TRUE here so that a
-	 * warning will be generated if i830_crtc_dpms_video() sets it to
-	 * FALSE during mode setup.
-	 */
-	adaptor_priv->overlayOK = TRUE;
-
 	xvColorKey = MAKE_ATOM("XV_COLORKEY");
 	xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
 	xvContrast = MAKE_ATOM("XV_CONTRAST");
@@ -646,8 +603,6 @@ static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
 		adaptor_priv->textured = TRUE;
 		adaptor_priv->videoStatus = 0;
 		adaptor_priv->buf = NULL;
-		adaptor_priv->oldBuf = NULL;
-		adaptor_priv->oldBuf_pinned = FALSE;
 
 		adaptor_priv->rotation = RR_Rotate_0;
 		adaptor_priv->SyncToVblank = 1;
@@ -669,14 +624,6 @@ static void i830_free_video_buffers(intel_adaptor_private *adaptor_priv)
 		drm_intel_bo_unreference(adaptor_priv->buf);
 		adaptor_priv->buf = NULL;
 	}
-
-	if (adaptor_priv->oldBuf) {
-		if (adaptor_priv->oldBuf_pinned)
-			drm_intel_bo_unpin(adaptor_priv->oldBuf);
-		drm_intel_bo_unreference(adaptor_priv->oldBuf);
-		adaptor_priv->oldBuf = NULL;
-		adaptor_priv->oldBuf_pinned = FALSE;
-	}
 }
 
 static void I830StopVideo(ScrnInfoPtr scrn, pointer data, Bool shutdown)
@@ -760,9 +707,6 @@ I830SetPortAttributeOverlay(ScrnInfoPtr scrn,
 			adaptor_priv->desired_crtc = NULL;
 		else
 			adaptor_priv->desired_crtc = xf86_config->crtc[value];
-		/*
-		 * Leave this to be updated at the next frame
-		 */
 	} else if (attribute == xvGamma0 && (IS_I9XX(intel))) {
 		adaptor_priv->gamma0 = value;
 	} else if (attribute == xvGamma1 && (IS_I9XX(intel))) {
@@ -781,7 +725,6 @@ I830SetPortAttributeOverlay(ScrnInfoPtr scrn,
 	} else
 		return BadMatch;
 
-	/* Ensure that the overlay is off, ready for updating */
 	if ((attribute == xvGamma0 ||
 	     attribute == xvGamma1 ||
 	     attribute == xvGamma2 ||
@@ -1089,12 +1032,6 @@ I830CopyPlanarData(intel_adaptor_private *adaptor_priv,
 	drm_intel_bo_unmap(adaptor_priv->buf);
 }
 
-typedef struct {
-	uint8_t sign;
-	uint16_t mantissa;
-	uint8_t exponent;
-} coeffRec, *coeffPtr;
-
 static void i830_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
 {
 	dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
@@ -1254,22 +1191,15 @@ i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
 		     BoxPtr dstBox, short src_w, short src_h, short drw_w,
 		     short drw_h)
 {
-	intel_screen_private *intel = intel_get_screen_private(scrn);
-	intel_adaptor_private *adaptor_priv = intel->adaptor->pPortPrivates[0].ptr;
 	int tmp;
 
 	OVERLAY_DEBUG("I830DisplayVideo: %dx%d (pitch %d)\n", width, height,
 		      dstPitch);
 
-#if VIDEO_DEBUG
-	CompareOverlay(intel, (uint32_t *) overlay, 0x100);
-#endif
-
 	/*
 	 * If the video isn't visible on any CRTC, turn it off
 	 */
 	if (!crtc) {
-		adaptor_priv->current_crtc = NULL;
 		drmmode_overlay_off(scrn);
 
 		return TRUE;
diff --git a/src/i830_video.h b/src/i830_video.h
index f3e9ed9..a2beae0 100644
--- a/src/i830_video.h
+++ b/src/i830_video.h
@@ -35,7 +35,6 @@ typedef struct {
 	int brightness;
 	int contrast;
 	int saturation;
-	xf86CrtcPtr current_crtc;
 	xf86CrtcPtr desired_crtc;
 
 	RegionRec clip;
@@ -51,14 +50,9 @@ typedef struct {
 	uint32_t videoStatus;
 	Time offTime;
 	Time freeTime;
-   /** YUV data buffers */
-	drm_intel_bo *buf;	/* current buffer to draw into */
-	drm_intel_bo *oldBuf;	/* old buffer, may be in use by the overlay hw */
-	Bool oldBuf_pinned;	/* only actually pinned when in use by the overlay hw */
-
-	Bool overlayOK;
-	int oneLineMode;
-	int scaleRatio;
+	/** YUV data buffers */
+	drm_intel_bo *buf;
+
 	Bool textured;
 	Rotation rotation;	/* should remove intel->rotation later */
 


More information about the xorg-commit mailing list