Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 8098

Summary: XFree86 messed up colors on trident video card
Product: Gentoo Linux Reporter: Yavor Goulishev <yavor.goulishev>
Component: [OLD] KDEAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: VERIFIED FIXED    
Severity: normal    
Priority: High    
Version: 1.2   
Hardware: x86   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Yavor Goulishev 2002-09-19 04:55:59 UTC
This is XFree86 4.2.0 bug,
but Redhat uses the following patch in their build so under Redhat 7.3 X works 
great with trident chips.(I modified my ebuild script, applied the patch and 
now I have correct colors on my home machine)

Here is the patch XFree86-4.2.0-trident-9397.patch from XFree86-4.2.0-
8.src.rpm :


diff -u -r1.24 trident_video.c
--- xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
	2002/04/01 12:06:20	1.24
+++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
	2002/04/03 22:47:27
@@ -63,7 +63,9 @@
 static int TRIDENTQueryImageAttributes(ScrnInfoPtr, 
 	int, unsigned short *, unsigned short *,  int *, int *);
 static void TRIDENTVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+#if 0
 static void tridentSetVideoGamma(TRIDENTPtr pTrident,int value,int brightness);
+#endif
 static void tridentSetVideoContrast(TRIDENTPtr pTrident,int value);
 static void tridentSetVideoParameters(TRIDENTPtr pTrident, int brightness, 
 				      int saturation, int hue);
@@ -305,7 +307,9 @@
 	    break;
 	}    
     }    
+#if 0
     tridentSetVideoGamma(pTrident,pPriv->Gamma,pPriv->Brightness);
+#endif
     tridentSetVideoContrast(pTrident,pPriv->Contrast);
     tridentSetVideoParameters(pTrident,pPriv->Brightness,pPriv->Saturation,
                             pPriv->HUE);
@@ -355,7 +359,9 @@
     pPriv->Brightness = 45;
     pPriv->Saturation = 80;
     pPriv->Contrast = 4;
+#if 0
     pPriv->Gamma = 0;
+#endif
     pPriv->HUE = 0;
     pPriv->videoStatus = 0;
     pPriv->fixFrame = 100;
@@ -371,7 +377,9 @@
     	xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
     	xvSaturation = MAKE_ATOM("XV_SATURATION");
     	xvHUE        = MAKE_ATOM("XV_HUE");
+#if 0
     	xvGamma      = MAKE_ATOM("XV_GAMMA");
+#endif
     	xvContrast   = MAKE_ATOM("XV_CONTRAST");
     }
 
@@ -595,12 +603,14 @@
     pPriv->HUE = value;
     tridentSetVideoParameters(pTrident, pPriv->Brightness, pPriv->Saturation,
 			      pPriv->HUE);
+#if 0
     tridentSetVideoGamma(pTrident,pPriv->Gamma,pPriv->Brightness);
   } else if (attribute == xvGamma) {
     if ((value < -128) || (value > 127))
       return BadValue;
     pPriv->Gamma = value;
     tridentSetVideoGamma(pTrident,value,pPriv->Brightness);
+#endif
   } else if (attribute == xvContrast) {
     if ((value < 0) || (value > 127))
       return BadValue;
@@ -629,8 +639,10 @@
 	*value = pPriv->Saturation;
   } else if (attribute == xvHUE) {
 	*value = pPriv->HUE;
+#if 0
   } else if (attribute == xvGamma) {
 	*value = pPriv->Gamma;
+#endif
   } else if (attribute == xvContrast) {
 	*value = pPriv->Contrast;
   } else
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-19 16:15:49 UTC
Try xfree-4.2.1 in a bit.
Comment 2 Yavor Goulishev 2002-09-21 09:24:36 UTC
I checked the CVS on www.xfree86.org .
The revison version of triden_video.c in xfree-4.2.0 i s 1.21 and in xfree-
4.2.1 is 1.21.2.1 .The patch is not applied. Actually in revison 1.25 the patch 
seems to be applied, but this revision is not labeled yet :-((
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-21 11:17:55 UTC
For xfree-4.2.1 currently, TRIDENT_XV_GAMMA have to be defined for those
gamma functionality to be used that causes your problem.  Recheck .. after
our 4.2.1 have unpacked, everywhere your patch have '#if 0', ours have
'#ifdef TRIDENT_XV_GAMMA', and that have to be defined in host.def ....

So, current 4.2.1 in portage should fix your problem.
Comment 4 Yavor Goulishev 2002-09-24 10:12:28 UTC
I tried xfree-4.2.1 and it works.
Actually XFree86 don't have the patch in the CVS branch for 4.2.1 .
So you added the patch in the Gentoo build for 4.2.1 in the file 008_all_4.2.0-
trident-driver-update-cvs-20020617.patch.bz2 with other patches.
No problem. It works now.

Comment 5 Yavor Goulishev 2003-02-07 08:37:34 UTC
moving to state closed.