The geode hardware (and cimarron) expects cursor memory size to be 48x64,
and cimarron will zero out the excess when a smaller cursor is used.  It
would be nice to be able to use the full cursor size, but xorg's interleaving
stuff requires a cursor width that's a multiple of 32.  Thus, we're stuck
back at 32x32 for cursor size, but we allocate enough memory for a 48x64
cursor.

This fixes misc interleaving corruption that we see with 2bpp cursors (when
converting to ARGB).

Signed-off-by: Andres Salomon <[EMAIL PROTECTED]>
---
 src/geode.h     |   10 ++++++++--
 src/lx_memory.c |    4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/geode.h b/src/geode.h
index 0ba32fe..b8ff455 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -92,8 +92,14 @@
 
 #define DEFAULT_EXA_SCRATCH_BFRSZ 0x40000
 
-#define LX_CURSOR_MAX_WIDTH  48
-#define LX_CURSOR_MAX_HEIGHT 64
+/* the LX hardware (and Cimarron) require a cursor memory size of 48x64.. */
+#define LX_CURSOR_HW_WIDTH 48
+#define LX_CURSOR_HW_HEIGHT 64
+
+/* ...but xorg requires the cursor width to be a multiple of 32.  This is
+the size of the *actual* cursor. */
+#define LX_CURSOR_MAX_WIDTH 32
+#define LX_CURSOR_MAX_HEIGHT 32
 
 /* FIXME: Get rid of this from GX */
 
diff --git a/src/lx_memory.c b/src/lx_memory.c
index 92fa3fb..3f853d4 100644
--- a/src/lx_memory.c
+++ b/src/lx_memory.c
@@ -209,7 +209,7 @@ LXInitOffscreen(ScrnInfoPtr pScrni)
 
     if (pGeode->tryHWCursor) {
        ptr = GeodeAllocOffscreen(pGeode,
-               LX_CURSOR_MAX_WIDTH * 4 * LX_CURSOR_MAX_HEIGHT, 4);
+               LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT, 4);
 
        if (ptr != NULL) {
            pGeode->CursorStartOffset = ptr->offset;
@@ -285,7 +285,7 @@ LXInitOffscreen(ScrnInfoPtr pScrni)
 
     if (pGeode->HWCursor)
        xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Cursor: 0x%x bytes\n",
-           LX_CURSOR_MAX_WIDTH * 4 * LX_CURSOR_MAX_HEIGHT);
+           LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT);
 
     if (pGeode->pExa->offScreenBase)
        xf86DrvMsg(pScrni->scrnIndex, X_INFO, " EXA: 0x%x bytes\n",
-- 
1.5.6.5

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to