summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-09-27 11:39:25 -0700
committerEric Anholt <[email protected]>2013-10-24 14:04:20 -0700
commitf93533d118b6dab00022cc9bc1448615a25946dc (patch)
treeeac8fb7a9f34ba1f8b14738aef46dfc0184c6dd1 /src/gbm/backends
parent67caf36489e29c93ed1a25541944b191ed50df52 (diff)
dri: Pass in the dlsym()ed driver extension to screen creation.
This will allow a megadrivers build to reference the actual driver being loaded from the shared dri_util screen creation code. v2: Fix indentation, fallback case in EGL (review by Emil). Reviewed-by: Matt Turner <[email protected]> (v1) Reviewed-by: Chad Versace <[email protected]> (v1) Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gbm/backends')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c15
-rw-r--r--src/gbm/backends/dri/gbm_driint.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index ee05ed87256..e95fcc7b23c 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -228,7 +228,7 @@ dri_load_driver(struct gbm_dri_device *dri)
dlclose(dri->driver);
return -1;
}
-
+ dri->driver_extensions = extensions;
if (dri_bind_extensions(dri, gbm_dri_device_extensions, extensions) < 0) {
dlclose(dri->driver);
@@ -263,9 +263,16 @@ dri_screen_create(struct gbm_dri_device *dri)
if (dri->dri2 == NULL)
return -1;
- dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
- dri->extensions,
- &dri->driver_configs, dri);
+ if (dri->dri2->base.version >= 4) {
+ dri->screen = dri->dri2->createNewScreen2(0, dri->base.base.fd,
+ dri->extensions,
+ dri->driver_extensions,
+ &dri->driver_configs, dri);
+ } else {
+ dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
+ dri->extensions,
+ &dri->driver_configs, dri);
+ }
if (dri->screen == NULL)
return -1;
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index 90d764fb44f..cb4e477abf4 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -53,6 +53,7 @@ struct gbm_dri_device {
const __DRIconfig **driver_configs;
const __DRIextension *extensions[4];
+ const __DRIextension **driver_extensions;
__DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);
void *lookup_user_data;