[Mesa-dev] [PATCH 13/13] gbm: don't manage our set of DRI extensions
Emil Velikov
emil.l.velikov at gmail.com
Thu May 11 18:57:57 UTC 2017
From: Emil Velikov <emil.velikov at collabora.com>
Don't fetch/manage our set of extensions apart from __DRI_CORE,
__DRI_DRI2 and __DRI_SWRAST. We require these to setup a screen and
context (in case of bo map/unmap).
The rest are fetched and kept in sync with the rest of EGL, via the
egl/drm code.
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Strictly speaking this might break if one uses GBM without EGL. If that
is a valid usecase we can keep the required extensions - flush/image
within GBM itself.
---
src/gbm/backends/dri/gbm_dri.c | 20 --------------------
src/gbm/backends/dri/gbm_driint.h | 7 ++++---
2 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 9b08ae31a50..f91d70b7614 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -252,14 +252,6 @@ struct dri_extension_match {
int optional;
};
-static struct dri_extension_match dri_core_extensions[] = {
- { __DRI2_FLUSH, 1, offsetof(struct gbm_dri_device, flush) },
- { __DRI_IMAGE, 1, offsetof(struct gbm_dri_device, image) },
- { __DRI2_FENCE, 1, offsetof(struct gbm_dri_device, fence), 1 },
- { __DRI2_INTEROP, 1, offsetof(struct gbm_dri_device, interop), 1 },
- { NULL, 0, 0 }
-};
-
static struct dri_extension_match gbm_dri_device_extensions[] = {
{ __DRI_CORE, 1, offsetof(struct gbm_dri_device, core) },
{ __DRI_DRI2, 1, offsetof(struct gbm_dri_device, dri2) },
@@ -437,7 +429,6 @@ dri_load_driver_swrast(struct gbm_dri_device *dri)
static int
dri_screen_create_dri2(struct gbm_dri_device *dri, char *driver_name)
{
- const __DRIextension **extensions;
int ret = 0;
dri->driver_name = driver_name;
@@ -468,21 +459,10 @@ dri_screen_create_dri2(struct gbm_dri_device *dri, char *driver_name)
if (dri->screen == NULL)
return -1;
- extensions = dri->core->getExtensions(dri->screen);
- if (dri_bind_extensions(dri, dri_core_extensions, extensions) < 0) {
- ret = -1;
- goto free_screen;
- }
-
dri->lookup_image = NULL;
dri->lookup_user_data = NULL;
return 0;
-
-free_screen:
- dri->core->destroyScreen(dri->screen);
-
- return ret;
}
static int
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index 68220cb85d0..c1048891c87 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -50,13 +50,14 @@ struct gbm_dri_device {
__DRIcontext *context;
mtx_t mutex;
+ /* The following three are required for screen/context management */
const __DRIcoreExtension *core;
const __DRIdri2Extension *dri2;
- const __DRI2fenceExtension *fence;
- const __DRIimageExtension *image;
const __DRIswrastExtension *swrast;
+
+ /* Use extensively throughout and setup by egl/drm */
+ const __DRIimageExtension *image;
const __DRI2flushExtension *flush;
- const __DRI2interopExtension *interop;
const __DRIconfig **driver_configs;
const __DRIextension **loader_extensions;
--
2.12.2
More information about the mesa-dev
mailing list