aboutsummaryrefslogtreecommitdiffhomepage
path: root/vidix/drivers
diff options
context:
space:
mode:
authorGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-08 11:29:55 +0000
committerGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-08 11:29:55 +0000
commite71619c1dfc3866fd0337865f79ef4eba68675f6 (patch)
tree10a403f948f1e0cb83efd55a07d8270e01f1e27f /vidix/drivers
parent3d1c0a457cd5a444ea7f30bdfedd1eb4e199e73a (diff)
h/w revision detection patch by Timothy Lee <timothy.lee@siriushk.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13902 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'vidix/drivers')
-rw-r--r--vidix/drivers/unichrome_vid.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/vidix/drivers/unichrome_vid.c b/vidix/drivers/unichrome_vid.c
index 5e675075c9..6c58488c47 100644
--- a/vidix/drivers/unichrome_vid.c
+++ b/vidix/drivers/unichrome_vid.c
@@ -26,6 +26,8 @@
Initial version
2004-10-09
Added Doxygen documentation (Benjamin Zores <ben@geexbox.org>)
+ 2004-11-08
+ Added h/w revision detection (Timothy Lee <timothy.lee@siriushk.com>)
To Do:
*/
@@ -60,6 +62,7 @@ static int frames[VID_PLAY_MAXFRAMES];
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 @@ vixInit (void)
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 @@ vixConfigPlayback (vidix_playback_t * info)
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 @@ vixConfigPlayback (vidix_playback_t * info)
/* 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);