summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-08-15 15:34:25 +0100
committerDave Airlie <airlied@redhat.com>2011-08-15 15:39:52 +0100
commitf398d2c185a8099f9ff50476665d83eb4e15a6e6 (patch)
treedc9cc89f26e41b6a7eea04d31c20c5b7f568c1c2
parent709cd63721851e65b52e10c591148b5a42596acd (diff)
getimage: need to pass a dst stride.
thanks to ajax for pointing this out for me, saved me a little time.
-rw-r--r--drv/drv_types.h1
-rw-r--r--drv/exa/exa_accel.c6
-rw-r--r--drv/exa/exa_priv.h4
-rw-r--r--drv/exa/exa_unaccel.c10
-rw-r--r--drv/fb/drvfb.h2
-rw-r--r--drv/fb/fb24_32.c1
-rw-r--r--drv/fb/fbimage.c5
-rw-r--r--drv/impedscrn.c2
8 files changed, 18 insertions, 13 deletions
diff --git a/drv/drv_types.h b/drv/drv_types.h
index dd4f247ac..8d409feb7 100644
--- a/drv/drv_types.h
+++ b/drv/drv_types.h
@@ -37,6 +37,7 @@ typedef void (* DrvGetImageProcPtr)(
int /*h*/,
unsigned int /*format*/,
unsigned long /*planeMask*/,
+ int /* dst_stride */,
char * /*pdstLine*/);
diff --git a/drv/exa/exa_accel.c b/drv/exa/exa_accel.c
index c5bef6780..79e6ee239 100644
--- a/drv/exa/exa_accel.c
+++ b/drv/exa/exa_accel.c
@@ -1173,7 +1173,7 @@ exaFillRegionTiled (DrvPixmapPtr pPixmap, RegionPtr pRegion, DrvPixmapPtr pTile,
*/
void
exaGetImage (DrvPixmapPtr pPixmap, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask, char *d)
+ unsigned int format, unsigned long planeMask, int dst_stride, char *d)
{
ExaScreenPriv (pPixmap->pDrvScreen);
DrvPixmapPtr pPix = exaGetDrawablePixmap (pPixmap);
@@ -1204,12 +1204,12 @@ exaGetImage (DrvPixmapPtr pPixmap, int x, int y, int w, int h,
ok = pExaScr->info->DownloadFromScreen(pPix, x,
y, w, h, d,
- PixmapBytePad(w, pPixmap->depth));
+ PixmapBytePad(dst_stride, pPixmap->depth));
if (ok) {
exaWaitSync(pPixmap->pDrvScreen);
return;
}
fallback:
- ExaCheckGetImage(pPixmap, x, y, w, h, format, planeMask, d);
+ ExaCheckGetImage(pPixmap, x, y, w, h, format, planeMask, dst_stride, d);
}
diff --git a/drv/exa/exa_priv.h b/drv/exa/exa_priv.h
index 89926b5da..f5d006f20 100644
--- a/drv/exa/exa_priv.h
+++ b/drv/exa/exa_priv.h
@@ -429,7 +429,7 @@ ExaCheckPushPixels (DrvGCPtr pGC, DrvPixmapPtr pBitmap,
void
ExaCheckGetImage(DrvPixmapPtr pPixmap, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask, char *d);
+ unsigned int format, unsigned long planeMask, int dst_stride, char *d);
void
ExaCheckGetSpans (DrvPixmapPtr pPixmap,
@@ -465,7 +465,7 @@ exaFillRegionTiled (DrvPixmapPtr pPixmap, RegionPtr pRegion, DrvPixmapPtr pTile,
void
exaGetImage (DrvPixmapPtr pPixmap, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask, char *d);
+ unsigned int format, unsigned long planeMask, int dst_stride, char *d);
RegionPtr
exaCopyArea(DrvPixmapPtr pSrcDrawable, DrvPixmapPtr pDstDrawable, DrvGCPtr pGC,
diff --git a/drv/exa/exa_unaccel.c b/drv/exa/exa_unaccel.c
index a5bdf6770..1663287ef 100644
--- a/drv/exa/exa_unaccel.c
+++ b/drv/exa/exa_unaccel.c
@@ -368,7 +368,7 @@ ExaCheckPushPixels (DrvGCPtr pGC, DrvPixmapPtr pBitmap,
void
ExaCheckGetImage(DrvPixmapPtr pPixmap, int x, int y, int w, int h,
- unsigned int format, unsigned long planeMask, char *d)
+ unsigned int format, unsigned long planeMask, int dst_stride, char *d)
{
DrvScreenPtr pScreen = pPixmap->pDrvScreen;
EXA_PRE_FALLBACK(pScreen);
@@ -378,7 +378,7 @@ ExaCheckGetImage(DrvPixmapPtr pPixmap, int x, int y, int w, int h,
ExaFallbackPrepareReg(pPixmap, NULL, x, y, w, h,
EXA_PREPARE_SRC, FALSE);
swap(pExaScr, pScreen, GetImage);
- pScreen->GetImage (pPixmap, x, y, w, h, format, planeMask, d);
+ pScreen->GetImage (pPixmap, x, y, w, h, format, planeMask, dst_stride, d);
swap(pExaScr, pScreen, GetImage);
exaFinishAccess (pPixmap, EXA_PREPARE_SRC);
EXA_POST_FALLBACK(pScreen);
@@ -704,7 +704,7 @@ exaGetPixmapFirstPixel (DrvPixmapPtr pPixmap)
CARD32 pixel;
pPixmap->pDrvScreen->GetImage(pPixmap, 0, 0, 1, 1,
- ZPixmap, ~0, (char*)&pixel);
+ ZPixmap, ~0, 1, (char*)&pixel);
return pixel;
}
case 16:
@@ -712,7 +712,7 @@ exaGetPixmapFirstPixel (DrvPixmapPtr pPixmap)
CARD16 pixel;
pPixmap->pDrvScreen->GetImage(pPixmap, 0, 0, 1, 1,
- ZPixmap, ~0, (char*)&pixel);
+ ZPixmap, ~0, 1, (char*)&pixel);
return pixel;
}
case 8:
@@ -722,7 +722,7 @@ exaGetPixmapFirstPixel (DrvPixmapPtr pPixmap)
CARD8 pixel;
pPixmap->pDrvScreen->GetImage(pPixmap, 0, 0, 1, 1,
- ZPixmap, ~0, (char*)&pixel);
+ ZPixmap, ~0, 1, (char*)&pixel);
return pixel;
}
default:
diff --git a/drv/fb/drvfb.h b/drv/fb/drvfb.h
index 88b5c6a6a..cb48e45dc 100644
--- a/drv/fb/drvfb.h
+++ b/drv/fb/drvfb.h
@@ -760,6 +760,7 @@ fb24_32GetImage (DrvPixmapPtr pPixmap,
int h,
unsigned int format,
unsigned long planeMask,
+ int dst_stride,
char *d);
extern _X_EXPORT void
@@ -1423,6 +1424,7 @@ fbGetImage (DrvPixmapPtr pPixmap,
int h,
unsigned int format,
unsigned long planeMask,
+ int dst_stride,
char *d);
/*
* fbline.c
diff --git a/drv/fb/fb24_32.c b/drv/fb/fb24_32.c
index bde49d922..7aaab7c47 100644
--- a/drv/fb/fb24_32.c
+++ b/drv/fb/fb24_32.c
@@ -444,6 +444,7 @@ fb24_32GetImage (DrvPixmapPtr pDrawable,
int h,
unsigned int format,
unsigned long planeMask,
+ int dst_stride,
char *d)
{
FbBits *srcBits;
diff --git a/drv/fb/fbimage.c b/drv/fb/fbimage.c
index a002dab0a..bd5f1679f 100644
--- a/drv/fb/fbimage.c
+++ b/drv/fb/fbimage.c
@@ -284,6 +284,7 @@ fbGetImage (DrvPixmapPtr pPixmap,
int h,
unsigned int format,
unsigned long planeMask,
+ int dst_stride,
char *d)
{
FbBits *src;
@@ -296,7 +297,7 @@ fbGetImage (DrvPixmapPtr pPixmap,
if (format == ZPixmap &&
pPixmap->bitsPerPixel != BitsPerPixel (pPixmap->depth))
{
- fb24_32GetImage (pPixmap, x, y, w, h, format, planeMask, d);
+ fb24_32GetImage (pPixmap, x, y, w, h, format, planeMask, dst_stride, d);
return;
}
@@ -308,7 +309,7 @@ fbGetImage (DrvPixmapPtr pPixmap,
FbBits pm;
pm = fbReplicatePixel (planeMask, srcBpp);
- dstStride = PixmapBytePad(w, pPixmap->depth);
+ dstStride = PixmapBytePad(dst_stride, pPixmap->depth);
if (pm != FB_ALLONES)
memset (d, 0, dstStride * h);
dstStride /= sizeof (FbStip);
diff --git a/drv/impedscrn.c b/drv/impedscrn.c
index f4d86c696..9c7cc74d1 100644
--- a/drv/impedscrn.c
+++ b/drv/impedscrn.c
@@ -225,7 +225,7 @@ impedGetImage (DrawablePtr pDrawable,
y += y_off;
for (i = 0; i < imped_screen->num_gpu; i++) {
- (imped_screen->gpu[i]->GetImage)(imped_pixmap->gpu[i], x, y, w, h, format, planeMask, d);
+ (imped_screen->gpu[i]->GetImage)(imped_pixmap->gpu[i], x, y, w, h, format, planeMask, w, d);
}
}