summaryrefslogtreecommitdiff
path: root/src/radeon_render.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-02-16 23:27:44 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-02-16 23:27:44 +0000
commit5c141bb15d1163e04c012a0cdf0699d534f0be37 (patch)
tree5c80c7ed3638c3b9d6fec9c3ec13e0e9fd200643 /src/radeon_render.c
parent8c6e5a6eb50d371fd4ec700c26aa628cb5f45731 (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_render.c')
-rw-r--r--src/radeon_render.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c
index 5f29157..0fab39f 100644
--- a/src/radeon_render.c
+++ b/src/radeon_render.c
@@ -315,29 +315,27 @@ static Bool RADEONSetupRenderByteswap(ScrnInfoPtr pScrn, int tex_bytepp)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
+ CARD32 swapper = info->ModeReg.surface_cntl;
+
+ swapper &= ~(RADEON_NONSURF_AP0_SWP_16BPP | RADEON_NONSURF_AP1_SWP_16BPP |
+ RADEON_NONSURF_AP0_SWP_32BPP | RADEON_NONSURF_AP1_SWP_32BPP);
/* Set up byte swapping for the framebuffer aperture as needed */
switch (tex_bytepp) {
case 1:
- OUTREG(RADEON_SURFACE_CNTL, info->ModeReg.surface_cntl &
- ~(RADEON_NONSURF_AP0_SWP_32BPP
- | RADEON_NONSURF_AP0_SWP_16BPP));
break;
case 2:
- OUTREG(RADEON_SURFACE_CNTL, (info->ModeReg.surface_cntl &
- ~RADEON_NONSURF_AP0_SWP_32BPP)
- | RADEON_NONSURF_AP0_SWP_16BPP);
+ swapper |= RADEON_NONSURF_AP0_SWP_16BPP | RADEON_NONSURF_AP1_SWP_16BPP;
break;
case 4:
- OUTREG(RADEON_SURFACE_CNTL, (info->ModeReg.surface_cntl &
- ~RADEON_NONSURF_AP0_SWP_16BPP)
- | RADEON_NONSURF_AP0_SWP_32BPP);
+ swapper |= RADEON_NONSURF_AP0_SWP_32BPP | RADEON_NONSURF_AP1_SWP_32BPP;
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: Don't know what to do for "
"tex_bytepp == %d!\n", __func__, tex_bytepp);
return FALSE;
}
+ OUTREG(RADEON_SURFACE_CNTL, swapper);
return TRUE;
}