[Mplayer-cvslog] CVS: main/vidix/drivers mga_vid.c,1.16,1.17

Arpi of Ize arpi at mplayerhq.hu
Fri Jul 26 00:52:53 CEST 2002


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

Modified Files:
	mga_vid.c 
Log Message:
vide EQ fixed - lumactl register is not readable!


Index: mga_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/mga_vid.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- mga_vid.c	19 Jul 2002 20:51:48 -0000	1.16
+++ mga_vid.c	25 Jul 2002 22:52:51 -0000	1.17
@@ -1435,11 +1435,6 @@
 
 int vixPlaybackSetEq( const vidix_video_eq_t * eq)
 {
-   uint32_t luma = 0;
-   float factor = 256.0 / 2000;
-   static int32_t prev_br = 0;
-   static int32_t prev_c = 0;
-
     /* contrast and brightness control isn't supported on G200 - alex */
     if (!is_g400)
     {
@@ -1447,22 +1442,27 @@
 	return(ENOTSUP);
     }
 
-    if (eq->cap & VEQ_CAP_BRIGHTNESS) { prev_br=eq->brightness; if ( prev_br == 1000 ) prev_br=999; }
-    if (eq->cap & VEQ_CAP_CONTRAST) { prev_c=eq->contrast; if ( prev_c == 1000 ) prev_c=999; }
-
-    luma = ((int)(prev_br * factor) << 16) + ((int)(prev_c * factor) & 0xFFFF);
-
-    regs.beslumactl = luma+0x80;
-
+    // only brightness&contrast are supported:
+    if(!(eq->cap & (VEQ_CAP_BRIGHTNESS|VEQ_CAP_CONTRAST)))
+	return(ENOTSUP);
+    
+    //regs.beslumactl = readl(mga_mmio_base + BESLUMACTL);
+//    printf("LUMA = %08X   \n",regs.beslumactl);
+    if (eq->cap & VEQ_CAP_BRIGHTNESS) { 
+	regs.beslumactl &= 0xFFFF;
+	regs.beslumactl |= (eq->brightness*255/2000)<<16;
+    }
+    if (eq->cap & VEQ_CAP_CONTRAST) {
+	regs.beslumactl &= 0xFFFF0000;
+	regs.beslumactl |= (128+eq->contrast*255/2000)&0xFFFF;
+    }
     writel(regs.beslumactl,mga_mmio_base + BESLUMACTL);
+
     return(0);
 }
 
 int vixPlaybackGetEq( vidix_video_eq_t * eq)
 {
-    uint32_t luma;
-    float factor = 2000.0 / 256;
-
     /* contrast and brightness control isn't supported on G200 - alex */
     if (!is_g400)
     {
@@ -1470,12 +1470,13 @@
 	return(ENOTSUP);
     }
 
-    regs.beslumactl = readl(mga_mmio_base + BESLUMACTL);
-    luma = regs.beslumactl-0x80;
+//    regs.beslumactl = readl(mga_mmio_base + BESLUMACTL);
 
-    eq->brightness = (signed short int)(luma >> 16) * factor;
-    eq->contrast = (signed short int)(luma & 0xFFFF) * factor;
+    eq->brightness = (signed short int)(regs.beslumactl >> 16) * 1000 / 128;
+    eq->contrast = (signed short int)(regs.beslumactl & 0xFFFF) * 1000 / 128 - 1000;
     eq->cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST;
+    
+    printf("MGA GET_EQ: br=%d c=%d  \n",eq->brightness,eq->contrast);
 
     return(0);
 }




More information about the MPlayer-cvslog mailing list