summaryrefslogtreecommitdiff
path: root/src/i830_exa.c
diff options
context:
space:
mode:
authorWang Zhenyu <zhenyu.z.wang@intel.com>2006-05-18 11:31:14 +0800
committerWang Zhenyu <zhenyu.z.wang@intel.com>2006-05-18 11:31:14 +0800
commit52af679c94a25c0c6e5df5f3647f62fdd256c826 (patch)
tree1f1aae4b279784cce6b833b343c3f15c4b9406a6 /src/i830_exa.c
parentfdb52a8c6da0f3d3f4cfbf1583b2dc4d91f7e933 (diff)
Check alignment require in PrepareSolid, noticed by Eric,
as pixmap offset align set is violated in Solid.
Diffstat (limited to 'src/i830_exa.c')
-rw-r--r--src/i830_exa.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 6726a0e8..b250fb21 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -133,11 +133,20 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
{
ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
+ unsigned long offset, pitch;
if (planemask != (Pixel)~0 && !EXA_PM_IS_SOLID(pPixmap, planemask))
return FALSE;
- pI830->BR[13] = exaGetPixmapPitch(pPixmap);
+ offset = exaGetPixmapOffset(pPixmap);
+ pitch = exaGetPixmapPitch(pPixmap);
+
+ if ( offset % pI830->EXADriverPtr->pixmapOffsetAlign != 0)
+ return FALSE;
+ if ( pitch % pI830->EXADriverPtr->pixmapPitchAlign != 0)
+ return FALSE;
+
+ pI830->BR[13] = pitch;
pI830->BR[13] |= I830PatternROP[alu] << 16;
pI830->BR[16] = fg;
@@ -165,8 +174,10 @@ I830EXASolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
int h, w;
- unsigned int offset;
+ unsigned long offset;
+ /* pixmap's offset and pitch is aligned,
+ otherwise it falls back in PrepareSolid */
offset = exaGetPixmapOffset(pPixmap) + y1 * exaGetPixmapPitch(pPixmap) +
x1 * (pPixmap->drawable.bitsPerPixel / 8);