[MPlayer-cvslog] CVS: main/vidix/drivers unichrome_vid.c,1.1,1.2

Sascha Sommer CVS syncmail at mplayerhq.hu
Mon Nov 8 12:29:58 CET 2004


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var2/tmp/cvs-serv7801/vidix/drivers

Modified Files:
	unichrome_vid.c 
Log Message:
h/w revision detection patch by Timothy Lee <timothy.lee at siriushk.com>

Index: unichrome_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/unichrome_vid.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- unichrome_vid.c	10 Oct 2004 19:22:38 -0000	1.1
+++ unichrome_vid.c	8 Nov 2004 11:29:55 -0000	1.2
@@ -26,6 +26,8 @@
       Initial version
     2004-10-09
       Added Doxygen documentation (Benjamin Zores <ben at geexbox.org>)
+    2004-11-08
+      Added h/w revision detection (Timothy Lee <timothy.lee at siriushk.com>)
 
     To Do:
 */
@@ -60,6 +62,7 @@
 uint8_t *vio;
 uint8_t *uc_mem;
 uint8_t mclk_save[3];
+uint8_t hwrev;
 
 #define VIA_OUT(hwregs, reg, val)	*(volatile uint32_t *)((hwregs) + (reg)) = (val)
 #define VIA_IN(hwregs, reg)		*(volatile uint32_t *)((hwregs) + (reg))
@@ -544,6 +547,25 @@
   uc_grkey.ckey.green = 0x00;
   uc_grkey.ckey.red = 0x00;
 
+  /* Detect whether we have a CLE266Ax or CLE266Cx */
+  outb (0x4f, 0x3d4);
+  tmp = inb (0x3d5);
+  outb (0x4f, 0x3d4);
+  outb (0x55, 0x3d5);
+  outb (0x4f, 0x3d4);
+  if (0x55 == inb (0x3d5))
+  {
+    /* Only CLE266Cx supports CR4F */
+    hwrev = 0x11;
+  }
+  else
+  {
+    /* Otherwise assume to be a CLE266Ax */
+    hwrev = 0x00;
+  }
+  outb (0x4f, 0x3d4);
+  outb (tmp, 0x3d5);
+
 #ifdef DEBUG_LOGFILE
   logfile = fopen ("/tmp/uc_vidix.log", "w");
 #endif
@@ -767,7 +789,7 @@
   uc_ovl_setup_fifo (&extfifo_on, src_w);
 
   /* Get image format, FIFO size, etc. */
-  uc_ovl_map_v1_control (info->fourcc, src_w, 3, extfifo_on,
+  uc_ovl_map_v1_control (info->fourcc, src_w, hwrev, extfifo_on,
 			 &v_ctrl, &fifo_ctrl);
 
   /* Setup layer window */
@@ -846,9 +868,17 @@
   /* Configure diy_pitchlay parameters now */
   if (v_ctrl & V1_COLORSPACE_SIGN)
     {
+      if (hwrev >= 0x10)
+	{
+	  VIDEO_OUT (vio, V1_ColorSpaceReg_2, ColorSpaceValue_2_3123C0);
+	  VIDEO_OUT (vio, V1_ColorSpaceReg_1, ColorSpaceValue_1_3123C0);
+	}
+      else
+	{
       VIDEO_OUT (vio, V1_ColorSpaceReg_2, ColorSpaceValue_2);
       VIDEO_OUT (vio, V1_ColorSpaceReg_1, ColorSpaceValue_1);
     }
+    }
 
   VIDEO_OUT (vio, V1_CONTROL, v_ctrl);
   VIDEO_OUT (vio, V_FIFO_CONTROL, fifo_ctrl);




More information about the MPlayer-cvslog mailing list