[Mplayer-cvslog] CVS: main/vidix/drivers radeon_vid.c,1.67,1.68

Alex Beregszaszi alex at mplayerhq.hu
Mon Jan 20 19:25:58 CET 2003


Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var/tmp.root/cvs-serv19973

Modified Files:
	radeon_vid.c 
Log Message:
hack to get rage128 working on ppc-g3

Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/radeon_vid.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- radeon_vid.c	13 Jan 2003 10:21:22 -0000	1.67
+++ radeon_vid.c	20 Jan 2003 18:25:41 -0000	1.68
@@ -194,7 +194,8 @@
   DECLARE_VREG(IDCT_LEVELS),
   DECLARE_VREG(IDCT_AUTH_CONTROL),
   DECLARE_VREG(IDCT_AUTH),
-  DECLARE_VREG(IDCT_CONTROL)
+  DECLARE_VREG(IDCT_CONTROL),
+  DECLARE_VREG(CONFIG_CNTL)
 };
 
 static void * radeon_mmio_base = 0;
@@ -207,6 +208,11 @@
 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)
+static uint32_t SAVED_CONFIG_CNTL = 0;
+#define APER_0_BIG_ENDIAN_16BPP_SWAP (1<<0)
+#define APER_0_BIG_ENDIAN_32BPP_SWAP (2<<0)
+#endif
 
 #define GETREG(TYPE,PTR,OFFZ)		(*((volatile TYPE*)((PTR)+(OFFZ))))
 #define SETREG(TYPE,PTR,OFFZ,VAL)	(*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
@@ -426,10 +432,10 @@
 				  (pitch64 << 22));
 
     radeon_fifo_wait(1);
-//#if defined(__BIG_ENDIAN)
 #if defined(WORDS_BIGENDIAN)
-    OUTREGP(DP_DATATYPE,
-	    HOST_BIG_ENDIAN_EN, ~HOST_BIG_ENDIAN_EN);
+#ifdef RADEON
+    OUTREGP(DP_DATATYPE, HOST_BIG_ENDIAN_EN, ~HOST_BIG_ENDIAN_EN);
+#endif
 #else
     OUTREGP(DP_DATATYPE, 0, ~HOST_BIG_ENDIAN_EN);
 #endif
@@ -1060,6 +1066,19 @@
     }
 #endif
 
+/* XXX: hack, but it works for me (tm) */
+#if defined(RAGE128) && (WORDS_BIGENDIAN)
+    /* code from gatos */
+    {
+	SAVED_CONFIG_CNTL = INREG(CONFIG_CNTL);
+	OUTREG(CONFIG_CNTL, SAVED_CONFIG_CNTL &
+	    ~(APER_0_BIG_ENDIAN_16BPP_SWAP|APER_0_BIG_ENDIAN_32BPP_SWAP));
+	    
+//	printf("saved: %x, current: %x\n", SAVED_CONFIG_CNTL,
+//	    INREG(CONFIG_CNTL));
+    }
+#endif
+
   if(__verbose > 1) radeon_vid_dump_regs();
   return 0;  
 }
@@ -1074,6 +1093,12 @@
   OUTREG(OV0_VID_KEY_MSK, SAVED_OV0_VID_KEY_MSK);
   OUTREG(OV0_KEY_CNTL, SAVED_OV0_KEY_CNTL);
   printf(RADEON_MSG" Restored overlay colorkey settings\n");
+
+#if defined(RAGE128) && (WORDS_BIGENDIAN)
+    OUTREG(CONFIG_CNTL, SAVED_CONFIG_CNTL);
+//    printf("saved: %x, restored: %x\n", SAVED_CONFIG_CNTL,
+//	INREG(CONFIG_CNTL));
+#endif
 
   unmap_phys_mem(radeon_mem_base,radeon_ram_size);
   unmap_phys_mem(radeon_mmio_base,0xFFFF);



More information about the MPlayer-cvslog mailing list