diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-02-26 10:01:32 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-02-26 10:01:32 +0000 |
commit | 1574b41a0f894f9b6e30d3ee94e596695a4c64f0 (patch) | |
tree | 58cfbe51f9472948fee175b43481011874c19ac9 | |
parent | 1f43a584a684af8078631425886cce236500e0e6 (diff) |
Fix page flipping with XAA. The new code ended up calling ShadowFBInit()
before XAAInit(), which breaks ShadowFB.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_dri.c | 28 | ||||
-rw-r--r-- | src/radeon_driver.c | 9 |
4 files changed, 39 insertions, 8 deletions
@@ -1,3 +1,12 @@ +2006-02-26 Benjamin Herrenschmidt <benh@kernel.crashing.org> + + * src/radeon.h: + * src/radeon_dri.c: (RADEONDRIFinishScreenInit), + (RADEONDRIInitPageFlip): + * src/radeon_driver.c: (RADEONScreenInit): + Fix page flipping with XAA. The new code ended up calling + ShadowFBInit() before XAAInit(), which breaks ShadowFB. + 2006-02-24 Roland Scheidegger <rscheidegger_lists@hispeed.ch> * src/radeon.h: * src/radeon_chipset.h: diff --git a/src/radeon.h b/src/radeon.h index 3c3ec63b..cd3eed9b 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -782,6 +782,7 @@ extern void RADEONDRICloseScreen(ScreenPtr pScreen); extern void RADEONDRIResume(ScreenPtr pScreen); extern Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen); extern void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen); +extern void RADEONDRIInitPageFlip(ScreenPtr pScreen); extern drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn); extern void RADEONCPFlushIndirect(ScrnInfoPtr pScrn, int discard); diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 755635d2..544bca24 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1600,18 +1600,32 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen) pRADEONDRI->perctx_sarea_size = info->perctx_sarea_size; #endif - /* Have shadowfb run only while there is 3d active. */ - if (!info->useEXA && info->allowPageFlip /* && info->drmMinor >= 3 */) { - ShadowFBInit( pScreen, RADEONDRIRefreshArea ); - } else { - info->allowPageFlip = 0; - } - info->directRenderingInited = TRUE; return TRUE; } +void RADEONDRIInitPageFlip(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); + + /* Have shadowfb run only while there is 3d active. This must happen late, + * after XAAInit has been called + */ + if (!info->useEXA /* && info->drmMinor >= 3 */) { + if (!ShadowFBInit( pScreen, RADEONDRIRefreshArea )) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "ShadowFB init failed, Page Flipping disabled\n"); + info->allowPageFlip = 0; + } else + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "ShadowFB initialized for Page Flipping\n"); + } else { + info->allowPageFlip = 0; + } +} + /** * This function will attempt to get the Radeon hardware back into shape * after a resume from disc. diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 1cbf3ac5..d3c98fb7 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.117 2004/02/19 22:38:12 tsi Exp $ */ -/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.86 2006/02/16 23:27:44 benh Exp $ */ +/* $XdotOrg: driver/xf86-video-ati/src/radeon_driver.c,v 1.87 2006/02/25 01:57:05 sroland Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -5832,6 +5832,13 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, info->accelOn = FALSE; } + + /* Init page flipping if enabled now */ + if (info->allowPageFlip) { + RADEONTRACE(("Initializing Page Flipping\n")); + RADEONDRIInitPageFlip(pScreen); + } + /* Init DPMS */ RADEONTRACE(("Initializing DPMS\n")); xf86DPMSInit(pScreen, RADEONDisplayPowerManagementSet, 0); |