[Mesa-dev] [PATCH] gbm: set up the interop extension for egl/drm

Marek Olšák maraeo at gmail.com
Sat Oct 29 11:18:26 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

breaking libgbm -> libEGL ABI?
---
 src/egl/drivers/dri2/platform_drm.c | 1 +
 src/gbm/backends/dri/gbm_dri.c      | 1 +
 src/gbm/backends/dri/gbm_driint.h   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index ea1a7f1..2099314 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -705,20 +705,21 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
    dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->base.driver_name);
 
    dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
    dri2_dpy->core = dri2_dpy->gbm_dri->core;
    dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
    dri2_dpy->fence = dri2_dpy->gbm_dri->fence;
    dri2_dpy->image = dri2_dpy->gbm_dri->image;
    dri2_dpy->flush = dri2_dpy->gbm_dri->flush;
    dri2_dpy->swrast = dri2_dpy->gbm_dri->swrast;
    dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
+   dri2_dpy->interop = dri2_dpy->gbm_dri->interop;
 
    dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
    dri2_dpy->gbm_dri->lookup_user_data = disp;
 
    dri2_dpy->gbm_dri->get_buffers = dri2_drm_get_buffers;
    dri2_dpy->gbm_dri->flush_front_buffer = dri2_drm_flush_front_buffer;
    dri2_dpy->gbm_dri->get_buffers_with_format = dri2_drm_get_buffers_with_format;
    dri2_dpy->gbm_dri->image_get_buffers = dri2_drm_image_get_buffers;
    dri2_dpy->gbm_dri->swrast_put_image2 = swrast_put_image2;
    dri2_dpy->gbm_dri->swrast_get_image = swrast_get_image;
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 51c4117..5cd7318 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -239,20 +239,21 @@ struct dri_extension_match {
    const char *name;
    int version;
    int offset;
    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, 2, 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) },
    { NULL, 0, 0 }
 };
 
 static struct dri_extension_match gbm_swrast_device_extensions[] = {
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index 26376ef..29a8ec2 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -51,20 +51,21 @@ struct gbm_dri_device {
    __DRIcontext *context;
    mtx_t mutex;
 
    const __DRIcoreExtension   *core;
    const __DRIdri2Extension   *dri2;
    const __DRI2fenceExtension *fence;
    const __DRIimageExtension  *image;
    const __DRIswrastExtension *swrast;
    const __DRI2flushExtension *flush;
    const __DRIdri2LoaderExtension *loader;
+   const __DRI2interopExtension *interop;
 
    const __DRIconfig   **driver_configs;
    const __DRIextension **loader_extensions;
    const __DRIextension **driver_extensions;
 
    __DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);
    void *lookup_user_data;
 
    __DRIbuffer *(*get_buffers)(__DRIdrawable * driDrawable,
                                int *width, int *height,
-- 
2.7.4



More information about the mesa-dev mailing list