2 #include "egl_tracker.h"
7 drm_visual_modes_destroy(__GLcontextModes
*modes
)
9 _eglLog(_EGL_DEBUG
, "%s", __FUNCTION__
);
12 __GLcontextModes
* const next
= modes
->next
;
19 drm_visual_modes_create(unsigned count
, size_t minimum_size
)
21 /* This code copied from libGLX, and modified */
22 const size_t size
= (minimum_size
> sizeof(__GLcontextModes
))
23 ? minimum_size
: sizeof(__GLcontextModes
);
24 __GLcontextModes
* head
= NULL
;
25 __GLcontextModes
** next
;
28 _eglLog(_EGL_DEBUG
, "%s %d %d", __FUNCTION__
, count
, minimum_size
);
31 for (i
= 0 ; i
< count
; i
++) {
32 *next
= (__GLcontextModes
*) calloc(1, size
);
34 drm_visual_modes_destroy(head
);
39 (*next
)->doubleBufferMode
= 1;
40 (*next
)->visualID
= GLX_DONT_CARE
;
41 (*next
)->visualType
= GLX_DONT_CARE
;
42 (*next
)->visualRating
= GLX_NONE
;
43 (*next
)->transparentPixel
= GLX_NONE
;
44 (*next
)->transparentRed
= GLX_DONT_CARE
;
45 (*next
)->transparentGreen
= GLX_DONT_CARE
;
46 (*next
)->transparentBlue
= GLX_DONT_CARE
;
47 (*next
)->transparentAlpha
= GLX_DONT_CARE
;
48 (*next
)->transparentIndex
= GLX_DONT_CARE
;
49 (*next
)->xRenderable
= GLX_DONT_CARE
;
50 (*next
)->fbconfigID
= GLX_DONT_CARE
;
51 (*next
)->swapMethod
= GLX_SWAP_UNDEFINED_OML
;
52 (*next
)->bindToTextureRgb
= GLX_DONT_CARE
;
53 (*next
)->bindToTextureRgba
= GLX_DONT_CARE
;
54 (*next
)->bindToMipmapTexture
= GLX_DONT_CARE
;
55 (*next
)->bindToTextureTargets
= 0;
56 (*next
)->yInverted
= GLX_DONT_CARE
;
58 next
= & ((*next
)->next
);
65 drm_visual_from_config(_EGLConfig
*conf
)
67 __GLcontextModes
*visual
;
70 visual
= drm_visual_modes_create(1, sizeof(*visual
));
72 visual
->greenBits
= 8;
74 visual
->alphaBits
= 8;
77 visual
->doubleBufferMode
= 1;
79 visual
->depthBits
= 24;
80 visual
->haveDepthBuffer
= visual
->depthBits
> 0;
81 visual
->stencilBits
= 8;
82 visual
->haveStencilBuffer
= visual
->stencilBits
> 0;