[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    xgl/fb/fbcmap.c
From:       Adam Pigg <piggz1 () gmail ! com>
Date:       2006-02-27 17:22:46
Message-ID: 200602271722.47646.adam () piggz ! co ! uk
[Download RAW message or body]

Hi

To get xgl to build i had to modify fbcmap.c as in the attached diff.  It 
probably has something to do with XFree86Server being defined on the gcc 
command line therfore fbSetVisualTypesAndMasks does not get compiled.

The error is linking in hw/xgl/xglcmap.c

Is there a better fix?

Cheers

PiggZ 

["fbcmap.diff" (text/x-diff)]

Index: fbcmap.c
===================================================================
RCS file: /cvs/xorg/xserver/xorg/fb/fbcmap.c,v
retrieving revision 1.4
diff -r1.4 fbcmap.c
43a44,102
> 
> typedef struct _fbVisuals {
>     struct _fbVisuals	*next;
>     int			depth;
>     int			bitsPerRGB;
>     int			visuals;
>     int			count;
>     Pixel		redMask, greenMask, blueMask;
> } fbVisualsRec, *fbVisualsPtr;
> 
> static const int  fbVisualPriority[] = {
>     PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray
> };
> 
> #define NUM_PRIORITY	6
> 
> static fbVisualsPtr	fbVisuals;
> 
> #define _RZ(d) ((d + 2) / 3)
> #define _RS(d) 0
> #define _RM(d) ((1 << _RZ(d)) - 1)
> #define _GZ(d) ((d - _RZ(d) + 1) / 2)
> #define _GS(d) _RZ(d)
> #define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
> #define _BZ(d) (d - _RZ(d) - _GZ(d))
> #define _BS(d) (_RZ(d) + _GZ(d))
> #define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
> #define _CE(d) (1 << _RZ(d))
> 
> #define MAX_PSEUDO_DEPTH    10	    /* largest DAC size I know */
> 
> #define StaticGrayMask	(1 << StaticGray)
> #define GrayScaleMask	(1 << GrayScale)
> #define StaticColorMask	(1 << StaticColor)
> #define PseudoColorMask	(1 << PseudoColor)
> #define TrueColorMask	(1 << TrueColor)
> #define DirectColorMask (1 << DirectColor)
> 
> #define ALL_VISUALS	(StaticGrayMask|\
> 			 GrayScaleMask|\
> 			 StaticColorMask|\
> 			 PseudoColorMask|\
> 			 TrueColorMask|\
> 			 DirectColorMask)
> 
> #define LARGE_VISUALS	(TrueColorMask|\
> 			 DirectColorMask)
> 
> static int
> popCount (int i)
> {
>     int	count;
>     
>     count = (i >> 1) & 033333333333;
>     count = i - count - ((count >> 1) & 033333333333);
>     count = (((count + (count >> 3)) & 030707070707) % 077);	/* HAKMEM 169 */
>     return count;
> }
> 
311,320d369
< #define _RZ(d) ((d + 2) / 3)
< #define _RS(d) 0
< #define _RM(d) ((1 << _RZ(d)) - 1)
< #define _GZ(d) ((d - _RZ(d) + 1) / 2)
< #define _GS(d) _RZ(d)
< #define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
< #define _BZ(d) (d - _RZ(d) - _GZ(d))
< #define _BS(d) (_RZ(d) + _GZ(d))
< #define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
< #define _CE(d) (1 << _RZ(d))
322d370
< #define MAX_PSEUDO_DEPTH    10	    /* largest DAC size I know */
324,367d371
< #define StaticGrayMask	(1 << StaticGray)
< #define GrayScaleMask	(1 << GrayScale)
< #define StaticColorMask	(1 << StaticColor)
< #define PseudoColorMask	(1 << PseudoColor)
< #define TrueColorMask	(1 << TrueColor)
< #define DirectColorMask (1 << DirectColor)
< 
< #define ALL_VISUALS	(StaticGrayMask|\
< 			 GrayScaleMask|\
< 			 StaticColorMask|\
< 			 PseudoColorMask|\
< 			 TrueColorMask|\
< 			 DirectColorMask)
< 
< #define LARGE_VISUALS	(TrueColorMask|\
< 			 DirectColorMask)
< 
< typedef struct _fbVisuals {
<     struct _fbVisuals	*next;
<     int			depth;
<     int			bitsPerRGB;
<     int			visuals;
<     int			count;
<     Pixel		redMask, greenMask, blueMask;
< } fbVisualsRec, *fbVisualsPtr;
< 
< static const int  fbVisualPriority[] = {
<     PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray
< };
< 
< #define NUM_PRIORITY	6
< 
< static fbVisualsPtr	fbVisuals;
< 
< static int
< popCount (int i)
< {
<     int	count;
<     
<     count = (i >> 1) & 033333333333;
<     count = i - count - ((count >> 1) & 033333333333);
<     count = (((count + (count >> 3)) & 030707070707) % 077);	/* HAKMEM 169 */
<     return count;
< }
385d388
< }
387,413d389
< Bool
< fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
< 			  Pixel redMask, Pixel greenMask, Pixel blueMask)
< {
<     fbVisualsPtr   new, *prev, v;
< 
<     new = (fbVisualsPtr) xalloc (sizeof *new);
<     if (!new)
< 	return FALSE;
<     if (!redMask || !greenMask || !blueMask)
<     {
< 	redMask = _RM(depth);
< 	greenMask = _GM(depth);
< 	blueMask = _BM(depth);
<     }
<     new->next = 0;
<     new->depth = depth;
<     new->visuals = visuals;
<     new->bitsPerRGB = bitsPerRGB;
<     new->redMask = redMask;
<     new->greenMask = greenMask;
<     new->blueMask = blueMask;
<     new->count = popCount (visuals);
<     for (prev = &fbVisuals; (v = *prev); prev = &v->next);
<     *prev = new;
<     return TRUE;
< }
672a649,677
> 
> 
> Bool
> fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
> 			  Pixel redMask, Pixel greenMask, Pixel blueMask)
> {
>     fbVisualsPtr   new, *prev, v;
> 
>     new = (fbVisualsPtr) xalloc (sizeof *new);
>     if (!new)
> 	return FALSE;
>     if (!redMask || !greenMask || !blueMask)
>     {
> 	redMask = _RM(depth);
> 	greenMask = _GM(depth);
> 	blueMask = _BM(depth);
>     }
>     new->next = 0;
>     new->depth = depth;
>     new->visuals = visuals;
>     new->bitsPerRGB = bitsPerRGB;
>     new->redMask = redMask;
>     new->greenMask = greenMask;
>     new->blueMask = blueMask;
>     new->count = popCount (visuals);
>     for (prev = &fbVisuals; (v = *prev); prev = &v->next);
>     *prev = new;
>     return TRUE;
> }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic