From 5286b1b0d02758bec4f64f57226a1019726ea01a Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 6 Sep 2010 18:28:38 -0600 Subject: [PATCH] Hardcode bpp in LXCopyFromSys() calls At https://bugs.freedesktop.org/show_bug.cgi?id=29391#c2 Daniel Stone points out a possible problem with the recent Xv PutImage fix. I'm not sure if what he says is true within this context (there is already various code to handle padding and alignment) but his suggestion is certainly the safest option. --- src/lx_video.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lx_video.c b/src/lx_video.c index 76c38ca..3bb9f32 100644 --- a/src/lx_video.c +++ b/src/lx_video.c @@ -115,11 +115,11 @@ typedef struct static void LXCopyFromSys(GeodeRec * pGeode, unsigned char *src, unsigned int dst, - int dstPitch, int srcPitch, int h, int w) + int dstPitch, int srcPitch, int h, int w, int bpp) { gp_declare_blt(0); - gp_set_bpp((srcPitch / w) << 3); + gp_set_bpp(bpp); gp_set_raster_operation(0xCC); gp_set_strides(dstPitch, srcPitch); @@ -264,13 +264,13 @@ LXCopyPlanar(ScrnInfoPtr pScrni, int id, unsigned char *buf, LXCopyFromSys(pGeode, buf + YSrcOffset, pPriv->vidmem->offset + YDstOffset, YDstPitch, YSrcPitch, lines, - pixels); + pixels, 8); /* Copy U + V at the same time */ LXCopyFromSys(pGeode, buf + USrcOffset, pPriv->vidmem->offset + UDstOffset, UVDstPitch, UVSrcPitch, lines, - pixels >> 1); + pixels >> 1, 8); videoScratch.dstOffset = pPriv->vidmem->offset + YDstOffset; videoScratch.dstPitch = YDstPitch; @@ -328,7 +328,7 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf, srcPitch, dstPitch, height, pixels >> 1); } else LXCopyFromSys(pGeode, buf + srcOffset, dstOffset, dstPitch, srcPitch, - height, pixels); + height, pixels, 16); videoScratch.dstOffset = dstOffset; videoScratch.dstPitch = dstPitch; -- 1.7.2.2