diff --git a/src/r600_exa.c b/src/r600_exa.c index a4e2a4d..a4736b3 100644 --- a/src/r600_exa.c +++ b/src/r600_exa.c @@ -2032,7 +2032,7 @@ static void R600DoneComposite(PixmapPtr pDst) /* really would be better to wait on a timestamp shadowed in memory, * but this will do for now. */ -static Bool +Bool R600WaitforIdlePoll(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c index 16b2c82..595beef 100644 --- a/src/radeon_textured_video.c +++ b/src/radeon_textured_video.c @@ -153,14 +153,20 @@ static __inline__ uint32_t F_TO_24(float val) #endif /* XF86DRI */ +extern Bool +R600WaitforIdlePoll(ScrnInfoPtr pScrn); + static void -CopyPlanartoNV12(unsigned char *y_src, unsigned char *u_src, unsigned char *v_src, +CopyPlanartoNV12(ScrnInfoPtr pScrn, + unsigned char *y_src, unsigned char *u_src, unsigned char *v_src, unsigned char *dst, int srcPitch, int srcPitch2, int dstPitch, int w, int h) { int i, j; + R600WaitforIdlePoll(pScrn); + /* Y */ if (srcPitch == dstPitch) { memcpy(dst, y_src, srcPitch * h); @@ -195,7 +201,8 @@ CopyPlanartoNV12(unsigned char *y_src, unsigned char *u_src, unsigned char *v_sr } static void -CopyPackedtoNV12(unsigned char *src, unsigned char *dst, +CopyPackedtoNV12(ScrnInfoPtr pScrn, + unsigned char *src, unsigned char *dst, int srcPitch, int dstPitch, int w, int h, int id) { @@ -203,6 +210,8 @@ CopyPackedtoNV12(unsigned char *src, unsigned char *dst, int uv_offset = dstPitch * h; uv_offset = (uv_offset + 255) & ~255; + R600WaitforIdlePoll(pScrn); + // FOURCC_UYVY: U0 Y0 V0 Y1 // FOURCC_YUY2: Y0 U0 Y1 V0 for (i = 0; i < h; i++) { @@ -392,12 +401,12 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn, s2offset = srcPitch * height; s3offset = (srcPitch2 * (height >> 1)) + s2offset; if (id == FOURCC_YV12) - CopyPlanartoNV12(buf, buf + s3offset, buf + s2offset, + CopyPlanartoNV12(pScrn, buf, buf + s3offset, buf + s2offset, pPriv->src_addr, srcPitch, srcPitch2, pPriv->src_pitch, width, height); else - CopyPlanartoNV12(buf, buf + s2offset, buf + s3offset, + CopyPlanartoNV12(pScrn, buf, buf + s2offset, buf + s3offset, pPriv->src_addr, srcPitch, srcPitch2, pPriv->src_pitch, width, height); @@ -426,7 +435,7 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn, case FOURCC_YUY2: default: if (info->ChipFamily >= CHIP_FAMILY_R600) { - CopyPackedtoNV12(buf, pPriv->src_addr, + CopyPackedtoNV12(pScrn, buf, pPriv->src_addr, 2 * width, pPriv->src_pitch, width, height, id); } else {