From e71619c1dfc3866fd0337865f79ef4eba68675f6 Mon Sep 17 00:00:00 2001 From: faust3 Date: Mon, 8 Nov 2004 11:29:55 +0000 Subject: h/w revision detection patch by Timothy Lee git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13902 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/drivers/unichrome_vid.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'vidix/drivers/unichrome_vid.c') 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 ) + 2004-11-08 + Added h/w revision detection (Timothy Lee ) 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); -- cgit v1.2.3