mesa: GL_EXT_secondary_color is not optional
[mesa.git] / src / mesa / drivers / dri / nouveau / nouveau_screen.c
index 2a15c08c6793e048058a493fdd55b5c5b6b2a3b0..ca39fff807a6057de699dc503ec7bb31d5b3a4cf 100644 (file)
@@ -52,24 +52,20 @@ nouveau_get_configs(void)
        const uint8_t stencil_bits[] = { 0,  0,  0,  8 };
        const uint8_t msaa_samples[] = { 0 };
 
-       const struct {
-               GLenum format;
-               GLenum type;
-       } fb_formats[] = {
-               { GL_RGB , GL_UNSIGNED_SHORT_5_6_5     },
-               { GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV },
-               { GL_BGR , GL_UNSIGNED_INT_8_8_8_8_REV },
+       static const gl_format formats[3] = {
+               MESA_FORMAT_RGB565,
+               MESA_FORMAT_ARGB8888,
+               MESA_FORMAT_XRGB8888,
        };
 
        const GLenum back_buffer_modes[] = {
                GLX_NONE, GLX_SWAP_UNDEFINED_OML
        };
 
-       for (i = 0; i < Elements(fb_formats); i++) {
+       for (i = 0; i < Elements(formats); i++) {
                __DRIconfig **config;
 
-               config = driCreateConfigs(fb_formats[i].format,
-                                         fb_formats[i].type,
+               config = driCreateConfigs(formats[i],
                                          depth_bits, stencil_bits,
                                          Elements(depth_bits),
                                          back_buffer_modes,
@@ -79,8 +75,7 @@ nouveau_get_configs(void)
                                          GL_TRUE);
                assert(config);
 
-               configs = configs ? driConcatConfigs(configs, config)
-                       : config;
+               configs = driConcatConfigs(configs, config);
        }
 
        return (const __DRIconfig **)configs;
@@ -145,7 +140,7 @@ nouveau_destroy_screen(__DRIscreen *dri_screen)
 
        nouveau_device_del(&screen->device);
 
-       FREE(screen);
+       free(screen);
        dri_screen->driverPrivate = NULL;
 }
 
@@ -221,7 +216,7 @@ nouveau_drawable_flush(__DRIdrawable *draw)
 }
 
 static const struct __DRI2flushExtensionRec nouveau_flush_extension = {
-    { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+    { __DRI2_FLUSH, 3 },
     nouveau_drawable_flush,
     dri2InvalidateDrawable,
 };