xf86-video-ati: Branch 'master' - 5 commits

Michel Daenzer daenzer at kemper.freedesktop.org
Mon Jul 3 02:24:21 EEST 2006


 src/radeon.h           |   73 ++++++++++++++++++++++++++++++++++++++++++++++---
 src/radeon_accel.c     |    2 +
 src/radeon_cursor.c    |   65 -------------------------------------------
 src/radeon_dga.c       |    6 ++--
 src/radeon_dri.c       |   25 +++++++++++++---
 src/radeon_driver.c    |   70 +---------------------------------------------
 src/radeon_exa.c       |   50 +++++++++++++++++++++++----------
 src/radeon_exa_funcs.c |    2 +
 src/radeon_mergedfb.c  |   18 +-----------
 9 files changed, 137 insertions(+), 174 deletions(-)

New commits:
diff-tree 920ac1f56fad6f48a30e65836ce054815f270738 (from dd0dd4bab76907b4b1b6d814f24e73e57d71f587)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Mon Jul 3 01:21:18 2006 +0200

    Do even less cache flushing when the previous engine mode is known.
    
    OTOH, flush everything when the previous engine mode is unknown, and mark the
    engine mode as unknown in a couple more cases.

diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 62a310d..b1dae42 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -431,6 +431,10 @@ static void RADEONLeaveServer(ScreenPtr 
 
 	info->CPInUse = FALSE;
     }
+
+#ifdef USE_EXA
+    info->engineMode = EXA_ENGINEMODE_UNKNOWN;
+#endif
 }
 
 /* Contexts can be swapped by the X server if necessary.  This callback
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 0e6ff91..ea2f9b2 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -293,25 +293,34 @@ static void RADEONFinishAccess(PixmapPtr
 
 #define RADEON_SWITCH_TO_2D()						\
 do {									\
-        /*if (info->engineMode == EXA_ENGINEMODE_2D)*/                      \
-            /*break;*/                                                      \
 	BEGIN_ACCEL(1);							\
-	OUT_ACCEL_REG(RADEON_WAIT_UNTIL,				\
-		RADEON_WAIT_HOST_IDLECLEAN |				\
-		RADEON_WAIT_3D_IDLECLEAN);				\
+	CARD32 wait_until = 0;			\
+	switch (info->engineMode) {					\
+	case EXA_ENGINEMODE_UNKNOWN:					\
+	    wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_2D_IDLECLEAN;	\
+	case EXA_ENGINEMODE_3D:						\
+	    wait_until |= RADEON_WAIT_3D_IDLECLEAN;			\
+	case EXA_ENGINEMODE_2D:						\
+	    break;							\
+	}								\
+	OUT_ACCEL_REG(RADEON_WAIT_UNTIL, wait_until);			\
 	FINISH_ACCEL();							\
         info->engineMode = EXA_ENGINEMODE_2D;                           \
 } while (0);
 
 #define RADEON_SWITCH_TO_3D()						\
 do {									\
-        /*if (info->engineMode == EXA_ENGINEMODE_3D)*/                      \
-            /*break;*/                                                      \
 	BEGIN_ACCEL(1);							\
-	OUT_ACCEL_REG(RADEON_WAIT_UNTIL,				\
-		RADEON_WAIT_HOST_IDLECLEAN |				\
-		RADEON_WAIT_2D_IDLECLEAN |				\
-		RADEON_WAIT_3D_IDLECLEAN);				\
+	CARD32 wait_until = 0;			\
+	switch (info->engineMode) {					\
+	case EXA_ENGINEMODE_UNKNOWN:					\
+	    wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN;	\
+	case EXA_ENGINEMODE_2D:						\
+	    wait_until |= RADEON_WAIT_2D_IDLECLEAN;			\
+	case EXA_ENGINEMODE_3D:						\
+	    break;							\
+	}								\
+	OUT_ACCEL_REG(RADEON_WAIT_UNTIL, wait_until);			\
 	FINISH_ACCEL();							\
         info->engineMode = EXA_ENGINEMODE_3D;                           \
 } while (0);
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index a86e148..c0bdf6e 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -65,6 +65,8 @@ FUNC_NAME(RADEONSync)(ScreenPtr pScreen,
     TRACE;
 
     FUNC_NAME(RADEONWaitForIdle)(xf86Screens[pScreen->myNum]);
+
+    RADEONPTR(xf86Screens[pScreen->myNum])->engineMode = EXA_ENGINEMODE_UNKNOWN;
 }
 
 static Bool
diff-tree dd0dd4bab76907b4b1b6d814f24e73e57d71f587 (from 22f165f290f57e638d198f24a37f62fc16b72bae)
Author: Eric Anholt <anholt at freebsd.org>
Date:   Mon Jul 3 01:10:10 2006 +0200

    Bug #6762: Remove gratuitous cache flushing.

diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 0d72005..0e6ff91 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -295,8 +295,7 @@ static void RADEONFinishAccess(PixmapPtr
 do {									\
         /*if (info->engineMode == EXA_ENGINEMODE_2D)*/                      \
             /*break;*/                                                      \
-	BEGIN_ACCEL(2);							\
-	OUT_ACCEL_REG(RADEON_RB2D_DSTCACHE_CTLSTAT,  RADEON_RB2D_DC_FLUSH); \
+	BEGIN_ACCEL(1);							\
 	OUT_ACCEL_REG(RADEON_WAIT_UNTIL,				\
 		RADEON_WAIT_HOST_IDLECLEAN |				\
 		RADEON_WAIT_3D_IDLECLEAN);				\
@@ -308,8 +307,7 @@ do {									\
 do {									\
         /*if (info->engineMode == EXA_ENGINEMODE_3D)*/                      \
             /*break;*/                                                      \
-	BEGIN_ACCEL(2);							\
-	OUT_ACCEL_REG(RADEON_RB2D_DSTCACHE_CTLSTAT,  RADEON_RB2D_DC_FLUSH); \
+	BEGIN_ACCEL(1);							\
 	OUT_ACCEL_REG(RADEON_WAIT_UNTIL,				\
 		RADEON_WAIT_HOST_IDLECLEAN |				\
 		RADEON_WAIT_2D_IDLECLEAN |				\
diff-tree 22f165f290f57e638d198f24a37f62fc16b72bae (from ea5105230c7c3519730b8d3c250e9ba9a4e4374a)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Mon Jul 3 00:39:45 2006 +0200

    Build and warning fixes for !defined(USE_XAA).

diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index b18b6d4..6309771 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -96,6 +96,7 @@
 #include "xf86.h"
 
 
+#ifdef USE_XAA
 static struct {
     int rop;
     int pattern;
@@ -117,6 +118,7 @@ static struct {
     { RADEON_ROP3_DSan, RADEON_ROP3_DPan }, /* GXnand         */
     { RADEON_ROP3_ONE,  RADEON_ROP3_ONE  }  /* GXset          */
 };
+#endif
 
 /* The FIFO has 64 slots.  This routines waits until at least `entries'
  * of these slots are empty.
diff --git a/src/radeon_dga.c b/src/radeon_dga.c
index e67a964..f084fd3 100644
--- a/src/radeon_dga.c
+++ b/src/radeon_dga.c
@@ -61,9 +61,9 @@ static Bool RADEON_OpenFramebuffer(ScrnI
 static Bool RADEON_SetMode(ScrnInfoPtr, DGAModePtr);
 static int  RADEON_GetViewport(ScrnInfoPtr);
 static void RADEON_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef USE_XAA
 static void RADEON_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
 static void RADEON_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
-#ifdef USE_XAA
 static void RADEON_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
 				 unsigned long);
 #endif
@@ -363,6 +363,8 @@ static void RADEON_SetViewport(ScrnInfoP
 }
 
 
+#ifdef USE_XAA
+
 static void RADEON_FillRect(ScrnInfoPtr pScrn,
 			    int x, int y, int w, int h,
 			    unsigned long color)
@@ -422,7 +424,6 @@ static void RADEON_BlitRect(ScrnInfoPtr 
 #endif /* USE_XAA */
 }
 
-#ifdef USE_XAA
 static void RADEON_BlitTransRect(ScrnInfoPtr pScrn,
 				 int srcx, int srcy, int w, int h,
 				 int dstx, int dsty, unsigned long color)
@@ -443,6 +444,7 @@ static void RADEON_BlitTransRect(ScrnInf
     if (pScrn->bitsPerPixel == info->CurrentLayout.bitsPerPixel)
         RADEON_MARK_SYNC(info, pScrn);
 }
+
 #endif /* USE_XAA */
 
 static Bool RADEON_OpenFramebuffer(ScrnInfoPtr pScrn,
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 8e159d2..62a310d 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -71,7 +71,9 @@ static void RADEONDRITransitionTo3d(Scre
 static void RADEONDRITransitionMultiToSingle3d(ScreenPtr pScreen);
 static void RADEONDRITransitionSingleToMulti3d(ScreenPtr pScreen);
 
+#ifdef USE_XAA
 static void RADEONDRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
+#endif
 
 /* Initialize the visual configs that are supported by the hardware.
  * These are combined with the visual configs that the indirect
@@ -453,6 +455,8 @@ static void RADEONDRISwapContext(ScreenP
     }
 }
 
+#ifdef USE_XAA
+
 /* The Radeon has depth tiling on all the time. Rely on surface regs to
  * translate the addresses (only works if allowColorTiling is true).
  */
@@ -513,6 +517,8 @@ static void RADEONScreenToScreenCopyDept
     }
 }
 
+#endif /* USE_XAA */
+
 /* Initialize the state of the back and depth buffers */
 static void RADEONDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
 {
@@ -1625,6 +1631,7 @@ void RADEONDRIInitPageFlip(ScreenPtr pSc
     ScrnInfoPtr         pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr       info  = RADEONPTR(pScrn);
 
+#ifdef USE_XAA
    /* Have shadowfb run only while there is 3d active. This must happen late,
      * after XAAInit has been called 
      */
@@ -1636,7 +1643,9 @@ void RADEONDRIInitPageFlip(ScreenPtr pSc
 	} else
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		       "ShadowFB initialized for Page Flipping\n");
-    } else {
+    } else
+#endif /* USE_XAA */
+    {
        info->allowPageFlip = 0;
     }
 }
@@ -1791,6 +1800,8 @@ void RADEONDRICloseScreen(ScreenPtr pScr
     }
 }
 
+#ifdef USE_XAA
+
 /* Use callbacks from dri.c to support pageflipping mode for a single
  * 3d context without need for any specific full-screen extension.
  *
@@ -1826,7 +1837,6 @@ static void RADEONDRIRefreshArea(ScrnInf
     if (!pSAREAPriv->pfAllowPageFlip && pSAREAPriv->pfCurrentPage == 0)
 	return;
 
-#ifdef USE_XAA
     /* XXX: implement for EXA */
     /* pretty much a hack. */
 
@@ -1852,16 +1862,17 @@ static void RADEONDRIRefreshArea(ScrnInf
 	}
     }
     info->dst_pitch_offset &= ~RADEON_DST_TILE_MACRO;
-#endif /* USE_XAA */
 }
 
+#endif /* USE_XAA */
+
 static void RADEONEnablePageFlip(ScreenPtr pScreen)
 {
+#ifdef USE_XAA
     ScrnInfoPtr         pScrn      = xf86Screens[pScreen->myNum];
     RADEONInfoPtr       info       = RADEONPTR(pScrn);
     RADEONSAREAPrivPtr  pSAREAPriv = DRIGetSAREAPrivate(pScreen);
 
-#ifdef USE_XAA
     /* XXX: Fix in EXA case */
     if (info->allowPageFlip) {
         /* pretty much a hack. */
@@ -1912,10 +1923,10 @@ static void RADEONDRITransitionTo3d(Scre
 {
     ScrnInfoPtr    pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr  info  = RADEONPTR(pScrn);
+#ifdef USE_XAA
     FBAreaPtr      fbarea;
     int            width, height;
 
-#ifdef USE_XAA
     /* EXA allocates these areas up front, so it doesn't do the following
      * stuff.
      */
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 85c5c77..645f9ff 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5650,7 +5650,9 @@ _X_EXPORT Bool RADEONScreenInit(int scrn
 		 pScrn->memPhysBase, pScrn->fbOffset));
 
     info->accelOn      = FALSE;
+#ifdef USE_XAA
     info->accel        = NULL;
+#endif
     pScrn->fbOffset    = 0;
     if (info->IsSecondary) pScrn->fbOffset = pScrn->videoRam * 1024;
     if (!RADEONMapMem(pScrn)) return FALSE;
diff-tree ea5105230c7c3519730b8d3c250e9ba9a4e4374a (from 66586f905857ea5bf37cb5d34949cd450a9ed067)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Mon Jul 3 00:03:22 2006 +0200

    Reserve HW cursor memory statically instead of from EXA offscreen.
    
    As a result, quite a bit of code can be removed that attempted to deal with the
    EXA offscreen memory disappearing, with varying success. Because the HW cursor
    memory is now always immediately after the front buffer and before the back
    buffer, this also fixes bug #6808.
    
    As the HW cursor memory is now reserved statically with EXA and XAA, change
    RADEONUseHWCursor() to check info->cursor instead of info->cursor_offset, for
    which 0 might become valid with HW cursor enabled in the future.
    
    Change info->cursor_offset from unsigned long to CARD32 as the corresponding
    register is 32 bits wide, and to avoid issues with printf.

diff --git a/src/radeon.h b/src/radeon.h
index 7368308..6402e48 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -79,6 +79,74 @@
 #include "picturestr.h"
 #endif
 
+typedef enum {
+    OPTION_NOACCEL,
+    OPTION_SW_CURSOR,
+    OPTION_DAC_6BIT,
+    OPTION_DAC_8BIT,
+#ifdef XF86DRI
+    OPTION_BUS_TYPE,
+    OPTION_CP_PIO,
+    OPTION_USEC_TIMEOUT,
+    OPTION_AGP_MODE,
+    OPTION_AGP_FW,
+    OPTION_GART_SIZE,
+    OPTION_GART_SIZE_OLD,
+    OPTION_RING_SIZE,
+    OPTION_BUFFER_SIZE,
+    OPTION_DEPTH_MOVE,
+    OPTION_PAGE_FLIP,
+    OPTION_NO_BACKBUFFER,
+    OPTION_XV_DMA,
+    OPTION_FBTEX_PERCENT,
+    OPTION_DEPTH_BITS,
+#ifdef USE_EXA
+    OPTION_ACCEL_DFS,
+#endif
+#endif
+    OPTION_PANEL_OFF,
+    OPTION_DDC_MODE,
+    OPTION_MONITOR_LAYOUT,
+    OPTION_IGNORE_EDID,
+    OPTION_FBDEV,
+    OPTION_MERGEDFB,
+    OPTION_CRT2HSYNC,
+    OPTION_CRT2VREFRESH,
+    OPTION_CRT2POS,
+    OPTION_METAMODES,
+    OPTION_MERGEDDPI,
+    OPTION_RADEONXINERAMA,
+    OPTION_CRT2ISSCRN0,
+    OPTION_MERGEDFBNONRECT,
+    OPTION_MERGEDFBMOUSER,
+    OPTION_DISP_PRIORITY,
+    OPTION_PANEL_SIZE,
+    OPTION_MIN_DOTCLOCK,
+    OPTION_COLOR_TILING,
+#ifdef XvExtension
+    OPTION_VIDEO_KEY,
+    OPTION_RAGE_THEATRE_CRYSTAL,
+    OPTION_RAGE_THEATRE_TUNER_PORT,
+    OPTION_RAGE_THEATRE_COMPOSITE_PORT,
+    OPTION_RAGE_THEATRE_SVIDEO_PORT,
+    OPTION_TUNER_TYPE,
+    OPTION_RAGE_THEATRE_MICROC_PATH,
+    OPTION_RAGE_THEATRE_MICROC_TYPE,
+#endif
+#ifdef RENDER
+    OPTION_RENDER_ACCEL,
+    OPTION_SUBPIXEL_ORDER,
+#endif
+    OPTION_SHOWCACHE,
+    OPTION_DYNAMIC_CLOCKS,
+    OPTION_BIOS_HOTKEYS,
+    OPTION_VGA_ACCESS,
+    OPTION_REVERSE_DDC,
+    OPTION_LVDS_PROBE_PLL,
+    OPTION_ACCELMETHOD,
+    OPTION_CONSTANTDPI
+} RADEONOpts;
+
 /* ------- mergedfb support ------------- */
 		/* Psuedo Xinerama support */
 #define NEED_REPLIES  		/* ? */
@@ -426,10 +494,7 @@ typedef struct {
 #endif
     Bool              accelOn;
     xf86CursorInfoPtr cursor;
-#ifdef USE_EXA
-    ExaOffscreenArea   *cursorArea;
-#endif
-    unsigned long     cursor_offset;
+    CARD32            cursor_offset;
 #ifdef USE_XAA
     unsigned long     cursor_end;
 #endif
diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index d7a3891..0154c30 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -106,45 +106,6 @@ static CARD32 mono_cursor_color[] = {
 #endif
 
 
-#ifdef USE_EXA
-static void
-RADEONCursorSave(ScreenPtr pScreen, ExaOffscreenArea *area)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-
-    info->cursorArea = NULL;
-    info->cursor_offset = 0;
-}
-
-static void
-RADEONCursorAllocEXA(ScreenPtr pScreen)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-
-    info->cursorArea = exaOffscreenAlloc(pScreen,
-					 CURSOR_WIDTH * 4 * CURSOR_HEIGHT,
-					 128, TRUE, RADEONCursorSave, info);
-
-    if (!info->cursorArea) {
-	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		   "Hardware cursor temporarily disabled"
-		   " due to insufficient offscreen memory\n");
-	info->cursor_offset = 0;
-    } else {
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "Using hardware cursor\n");
-        info->cursor_offset = info->cursorArea->offset;
-
-	RADEONCTRACE(("%s (0x%08x-0x%08x)\n", __func__,
-		      info->cursor_offset,
-		      info->cursor_offset + info->cursorArea->size));
-    }
-}
-#endif
-
-
 /* Set cursor foreground and background colors */
 static void RADEONSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
 {
@@ -155,9 +116,6 @@ static void RADEONSetCursorColors(ScrnIn
 
     RADEONCTRACE(("RADEONSetCursorColors\n"));
 
-    if (info->cursor_offset == 0)
-	return;
-
 #ifdef ARGB_CURSOR
     /* Don't recolour cursors set with SetCursorARGB. */
     if (info->cursor_argb)
@@ -200,9 +158,6 @@ static void RADEONSetCursorPosition(Scrn
     int                total_y    = pScrn->frameY1 - pScrn->frameY0;
     int		       stride     = 256;
 
-    if (info->cursor_offset == 0)
-	return;
-
     if(info->MergedFB) {
        RADEONCTRACE(("RADEONSetCursorPositionMerged\n"));
        RADEONSetCursorPositionMerged(pScrn, x, y);
@@ -255,9 +210,6 @@ static void RADEONLoadCursorImage(ScrnIn
     CARD8	   chunk;
     CARD32         i, j;
 
-    if (info->cursor_offset == 0)
-	return;
-
     RADEONCTRACE(("RADEONLoadCursorImage (at %x)\n", info->cursor_offset));
 
     if (!info->IsSecondary) {
@@ -342,14 +294,7 @@ static Bool RADEONUseHWCursor(ScreenPtr 
     ScrnInfoPtr    pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr  info  = RADEONPTR(pScrn);
 
- #ifdef USE_EXA
-    if (!info->cursor_offset && info->useEXA && info->cursor)
-    {
-	RADEONCursorAllocEXA(pScreen);
-    }
-#endif
-
-    return info->cursor_offset ? TRUE : FALSE;
+    return info->cursor ? TRUE : FALSE;
 }
 
 #ifdef ARGB_CURSOR
@@ -376,9 +321,6 @@ static void RADEONLoadCursorARGB (ScrnIn
 
     RADEONCTRACE(("RADEONLoadCursorARGB\n"));
 
-    if (info->cursor_offset == 0)
-	return;
-
     if (!info->IsSecondary) {
 	save1 = INREG(RADEON_CRTC_GEN_CNTL) & ~(CARD32) (3 << 20);
 	save1 |= (CARD32) (2 << 20);
@@ -474,11 +416,6 @@ Bool RADEONCursorInit(ScreenPtr pScreen)
     width_bytes		      = width * (pScrn->bitsPerPixel / 8);
     height                    = (size_bytes + width_bytes - 1) / width_bytes;
 
-#ifdef USE_EXA
-    if (info->useEXA) {
-	RADEONCursorAllocEXA(pScreen);
-    }
-#endif /* USE_EXA */
 #ifdef USE_XAA
     if (!info->useEXA) {
 	FBAreaPtr          fbarea;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index a3aae4b..85c5c77 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -145,74 +145,6 @@ static void RADEONAdjustMemMapRegisters(
 
 extern Bool 		RADEONnoPanoramiXExtension;
 
-typedef enum {
-    OPTION_NOACCEL,
-    OPTION_SW_CURSOR,
-    OPTION_DAC_6BIT,
-    OPTION_DAC_8BIT,
-#ifdef XF86DRI
-    OPTION_BUS_TYPE,
-    OPTION_CP_PIO,
-    OPTION_USEC_TIMEOUT,
-    OPTION_AGP_MODE,
-    OPTION_AGP_FW,
-    OPTION_GART_SIZE,
-    OPTION_GART_SIZE_OLD,
-    OPTION_RING_SIZE,
-    OPTION_BUFFER_SIZE,
-    OPTION_DEPTH_MOVE,
-    OPTION_PAGE_FLIP,
-    OPTION_NO_BACKBUFFER,
-    OPTION_XV_DMA,
-    OPTION_FBTEX_PERCENT,
-    OPTION_DEPTH_BITS,
-#ifdef USE_EXA
-    OPTION_ACCEL_DFS,
-#endif
-#endif
-    OPTION_PANEL_OFF,
-    OPTION_DDC_MODE,
-    OPTION_MONITOR_LAYOUT,
-    OPTION_IGNORE_EDID,
-    OPTION_FBDEV,
-    OPTION_MERGEDFB,
-    OPTION_CRT2HSYNC,
-    OPTION_CRT2VREFRESH,
-    OPTION_CRT2POS,
-    OPTION_METAMODES,
-    OPTION_MERGEDDPI,
-    OPTION_RADEONXINERAMA,
-    OPTION_CRT2ISSCRN0,
-    OPTION_MERGEDFBNONRECT,
-    OPTION_MERGEDFBMOUSER,
-    OPTION_DISP_PRIORITY,
-    OPTION_PANEL_SIZE,
-    OPTION_MIN_DOTCLOCK,
-    OPTION_COLOR_TILING,
-#ifdef XvExtension
-    OPTION_VIDEO_KEY,
-    OPTION_RAGE_THEATRE_CRYSTAL,
-    OPTION_RAGE_THEATRE_TUNER_PORT,
-    OPTION_RAGE_THEATRE_COMPOSITE_PORT,
-    OPTION_RAGE_THEATRE_SVIDEO_PORT,
-    OPTION_TUNER_TYPE,
-    OPTION_RAGE_THEATRE_MICROC_PATH,
-    OPTION_RAGE_THEATRE_MICROC_TYPE,
-#endif
-#ifdef RENDER
-    OPTION_RENDER_ACCEL,
-    OPTION_SUBPIXEL_ORDER,
-#endif
-    OPTION_SHOWCACHE,
-    OPTION_DYNAMIC_CLOCKS,
-    OPTION_BIOS_HOTKEYS,
-    OPTION_VGA_ACCESS,
-    OPTION_REVERSE_DDC,
-    OPTION_LVDS_PROBE_PLL,
-    OPTION_ACCELMETHOD,
-    OPTION_CONSTANTDPI
-} RADEONOpts;
-
 static const OptionInfoRec RADEONOptions[] = {
     { OPTION_NOACCEL,        "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_SW_CURSOR,      "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 5bbce87..0d72005 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -398,6 +398,19 @@ Bool RADEONSetupMemEXA (ScreenPtr pScree
 	       "Will use %d kb for front buffer at offset 0x%08x\n",
 	       screen_size / 1024, 0);
 
+    /* Reserve static area for hardware cursor */
+    if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
+	int cursor_size = 64 * 4 * 64;
+
+	info->cursor_offset = info->exa->offScreenBase;
+
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+		   "Will use %d kb for hardware cursor at offset 0x%08x\n",
+		   cursor_size / 1024, (unsigned int)info->cursor_offset);
+
+	info->exa->offScreenBase += cursor_size;
+    }
+
 #if defined(XF86DRI)
     if (info->directRenderingEnabled) {
 	int depthCpp = (info->depthBits - 8) / 4, l, next, depth_size;
diff-tree 66586f905857ea5bf37cb5d34949cd450a9ed067 (from 1159c85861dc507ebf323aca82e32fcc67726420)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Sun Jul 2 23:38:20 2006 +0200

    Clean up some redundant code.

diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c
index bbedac9..313dda2 100644
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -2024,14 +2024,7 @@ RADEONSetCursorPositionMerged(ScrnInfoPt
     OUTREG(RADEON_CUR_HORZ_VERT_POSN, (RADEON_CUR_LOCK
 				   | ((xorigin ? 0 : x1) << 16)
 				   | (yorigin ? 0 : y1)));
-#ifdef USE_EXA
-    if (info->useEXA)
-	OUTREG(RADEON_CUR_OFFSET, info->cursor_offset + yorigin * stride);
-#endif /* USE_EXA */
-#ifdef USE_XAA
-    if (!info->useEXA)
-	OUTREG(RADEON_CUR_OFFSET, info->cursor_offset + yorigin * stride);
-#endif /* USE_XAA */
+    OUTREG(RADEON_CUR_OFFSET, info->cursor_offset + yorigin * stride);
 		/* cursor2 */
     OUTREG(RADEON_CUR2_HORZ_VERT_OFF,  (RADEON_CUR2_LOCK
 				    | (xorigin << 16)
@@ -2039,14 +2032,7 @@ RADEONSetCursorPositionMerged(ScrnInfoPt
     OUTREG(RADEON_CUR2_HORZ_VERT_POSN, (RADEON_CUR2_LOCK
 				    | ((xorigin ? 0 : x2) << 16)
 				    | (yorigin ? 0 : y2)));
-#ifdef USE_EXA
-    if (info->useEXA)
-	OUTREG(RADEON_CUR2_OFFSET, info->cursor_offset + yorigin * stride);
-#endif /* USE_EXA */
-#ifdef USE_XAA
-    if (!info->useEXA)
-	OUTREG(RADEON_CUR2_OFFSET, info->cursor_offset + yorigin * stride);
-#endif /* USE_XAA */
+    OUTREG(RADEON_CUR2_OFFSET, info->cursor_offset + yorigin * stride);
 }
 
 /* radeon Xv helpers */



More information about the xorg-commit mailing list