glx: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
This commit is contained in:
Jesse Natalie
2022-10-21 14:04:47 -07:00
committed by Marge Bot
parent 5345c34001
commit 8d55fb54b1
6 changed files with 43 additions and 2 deletions

View File

@@ -929,7 +929,8 @@ static const struct glx_context_vtable dri2_context_vtable = {
.wait_gl = dri2_wait_gl, .wait_gl = dri2_wait_gl,
.wait_x = dri2_wait_x, .wait_x = dri2_wait_x,
.interop_query_device_info = dri2_interop_query_device_info, .interop_query_device_info = dri2_interop_query_device_info,
.interop_export_object = dri2_interop_export_object .interop_export_object = dri2_interop_export_object,
.interop_flush_objects = dri2_interop_flush_objects
}; };
static void static void

View File

@@ -77,6 +77,11 @@ dri2_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out); struct mesa_glinterop_export_out *out);
_X_HIDDEN int
dri2_interop_flush_objects(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
GLsync *sync);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -710,7 +710,8 @@ static const struct glx_context_vtable dri3_context_vtable = {
.wait_gl = dri3_wait_gl, .wait_gl = dri3_wait_gl,
.wait_x = dri3_wait_x, .wait_x = dri3_wait_x,
.interop_query_device_info = dri3_interop_query_device_info, .interop_query_device_info = dri3_interop_query_device_info,
.interop_export_object = dri3_interop_export_object .interop_export_object = dri3_interop_export_object,
.interop_flush_objects = dri3_interop_flush_objects
}; };
/** dri3_bind_extensions /** dri3_bind_extensions

View File

@@ -138,3 +138,8 @@ _X_HIDDEN int
dri3_interop_export_object(struct glx_context *ctx, dri3_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out); struct mesa_glinterop_export_out *out);
_X_HIDDEN int
dri3_interop_flush_objects(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
GLsync *sync);

View File

@@ -57,6 +57,19 @@ dri2_interop_export_object(struct glx_context *ctx,
return psc->interop->export_object(ctx->driContext, in, out); return psc->interop->export_object(ctx->driContext, in, out);
} }
_X_HIDDEN int
dri2_interop_flush_objects(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
GLsync *sync)
{
struct dri2_screen *psc = (struct dri2_screen*)ctx->psc;
if (!psc->interop || psc->interop->base.version < 2)
return MESA_GLINTEROP_UNSUPPORTED;
return psc->interop->flush_objects(ctx->driContext, count, objects, sync);
}
#if defined(HAVE_DRI3) #if defined(HAVE_DRI3)
_X_HIDDEN int _X_HIDDEN int
@@ -84,5 +97,18 @@ dri3_interop_export_object(struct glx_context *ctx,
return psc->interop->export_object(ctx->driContext, in, out); return psc->interop->export_object(ctx->driContext, in, out);
} }
_X_HIDDEN int
dri3_interop_flush_objects(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
GLsync *sync)
{
struct dri3_screen *psc = (struct dri3_screen*)ctx->psc;
if (!psc->interop || psc->interop->base.version < 2)
return MESA_GLINTEROP_UNSUPPORTED;
return psc->interop->flush_objects(ctx->driContext, count, objects, sync);
}
#endif /* HAVE_DRI3 */ #endif /* HAVE_DRI3 */
#endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */ #endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */

View File

@@ -244,6 +244,9 @@ struct glx_context_vtable {
int (*interop_export_object)(struct glx_context *ctx, int (*interop_export_object)(struct glx_context *ctx,
struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out); struct mesa_glinterop_export_out *out);
int (*interop_flush_objects)(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
GLsync *sync);
}; };
/** /**