diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-02-16 23:27:44 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-02-16 23:27:44 +0000 |
commit | 5c141bb15d1163e04c012a0cdf0699d534f0be37 (patch) | |
tree | 5c80c7ed3638c3b9d6fec9c3ec13e0e9fd200643 /src/radeon_dri.c | |
parent | 8c6e5a6eb50d371fd4ec700c26aa628cb5f45731 (diff) |
Memory map and misc fixes. This completely reworks the way the driver
detects available & accessible video memory and initializes the card
internal memory map. Along the way, I re-ordered some of the stuffs in
pre-init in order to remove some dodgy codepath, fixed various init,
exit and vt switch issues, and overall made the driver more robust. The
full memory map fix requires an updated DRM. The X driver no longer
tries to position the AGP aperture, this becomes entirely DRM
responsibility.
Diffstat (limited to 'src/radeon_dri.c')
-rw-r--r-- | src/radeon_dri.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 6ff0839..755635d 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1456,10 +1456,6 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) version->version_patchlevel); info->allowColorTiling = FALSE; info->tilingEnabled = FALSE; - /* try to fix up already set mode, crt pitch, ddx major (hope that's ok to do here) */ - /* is this correct scrnIndex? flags? */ - RADEONSwitchMode(pScrn->scrnIndex, pScrn->currentMode, 0); - pScrn->AdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); pDRIInfo->ddxDriverMajorVersion = RADEON_VERSION_MAJOR; } drmFreeVersion(version); @@ -1611,6 +1607,8 @@ Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen) info->allowPageFlip = 0; } + info->directRenderingInited = TRUE; + return TRUE; } @@ -1665,7 +1663,9 @@ void RADEONDRICloseScreen(ScreenPtr pScreen) drmRadeonInit drmInfo; RING_LOCALS; - /* Stop the CP */ + RADEONTRACE(("RADEONDRICloseScreen\n")); + + /* Stop the CP */ if (info->directRenderingEnabled) { /* If we've generated any CP commands, we must flush them to the * kernel module now. @@ -1775,6 +1775,9 @@ static void RADEONDRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) int i; RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); + if (!info->directRenderingInited) + return; + /* Don't want to do this when no 3d is active and pages are * right-way-round */ @@ -1784,6 +1787,10 @@ static void RADEONDRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) #ifdef USE_XAA /* XXX: implement for EXA */ /* pretty much a hack. */ + + /* Make sure accel has been properly inited */ + if (info->accel == NULL || info->accel->SetupForScreenToScreenCopy == NULL) + return; if (info->tilingEnabled) info->dst_pitch_offset |= RADEON_DST_TILE_MACRO; (*info->accel->SetupForScreenToScreenCopy)(pScrn, |