changeset 4318:693e4cfd2b84

intense -> intensity + capability extension
author nick
date Wed, 23 Jan 2002 16:55:26 +0000
parents 0cf9e05f6de2
children 2d64382e8dcf
files vidix/drivers/mga_vid.c vidix/vidix.h
diffstat 2 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/drivers/mga_vid.c	Wed Jan 23 16:54:29 2002 +0000
+++ b/vidix/drivers/mga_vid.c	Wed Jan 23 16:55:26 2002 +0000
@@ -1441,12 +1441,17 @@
 }
 
 #ifdef MGA_EQUALIZER
-static vidix_video_eq_t equal = { 0, 0, 0, 0, 0, 0, 0, 0 };
+static vidix_video_eq_t equal =
+{
+ VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
 int 	vixPlaybackSetEq( const vidix_video_eq_t * eq)
 {
    uint32_t beslumactl;
    int brightness,contrast;
-	memcpy(&equal,eq,sizeof(vidix_video_eq_t));
+    if(eq->cap & VEQ_CAP_BRIGHTNESS) equal.brightness = eq->brightness;
+    if(eq->cap & VEQ_CAP_CONTRAST)   equal.contrast   = eq->contrast;
+    equal.flags = eq->flags;
 	//Enable contrast and brightness control
 	writel(readl(mga_mmio_base + BESGLOBCTL) & ~((1<<5) + (1<<7)),mga_mmio_base + BESGLOBCTL);
 	brightness = (equal.brightness * 128) / 1000;
@@ -1460,7 +1465,8 @@
     if (is_g400)
 	writel(beslumactl,mga_mmio_base + BESLUMACTL);
     else
-	printf("[mga] equalizer isn't supported with G200\n");
+	if (mga_verbose > 1)
+		printf("[mga] equalizer isn't supported with G200\n");
     return 0;
 }
 
--- a/vidix/vidix.h	Wed Jan 23 16:54:29 2002 +0000
+++ b/vidix/vidix.h	Wed Jan 23 16:55:26 2002 +0000
@@ -183,14 +183,22 @@
 
 typedef struct vidix_video_eq_s
 {
+#define VEQ_CAP_NONE			0x00000000UL
+#define VEQ_CAP_BRIGHTNESS		0x00000001UL
+#define VEQ_CAP_CONTRAST		0x00000002UL
+#define VEQ_CAP_SATURATION		0x00000004UL
+#define VEQ_CAP_HUE			0x00000008UL
+#define VEQ_CAP_RGB_INTENSITY		0x00000010UL
+	int		cap;		/* on get_eq should contain capability of equalizer
+					   on set_eq should contain using fields */
 /* end-user app can have presets like: cold-normal-hot picture and so on */
 	int		brightness;	/* -1000 : +1000 */
 	int		contrast;	/* -1000 : +1000 */
 	int		saturation;	/* -1000 : +1000 */
 	int		hue;		/* -1000 : +1000 */
-	int		red_intense;	/* -1000 : +1000 */
-	int		green_intense;  /* -1000 : +1000 */
-	int		blue_intense;   /* -1000 : +1000 */
+	int		red_intensity;	/* -1000 : +1000 */
+	int		green_intensity;/* -1000 : +1000 */
+	int		blue_intensity; /* -1000 : +1000 */
 #define VEQ_FLG_ITU_R_BT_601	0x00000000 /* ITU-R BT.601 colour space (default) */
 #define VEQ_FLG_ITU_R_BT_709	0x00000001 /* ITU-R BT.709 colour space */
 #define VEQ_FLG_ITU_MASK	0x0000000f