summaryrefslogtreecommitdiff
path: root/src/radeon_video.c
diff options
context:
space:
mode:
authorMichel Daenzer <michel@daenzer.net>2004-08-04 13:17:31 +0000
committerMichel Daenzer <michel@daenzer.net>2004-08-04 13:17:31 +0000
commit27ef7adf3c1f6c3ca79b42b468d08b8542348cdd (patch)
tree07d1fadd8e56bc49416ca6f83fc4b781c2e3cae3 /src/radeon_video.c
parent2efdc9f847fa9ff3096667b16df84817fc65605d (diff)
Use info->ModeReg.surface_cntl to restore byte swapping for the framebuffer
aperture on big endian machines, remove superfluous local variables and register reads. Adapt framebuffer aperture byte swapping to texture format before copying data to offscreen area and restore it afterwards on big endian machines, fixes Render acceleration there. reviewed by: Hui Yu <hyu@ati.com>, Kevin E. Martin <kem@freedesktop.org>
Diffstat (limited to 'src/radeon_video.c')
-rw-r--r--src/radeon_video.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 761fd5b1..548b6084 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -1503,10 +1503,6 @@ RADEONPutImage(
CARD32 tmp;
#if X_BYTE_ORDER == X_BIG_ENDIAN
unsigned char *RADEONMMIO = info->MMIO;
- CARD32 surface_cntl = INREG(RADEON_SURFACE_CNTL);
-
- OUTREG(RADEON_SURFACE_CNTL, (surface_cntl |
- RADEON_NONSURF_AP0_SWP_32BPP) & ~RADEON_NONSURF_AP0_SWP_16BPP);
#endif
/*
@@ -1613,7 +1609,8 @@ RADEONPutImage(
}
nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
#if X_BYTE_ORDER == X_BIG_ENDIAN
- OUTREG(RADEON_SURFACE_CNTL, (surface_cntl | RADEON_NONSURF_AP0_SWP_32BPP)
+ OUTREG(RADEON_SURFACE_CNTL, (info->ModeReg.surface_cntl |
+ RADEON_NONSURF_AP0_SWP_32BPP)
& ~RADEON_NONSURF_AP0_SWP_16BPP);
#endif
RADEONCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
@@ -1628,8 +1625,9 @@ RADEONPutImage(
nlines = ((yb + 0xffff) >> 16) - top;
dst_start += left;
#if X_BYTE_ORDER == X_BIG_ENDIAN
- OUTREG(RADEON_SURFACE_CNTL, surface_cntl & ~(RADEON_NONSURF_AP0_SWP_32BPP
- | RADEON_NONSURF_AP0_SWP_16BPP));
+ OUTREG(RADEON_SURFACE_CNTL, info->ModeReg.surface_cntl &
+ ~(RADEON_NONSURF_AP0_SWP_32BPP
+ | RADEON_NONSURF_AP0_SWP_16BPP));
#endif
RADEONCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
break;
@@ -1637,7 +1635,7 @@ RADEONPutImage(
#if X_BYTE_ORDER == X_BIG_ENDIAN
/* restore byte swapping */
- OUTREG(RADEON_SURFACE_CNTL, surface_cntl);
+ OUTREG(RADEON_SURFACE_CNTL, info->ModeReg.surface_cntl);
#endif
/* update cliplist */