xf86-video-intel: Branch '965-xvmc' - src/i830_video.c src/i965_hwmc.c src/i965_video.c

Nan hai Zou znh at kemper.freedesktop.org
Sun Aug 10 23:51:29 PDT 2008


 src/i830_video.c |   20 ++++++++++++++++++++
 src/i965_hwmc.c  |   11 ++++-------
 src/i965_video.c |    4 ++++
 3 files changed, 28 insertions(+), 7 deletions(-)

New commits:
commit 19ebdf1b24184c0a293a698d44c4e0571109d153
Author: root <root at cr-znh.(none)>
Date:   Mon Aug 11 15:31:13 2008 +0800

      [i965-xvmc] bypass copy when put image with xvmc

diff --git a/src/i830_video.c b/src/i830_video.c
index 7b81b04..a52fac4 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2290,6 +2290,11 @@ I830PutImage(ScrnInfoPtr pScrn,
             srcPitch = (width + 0x3ff) & ~0x3ff;
             srcPitch2 = ((width >> 1) + 0x3ff) & ~0x3ff;
         }
+  	break;
+    case FOURCC_XVMC:
+	srcPitch = (width + 0x3) & ~0x3;
+	srcPitch2 = ((width >> 1) + 0x3) & ~0x3;
+	break;	 
 #endif
 	break;
     case FOURCC_UYVY:
@@ -2428,6 +2433,13 @@ I830PutImage(ScrnInfoPtr pScrn,
 	break;
 #ifdef INTEL_XVMC
     case FOURCC_XVMC:
+	if (pPriv->rotation != RR_Rotate_0) {
+	    top &= ~1;
+	    nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
+	    I830CopyPlanarData(pScrn, pPriv, buf, srcPitch, srcPitch2, dstPitch,
+		    height, top, left, nlines, npixels, id);
+	}
+
 	break;
 #endif
     default:
@@ -2468,6 +2480,14 @@ I830PutImage(ScrnInfoPtr pScrn,
 	    i830_fill_colorkey (pScreen, pPriv->colorKey, clipBoxes);
 	}
     } else if (IS_I965G(pI830)) {
+
+#ifdef INTEL_XVMC
+	if (id == FOURCC_XVMC && pPriv->rotation == RR_Rotate_0) {
+	    pPriv->YBuf0offset = buf -  pI830->FbBase;
+	    pPriv->UBuf0offset = pPriv->YBuf0offset + height*width; 
+	    pPriv->VBuf0offset = pPriv->UBuf0offset + height*width/4; 
+	}
+#endif
 	I965DisplayVideoTextured(pScrn, pPriv, destId, clipBoxes, width, height,
 				 dstPitch, x1, y1, x2, y2,
 				 src_w, src_h, drw_w, drw_h, pPixmap);
diff --git a/src/i965_hwmc.c b/src/i965_hwmc.c
index 8446c52..140fa9a 100644
--- a/src/i965_hwmc.c
+++ b/src/i965_hwmc.c
@@ -230,13 +230,10 @@ static int put_image(ScrnInfoPtr pScrn,
 	struct intel_xvmc_command *cmd = (struct intel_xvmc_command *)buf;
 	if (id == FOURCC_XVMC) {
 	    buf = pI830->FbBase + cmd->surf_offset;
-	    XvPutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
-		    drw_w, drw_h, FOURCC_I420, buf, width, height, sync, clipBoxes,
-		    data, pDraw);
-	}else
-	    XvPutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
-		    drw_w, drw_h, id, buf, width, height, sync, clipBoxes,
-		    data, pDraw);
+	}
+	XvPutImage(pScrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
+		drw_w, drw_h, id, buf, width, height, sync, clipBoxes,
+		data, pDraw);
 	return Success;
 }
 
diff --git a/src/i965_video.c b/src/i965_video.c
index 4572e13..eaf6c01 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -37,6 +37,7 @@
 
 #include "i830.h"
 #include "i830_video.h"
+#include "i830_hwmc.h"
 #include "brw_defines.h"
 #include "brw_structs.h"
 #include <string.h>
@@ -248,6 +249,9 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 	src_pitch[0] = video_pitch;
 	n_src_surf = 1;
 	break;
+#ifdef INTEL_XVMC
+    case FOURCC_XVMC:
+#endif
     case FOURCC_I420:
     case FOURCC_YV12:
 	src_surf_format = BRW_SURFACEFORMAT_R8_UNORM;


More information about the xorg-commit mailing list