[Mesa-dev] [PATCH 10/16] egl_dri: rework dri extension handling

Emil Velikov emil.l.velikov at gmail.com
Sun Mar 16 06:48:30 PDT 2014


Use designated initialisers, and store the extensions pointers as const.

The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension
are setup by the platform backends so they should not be constified.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/egl/drivers/dri2/egl_dri2.c |  7 ++++---
 src/egl/drivers/dri2/egl_dri2.h | 16 ++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d734a1a..4448ec5 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -49,7 +49,7 @@
 #endif
 
 const __DRIuseInvalidateExtension use_invalidate = {
-   { __DRI_USE_INVALIDATE, 1 }
+   .base = { __DRI_USE_INVALIDATE, 1 }
 };
 
 EGLint dri2_to_egl_attribute_map[] = {
@@ -296,8 +296,9 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
 }
 
 const __DRIimageLookupExtension image_lookup_extension = {
-   { __DRI_IMAGE_LOOKUP, 1 },
-   dri2_lookup_egl_image
+   .base = { __DRI_IMAGE_LOOKUP, 1 },
+
+   .lookupEGLImage       = dri2_lookup_egl_image
 };
 
 static const char dri_driver_path[] = DEFAULT_DRIVER_DIR;
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index dfc5927..a20a827 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -92,14 +92,14 @@ struct dri2_egl_display
    int                       own_dri_screen;
    const __DRIconfig       **driver_configs;
    void                     *driver;
-   __DRIcoreExtension       *core;
-   __DRIdri2Extension       *dri2;
-   __DRIswrastExtension     *swrast;
-   __DRI2flushExtension     *flush;
-   __DRItexBufferExtension  *tex_buffer;
-   __DRIimageExtension      *image;
-   __DRIrobustnessExtension *robustness;
-   __DRI2configQueryExtension *config;
+   const __DRIcoreExtension       *core;
+   const __DRIdri2Extension       *dri2;
+   const __DRIswrastExtension     *swrast;
+   const __DRI2flushExtension     *flush;
+   const __DRItexBufferExtension  *tex_buffer;
+   const __DRIimageExtension      *image;
+   const __DRIrobustnessExtension *robustness;
+   const __DRI2configQueryExtension *config;
    int                       fd;
 
    int                       own_device;
-- 
1.9.0



More information about the mesa-dev mailing list