On Sun, 4 Mar 2001, Mariano Alvarez Fernandez wrote:
Thanks Hartmut for your patch and explanation, but this line:
if ( (CLRINFO->ncolors&GrCVALUEMASK) != CLRINFO->ncolors )
breaks the 24bpp driver, it must be:
if ( ((CLRINFO->ncolors-1)&GrCVALUEMASK) != CLRINFO->ncolors-1)
Nevertheless the real bug is that: 1L << 32 == 1 !!!!!! This is what breaks bccbgi (and even modetest) in 32 bpp mode.
I have now a patch that seems to work, but I want to test it with every plattform/color depth before release it.
If I'm applying following patch additionally to Hartmut's one xbccbgi begins to work (with some problems though, but not more than with 16bpp mode under XFree86) with 32bpp for me
Andris
--- grx-2.3.4/src/setup/colors.c~1 Mon Mar 5 10:50:31 2001 +++ grx-2.3.4/src/setup/colors.c Mon Mar 5 11:16:26 2001 @@ -88,8 +88,8 @@ DACload = DRVINFO->actmode.extinfo->loadcolor; CLRINFO->black = GrNOCOLOR; CLRINFO->white = GrNOCOLOR; - CLRINFO->ncolors = 1L << DRVINFO->actmode.bpp; - if ( (CLRINFO->ncolors&GrCVALUEMASK) != CLRINFO->ncolors ) { + CLRINFO->ncolors = DRVINFO->actmode.bpp>=32 ? 0 : (1L << DRVINFO->actmode.bpp); + if ( ((CLRINFO->ncolors-1)&GrCVALUEMASK) != (CLRINFO->ncolors-1) ) { /* can happen on 32bpp systems. Now try to calculate the minimum number of colors from cprec & cpos info */ int i, cbpp, c; @@ -129,7 +129,7 @@ CLRINFO->RGBmode = TRUE; break; } - return (CLRINFO->ncolors&GrCVALUEMASK) == CLRINFO->ncolors; + return ((CLRINFO->ncolors-1)&GrCVALUEMASK) == (CLRINFO->ncolors-1); }