diff options
Diffstat (limited to 'src/gbm')
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 15 | ||||
-rw-r--r-- | src/gbm/backends/dri/gbm_driint.h | 1 |
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; |