summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri/gbm_dri.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-03-16 00:26:53 +0000
committerEmil Velikov <[email protected]>2014-04-28 19:13:38 +0100
commit5457caa58c048e2df71c7ebc036d5ca010d576b6 (patch)
tree9dd6ac456f2a4990cbe27a1b71eaba28af50f6fb /src/gbm/backends/dri/gbm_dri.c
parentc812557a0e1d6242362460ba6a3aa2012ea9f4b1 (diff)
gbm: cleanup __DRI*extension handling
Use designated initialisers, store all extension pointers as const and use a const __DRIextensions array over assigning each element individually. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/gbm/backends/dri/gbm_dri.c')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 9d08a97e648..cec12d1f477 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -125,12 +125,13 @@ image_get_buffers(__DRIdrawable *driDrawable,
}
static const __DRIuseInvalidateExtension use_invalidate = {
- { __DRI_USE_INVALIDATE, 1 }
+ .base = { __DRI_USE_INVALIDATE, 1 }
};
static const __DRIimageLookupExtension image_lookup_extension = {
- { __DRI_IMAGE_LOOKUP, 1 },
- dri_lookup_egl_image
+ .base = { __DRI_IMAGE_LOOKUP, 1 },
+
+ .lookupEGLImage = dri_lookup_egl_image
};
static const __DRIdri2LoaderExtension dri2_loader_extension = {
@@ -148,6 +149,13 @@ static const __DRIimageLoaderExtension image_loader_extension = {
.flushFrontBuffer = dri_flush_front_buffer,
};
+static const __DRIextension *gbm_dri_screen_extensions[] = {
+ &image_lookup_extension.base,
+ &use_invalidate.base,
+ &dri2_loader_extension.base,
+ &image_loader_extension.base,
+ NULL,
+};
struct dri_extension_match {
const char *name;
@@ -285,11 +293,7 @@ dri_screen_create(struct gbm_dri_device *dri)
return ret;
};
- dri->extensions[0] = &image_lookup_extension.base;
- dri->extensions[1] = &use_invalidate.base;
- dri->extensions[2] = &dri2_loader_extension.base;
- dri->extensions[3] = &image_loader_extension.base;
- dri->extensions[4] = NULL;
+ dri->extensions = gbm_dri_screen_extensions;
if (dri->dri2 == NULL)
return -1;