aboutsummaryrefslogtreecommitdiffhomepage
path: root/vidix
diff options
context:
space:
mode:
authorGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-08-27 21:20:16 +0000
committerGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-08-27 21:20:16 +0000
commit020f569cc149612f63e58701c743a6c49fa3b063 (patch)
tree76f088362a20d2d138b383dd27270cb54d3979d5 /vidix
parent6379fb900a4070035ed1de4052cd0d92cd7a92da (diff)
Rough but working bigendian support for radeon cards, patch by Luca Barbato <lu_zero at gentoo.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13168 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'vidix')
-rw-r--r--vidix/drivers/radeon_vid.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/vidix/drivers/radeon_vid.c b/vidix/drivers/radeon_vid.c
index eb0849f1f7..db9b77fa7a 100644
--- a/vidix/drivers/radeon_vid.c
+++ b/vidix/drivers/radeon_vid.c
@@ -218,10 +218,16 @@ static uint32_t SAVED_OV0_GRAPHICS_KEY_MSK = 0;
static uint32_t SAVED_OV0_VID_KEY_CLR = 0;
static uint32_t SAVED_OV0_VID_KEY_MSK = 0;
static uint32_t SAVED_OV0_KEY_CNTL = 0;
-#if defined(RAGE128) && (WORDS_BIGENDIAN)
+#ifdef WORDS_BIGENDIAN
static uint32_t SAVED_CONFIG_CNTL = 0;
+#if defined(RAGE128)
#define APER_0_BIG_ENDIAN_16BPP_SWAP (1<<0)
#define APER_0_BIG_ENDIAN_32BPP_SWAP (2<<0)
+#else
+#define RADEON_SURFACE_CNTL 0x0b00
+#define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20)
+#define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21)
+#endif
#endif
#define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ))))
@@ -1172,7 +1178,8 @@ int vixInit( void )
#endif
/* XXX: hack, but it works for me (tm) */
-#if defined(RAGE128) && (WORDS_BIGENDIAN)
+#ifdef WORDS_BIGENDIAN
+#if defined(RAGE128)
/* code from gatos */
{
SAVED_CONFIG_CNTL = INREG(CONFIG_CNTL);
@@ -1182,6 +1189,22 @@ int vixInit( void )
// printf("saved: %x, current: %x\n", SAVED_CONFIG_CNTL,
// INREG(CONFIG_CNTL));
}
+#else
+ /*code from radeon_video.c*/
+ {
+ SAVED_CONFIG_CNTL = INREG(RADEON_SURFACE_CNTL);
+/* OUTREG(RADEON_SURFACE_CNTL, (SAVED_CONFIG_CNTL |
+ RADEON_NONSURF_AP0_SWP_32BPP) & ~RADEON_NONSURF_AP0_SWP_16BPP);
+*/
+ OUTREG(RADEON_SURFACE_CNTL, SAVED_CONFIG_CNTL & ~(RADEON_NONSURF_AP0_SWP_32BPP
+ | RADEON_NONSURF_AP0_SWP_16BPP));
+
+/*
+ OUTREG(RADEON_SURFACE_CNTL, (SAVED_CONFIG_CNTL | RADEON_NONSURF_AP0_SWP_32BPP)
+ & ~RADEON_NONSURF_AP0_SWP_16BPP);
+*/
+ }
+#endif
#endif
if(__verbose > 1) radeon_vid_dump_regs();
@@ -1199,10 +1222,14 @@ void vixDestroy( void )
OUTREG(OV0_KEY_CNTL, SAVED_OV0_KEY_CNTL);
printf(RADEON_MSG" Restored overlay colorkey settings\n");
-#if defined(RAGE128) && (WORDS_BIGENDIAN)
+#ifdef WORDS_BIGENDIAN
+#if defined(RAGE128)
OUTREG(CONFIG_CNTL, SAVED_CONFIG_CNTL);
// printf("saved: %x, restored: %x\n", SAVED_CONFIG_CNTL,
// INREG(CONFIG_CNTL));
+#else
+ OUTREG(RADEON_SURFACE_CNTL, SAVED_CONFIG_CNTL);
+#endif
#endif
unmap_phys_mem(radeon_mem_base,radeon_ram_size);