summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri
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
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')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c20
-rw-r--r--src/gbm/backends/dri/gbm_driint.h12
2 files changed, 18 insertions, 14 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;
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index fdf694dce06..9c4392de05f 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -44,14 +44,14 @@ struct gbm_dri_device {
__DRIscreen *screen;
- __DRIcoreExtension *core;
- __DRIdri2Extension *dri2;
- __DRIimageExtension *image;
- __DRI2flushExtension *flush;
- __DRIdri2LoaderExtension *loader;
+ const __DRIcoreExtension *core;
+ const __DRIdri2Extension *dri2;
+ const __DRIimageExtension *image;
+ const __DRI2flushExtension *flush;
+ const __DRIdri2LoaderExtension *loader;
const __DRIconfig **driver_configs;
- const __DRIextension *extensions[5];
+ const __DRIextension **extensions;
const __DRIextension **driver_extensions;
__DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);