changeset 3347:21af9f3d5372

Minor fixes
author nick
date Thu, 06 Dec 2001 10:21:02 +0000
parents 54b89f7c055c
children 7b6f02207ebc
files drivers/radeon/radeon.h drivers/radeon/radeon_vid.c
diffstat 2 files changed, 45 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/radeon/radeon.h	Thu Dec 06 02:34:26 2001 +0000
+++ b/drivers/radeon/radeon.h	Thu Dec 06 10:21:02 2001 +0000
@@ -510,8 +510,13 @@
 #define OV0_SCALE_CNTL                         0x0420  
 #	define SCALER_PIX_EXPAND               0x00000001L
 #	define SCALER_Y2R_TEMP                 0x00000002L
+#ifdef RAGE128
+#	define SCALER_HORZ_PICK_NEAREST        0x00000003L
+#	define SCALER_VERT_PICK_NEAREST        0x00000004L
+#else
 #	define SCALER_HORZ_PICK_NEAREST        0x00000004L
 #	define SCALER_VERT_PICK_NEAREST        0x00000008L
+#endif
 #	define SCALER_SIGNED_UV                0x00000010L
 #	define SCALER_GAMMA_SEL_MASK           0x00000060L
 #	define SCALER_GAMMA_SEL_BRIGHT         0x00000000L
@@ -540,7 +545,11 @@
 #	define SCALER_UNKNOWN_FLAG0            0x00002000L /* ??? */
 #	define SCALER_UNKNOWN_FLAG1            0x00004000L /* ??? */
 #	define SCALER_SMART_SWITCH             0x00008000L
+#ifdef RAGE128
 #	define SCALER_BURST_PER_PLANE          0x00ff0000L
+#else
+#	define SCALER_BURST_PER_PLANE          0x007f0000L
+#endif
 #	define SCALER_DOUBLE_BUFFER            0x01000000L
 #	define SCALER_UNKNOWN_FLAG3            0x02000000L /* ??? */
 #	define SCALER_UNKNOWN_FLAG4            0x04000000L /* ??? */
@@ -628,16 +637,34 @@
 #define OV0_GRAPHICS_KEY_CLR                   0x04EC
 #define OV0_GRAPHICS_KEY_MSK                   0x04F0
 #define OV0_KEY_CNTL                           0x04F4  
+#ifdef RAGE128
 #	define VIDEO_KEY_FN_MASK               0x00000007L
+#else
+#	define VIDEO_KEY_FN_MASK               0x00000003L
+#endif
 #	define VIDEO_KEY_FN_FALSE              0x00000000L
 #	define VIDEO_KEY_FN_TRUE               0x00000001L
+#ifdef RAGE128
 #	define VIDEO_KEY_FN_EQ                 0x00000004L
 #	define VIDEO_KEY_FN_NE                 0x00000005L
+#else
+#	define VIDEO_KEY_FN_EQ                 0x00000002L
+#	define VIDEO_KEY_FN_NE                 0x00000003L
+#endif
+#ifdef RAGE128
 #	define GRAPHIC_KEY_FN_MASK             0x00000070L
+#else
+#	define GRAPHIC_KEY_FN_MASK             0x00000030L
+#endif
 #	define GRAPHIC_KEY_FN_FALSE            0x00000000L
 #	define GRAPHIC_KEY_FN_TRUE             0x00000010L
+#ifdef RAGE128
 #	define GRAPHIC_KEY_FN_EQ               0x00000040L
 #	define GRAPHIC_KEY_FN_NE               0x00000050L
+#else
+#	define GRAPHIC_KEY_FN_EQ               0x00000020L
+#	define GRAPHIC_KEY_FN_NE               0x00000030L
+#endif
 #	define CMP_MIX_MASK                    0x00000100L
 #	define CMP_MIX_OR                      0x00000000L
 #	define CMP_MIX_AND                     0x00000100L
--- a/drivers/radeon/radeon_vid.c	Thu Dec 06 02:34:26 2001 +0000
+++ b/drivers/radeon/radeon_vid.c	Thu Dec 06 10:21:02 2001 +0000
@@ -378,7 +378,7 @@
     {
 	OUTREG(OV0_GRAPHICS_KEY_MSK, besr.graphics_key_msk);
 	OUTREG(OV0_GRAPHICS_KEY_CLR, besr.graphics_key_clr);
-	OUTREG(OV0_KEY_CNTL,GRAPHIC_KEY_FN_FALSE|VIDEO_KEY_FN_FALSE|CMP_MIX_OR);
+	OUTREG(OV0_KEY_CNTL,GRAPHIC_KEY_FN_EQ|VIDEO_KEY_FN_FALSE|CMP_MIX_OR);
     }
     else OUTREG(OV0_KEY_CNTL,GRAPHIC_KEY_FN_NE);
    
@@ -457,15 +457,24 @@
 void radeon_vid_set_color_key(int ckey_on, uint8_t R, uint8_t G, uint8_t B)
 {
     besr.ckey_on = ckey_on;
-    if(radeon_vid_get_dbpp() == 16)
-    {  /* 5.6.5 mode, 
-          note that these values depend on DAC_CNTL.EXPAND_MODE setting */
-       R = (R<<3);
-       G = (G<<2);
-       B = (B<<3);
-       besr.graphics_key_msk=((R|0x7)<<16)|((G|0x3)<<8)|(B|0x7)|(0xff<<24);
+    switch(radeon_vid_get_dbpp() == 16)
+    { 
+	case 16:
+        	/* 5.6.5 mode, 
+    	    	note that these values depend on DAC_CNTL.EXPAND_MODE setting */
+		R = (R<<3);
+		G = (G<<2);
+		B = (B<<3);
+//		besr.graphics_key_msk=((R|0x7)<<16)|((G|0x3)<<8)|(B|0x7)|(0xff<<24);
+		besr.graphics_key_msk=((R|0x7)<<16)|((G|0x3)<<8)|(B|0x7)|(0xff<<24);
+		break;
+	case 24: besr.graphics_key_msk = ((R)<<16)|((G)<<8)|(B);
+		break;
+	case 32:
+	default: besr.graphics_key_msk = ((R)<<16)|((G)<<8)|(B)|(0xff<<24);
+		break;
     }
-    else besr.graphics_key_msk = ((R)<<16)|((G) <<8)|(B)|(0xff<<24);
+    besr.graphics_key_msk=(1ULL<<radeon_vid_get_dbpp()) - 1;
     besr.graphics_key_clr=(R<<16)|(G<<8)|(B)|(0x00 << 24);
 }