glx: call dri interop functions directly

removes pointless layers of abstraction and deletes a bunch of code

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30450>
This commit is contained in:
Mike Blumenkrantz
2024-07-25 13:26:03 -04:00
committed by Marge Bot
parent 634dea8f70
commit 410076af84
8 changed files with 4 additions and 131 deletions

View File

@@ -820,9 +820,6 @@ static const struct glx_context_vtable dri2_context_vtable = {
.unbind = dri2_unbind_context,
.wait_gl = dri2_wait_gl,
.wait_x = dri2_wait_x,
.interop_query_device_info = dri2_interop_query_device_info,
.interop_export_object = dri2_interop_export_object,
.interop_flush_objects = dri2_interop_flush_objects
};
static void

View File

@@ -62,20 +62,6 @@ _X_HIDDEN int
dri2_query_renderer_string(struct glx_screen *base, int attribute,
const char **value);
_X_HIDDEN int
dri2_interop_query_device_info(struct glx_context *ctx,
struct mesa_glinterop_device_info *out);
_X_HIDDEN int
dri2_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in,
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,
struct mesa_glinterop_flush_out *out);
#ifdef __cplusplus
}
#endif

View File

@@ -655,9 +655,6 @@ static const struct glx_context_vtable dri3_context_vtable = {
.unbind = dri3_unbind_context,
.wait_gl = dri3_wait_gl,
.wait_x = dri3_wait_x,
.interop_query_device_info = dri3_interop_query_device_info,
.interop_export_object = dri3_interop_export_object,
.interop_flush_objects = dri3_interop_flush_objects
};
/** dri3_bind_extensions

View File

@@ -111,17 +111,3 @@ dri3_query_renderer_integer(struct glx_screen *base, int attribute,
_X_HIDDEN int
dri3_query_renderer_string(struct glx_screen *base, int attribute,
const char **value);
_X_HIDDEN int
dri3_interop_query_device_info(struct glx_context *ctx,
struct mesa_glinterop_device_info *out);
_X_HIDDEN int
dri3_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in,
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,
struct mesa_glinterop_flush_out *out);

View File

@@ -1,85 +0,0 @@
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
#include "glxclient.h"
#include "glx_error.h"
#include "mesa_interface.h"
#include "dri2_priv.h"
#include "dri_util.h"
#if defined(HAVE_DRI3)
#include "dri3_priv.h"
#endif
#include "GL/mesa_glinterop.h"
_X_HIDDEN int
dri2_interop_query_device_info(struct glx_context *ctx,
struct mesa_glinterop_device_info *out)
{
return dri_interop_query_device_info(ctx->driContext, out);
}
_X_HIDDEN int
dri2_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out)
{
return dri_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,
struct mesa_glinterop_flush_out *out)
{
return dri_interop_flush_objects(ctx->driContext, count, objects, out);
}
#if defined(HAVE_DRI3)
_X_HIDDEN int
dri3_interop_query_device_info(struct glx_context *ctx,
struct mesa_glinterop_device_info *out)
{
return dri_interop_query_device_info(ctx->driContext, out);
}
_X_HIDDEN int
dri3_interop_export_object(struct glx_context *ctx,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out)
{
return dri_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,
struct mesa_glinterop_flush_out *out)
{
return dri_interop_flush_objects(ctx->driContext, count, objects, out);
}
#endif /* HAVE_DRI3 */
#endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */

View File

@@ -235,14 +235,6 @@ struct glx_context_vtable {
void (*unbind)(struct glx_context *context);
void (*wait_gl)(struct glx_context *ctx);
void (*wait_x)(struct glx_context *ctx);
int (*interop_query_device_info)(struct glx_context *ctx,
struct mesa_glinterop_device_info *out);
int (*interop_export_object)(struct glx_context *ctx,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out);
int (*interop_flush_objects)(struct glx_context *ctx,
unsigned count, struct mesa_glinterop_export_in *objects,
struct mesa_glinterop_flush_out *out);
};
/**

View File

@@ -32,6 +32,7 @@
#include <xcb/xcb.h>
#include <xcb/glx.h>
#include "GL/mesa_glinterop.h"
#include "dri_util.h"
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
@@ -2415,7 +2416,7 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
return MESA_GLINTEROP_INVALID_CONTEXT;
}
ret = gc->vtable->interop_query_device_info(gc, out);
ret = dri_interop_query_device_info(gc->driContext, out);
__glXUnlock();
return ret;
}
@@ -2435,7 +2436,7 @@ MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
return MESA_GLINTEROP_INVALID_CONTEXT;
}
ret = gc->vtable->interop_export_object(gc, in, out);
ret = dri_interop_export_object(gc->driContext, in, out);
__glXUnlock();
return ret;
}
@@ -2456,7 +2457,7 @@ MesaGLInteropGLXFlushObjects(Display *dpy, GLXContext context,
return MESA_GLINTEROP_INVALID_CONTEXT;
}
ret = gc->vtable->interop_flush_objects(gc, count, resources, out);
ret = dri_interop_flush_objects(gc->driContext, count, resources, out);
__glXUnlock();
return ret;
}

View File

@@ -16,7 +16,6 @@ files_libglx = files(
'dri_common.c',
'dri_common.h',
'dri_common_query_renderer.c',
'dri_common_interop.c',
'drisw_glx.c',
'drisw_priv.h',
'eval.c',