summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2016-04-21 17:29:16 +0100
committerEmil Velikov <[email protected]>2016-05-24 23:03:00 +0100
commite384d75b120ce60954c545e8c6edbe98fd01bea7 (patch)
tree91f111db322fbfcb97ce308e0276558a507268e6 /src
parent0e983276b96eee5aa1dd091888bc81e36169a8f1 (diff)
mesa_glinterop: make GL interop version field bidirectional
This allows clear and easy communication between the two. Caller: Requesting information (struct vN) Callee: I know how to deal with older version (vN-1) only. Here is your data and the version I support. Caller: Older version ? Sure I'll cap all access to the fields provided by the older version (vN-1) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c2
-rw-r--r--src/egl/main/eglapi.c2
-rw-r--r--src/egl/main/eglapi.h2
-rw-r--r--src/gallium/state_trackers/dri/dri2.c9
-rw-r--r--src/glx/dri2_priv.h2
-rw-r--r--src/glx/dri3_priv.h2
-rw-r--r--src/glx/dri_common_interop.c4
-rw-r--r--src/glx/glxclient.h2
-rw-r--r--src/glx/glxcmds.c2
9 files changed, 17 insertions, 10 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 6dcfd4930a9..f954cd53a34 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2703,7 +2703,7 @@ dri2_interop_query_device_info(_EGLDisplay *dpy, _EGLContext *ctx,
static int
dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index c8d7c23944a..098bed0518a 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1961,7 +1961,7 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
int
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
_EGLDisplay *disp;
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index 58327fd1015..4df17c026d1 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -195,7 +195,7 @@ struct _egl_api
int (*GLInteropQueryDeviceInfo)(_EGLDisplay *dpy, _EGLContext *ctx,
mesa_glinterop_device_info *out);
int (*GLInteropExportObject)(_EGLDisplay *dpy, _EGLContext *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out);
};
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 3a2a3cedc5a..0c84bafe14e 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1480,12 +1480,15 @@ dri2_interop_query_device_info(__DRIcontext *_ctx,
out->vendor_id = screen->get_param(screen, PIPE_CAP_VENDOR_ID);
out->device_id = screen->get_param(screen, PIPE_CAP_DEVICE_ID);
+ /* Instruct the caller that we support up-to version one of the interface */
+ out->version = 1;
+
return MESA_GLINTEROP_SUCCESS;
}
static int
dri2_interop_export_object(__DRIcontext *_ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
struct st_context_iface *st = dri_context(_ctx)->st;
@@ -1704,6 +1707,10 @@ dri2_interop_export_object(__DRIcontext *_ctx,
if (res->target == PIPE_BUFFER)
out->buf_offset += whandle.offset;
+ /* Instruct the caller that we support up-to version one of the interface */
+ in->version = 1;
+ out->version = 1;
+
return MESA_GLINTEROP_SUCCESS;
}
diff --git a/src/glx/dri2_priv.h b/src/glx/dri2_priv.h
index 8a640728ec7..edba31e8fee 100644
--- a/src/glx/dri2_priv.h
+++ b/src/glx/dri2_priv.h
@@ -76,7 +76,7 @@ dri2_interop_query_device_info(struct glx_context *ctx,
_X_HIDDEN int
dri2_interop_export_object(struct glx_context *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out);
#ifdef __cplusplus
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index d4ecdf7a58e..86ad17c4a51 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -139,5 +139,5 @@ dri3_interop_query_device_info(struct glx_context *ctx,
_X_HIDDEN int
dri3_interop_export_object(struct glx_context *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out);
diff --git a/src/glx/dri_common_interop.c b/src/glx/dri_common_interop.c
index 4733f3caab3..215aac46765 100644
--- a/src/glx/dri_common_interop.c
+++ b/src/glx/dri_common_interop.c
@@ -47,7 +47,7 @@ dri2_interop_query_device_info(struct glx_context *ctx,
_X_HIDDEN int
dri2_interop_export_object(struct glx_context *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
struct dri2_screen *psc = (struct dri2_screen*)ctx->psc;
@@ -76,7 +76,7 @@ dri3_interop_query_device_info(struct glx_context *ctx,
_X_HIDDEN int
dri3_interop_export_object(struct glx_context *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
struct dri3_screen *psc = (struct dri3_screen*)ctx->psc;
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index 141e46a31cd..16acd4b9d02 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -234,7 +234,7 @@ struct glx_context_vtable {
int (*interop_query_device_info)(struct glx_context *ctx,
mesa_glinterop_device_info *out);
int (*interop_export_object)(struct glx_context *ctx,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out);
};
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index b651953cf9c..589a87a038c 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2721,7 +2721,7 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
int
MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
- const mesa_glinterop_export_in *in,
+ mesa_glinterop_export_in *in,
mesa_glinterop_export_out *out)
{
struct glx_context *gc = (struct glx_context*)context;