xf86-video-intel: Branch 'exa' - 3 commits - src/i830_exa.c

Zhenyu Wang zhen at kemper.freedesktop.org
Thu May 18 06:33:47 EEST 2006


 src/i830_exa.c |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

New commits:
diff-tree 33ad959323f70f76c494c66ec35a04d7d839f612 (from 52af679c94a25c0c6e5df5f3647f62fdd256c826)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Thu May 18 11:32:59 2006 +0800

    Add DEBUG_I830FALLBACK for easier tracking

diff --git a/src/i830_exa.c b/src/i830_exa.c
index b250fb2..5d95ea7 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -37,6 +37,20 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #include "i830.h"
 #include "i810_reg.h"
 
+#ifdef I830DEBUG
+#define DEBUG_I830FALLBACK 0
+#endif
+
+#ifdef DEBUG_I830FALLBACK
+#define I830FALLBACK(s, arg...)				\
+do {							\
+	DPRINTF(PFX, "EXA fallback: " s "\n", ##arg); 	\
+	return FALSE;					\
+} while(0)
+#else
+#define I830FALLBACK(x) { return FALSE; }
+#endif
+
 int I830CopyROP[16] =
 {
    ROP_0,               /* GXclear */
@@ -136,15 +150,15 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, i
     unsigned long offset, pitch;
 
     if (planemask != (Pixel)~0 && !EXA_PM_IS_SOLID(pPixmap, planemask))
-	return FALSE;
+	I830FALLBACK("planemask is not solid");
 
     offset = exaGetPixmapOffset(pPixmap);
     pitch = exaGetPixmapPitch(pPixmap);
 
     if ( offset % pI830->EXADriverPtr->pixmapOffsetAlign != 0)
-	return FALSE;
+	I830FALLBACK("pixmap offset not aligned");
     if ( pitch % pI830->EXADriverPtr->pixmapPitchAlign != 0)
-	return FALSE;
+	I830FALLBACK("pixmap pitch not aligned");
 
     pI830->BR[13] = pitch;
     pI830->BR[13] |= I830PatternROP[alu] << 16;
@@ -221,7 +235,7 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap,
     I830Ptr pI830 = I830PTR(pScrn);
 
     if (planemask != (Pixel)~0 && !EXA_PM_IS_SOLID(pScrPixmap, planemask))
-	return FALSE;
+	I830FALLBACK("planemask is not solid");
 
     pI830->copy_src_pitch = exaGetPixmapPitch(pSrcPixmap);
     pI830->copy_src_off = exaGetPixmapOffset(pSrcPixmap);
diff-tree 52af679c94a25c0c6e5df5f3647f62fdd256c826 (from fdb52a8c6da0f3d3f4cfbf1583b2dc4d91f7e933)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Thu May 18 11:31:14 2006 +0800

    Check alignment require in PrepareSolid, noticed by Eric,
    as pixmap offset align set is violated in Solid.

diff --git a/src/i830_exa.c b/src/i830_exa.c
index 6726a0e..b250fb2 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -133,11 +133,20 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, i
 {
     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, 
     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);
     
diff-tree fdb52a8c6da0f3d3f4cfbf1583b2dc4d91f7e933 (from 011a1c99d49c1c69b5fa81ade6a2ed73e84276ae)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Thu May 18 11:24:46 2006 +0800

    Solid planemask in PrepareSolid/Copy might be 0xffffffff
    or bits up to the depth. This should save some fallback
    case, noticed by Eric.

diff --git a/src/i830_exa.c b/src/i830_exa.c
index 6acc00c..6726a0e 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -134,7 +134,7 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, i
     ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
 
-    if (planemask != (Pixel)~0)
+    if (planemask != (Pixel)~0 && !EXA_PM_IS_SOLID(pPixmap, planemask))
 	return FALSE;
 
     pI830->BR[13] = exaGetPixmapPitch(pPixmap);
@@ -209,7 +209,7 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap,
     ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
 
-    if (planemask != (Pixel)~0)
+    if (planemask != (Pixel)~0 && !EXA_PM_IS_SOLID(pScrPixmap, planemask))
 	return FALSE;
 
     pI830->copy_src_pitch = exaGetPixmapPitch(pSrcPixmap);



More information about the xorg-commit mailing list