summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2022-11-28 12:50:59 -0800
committerMarge Bot <emma+marge@anholt.net>2022-12-05 19:26:41 +0000
commit1026d29344192755dd340d6ac13a9674189d2d61 (patch)
tree3fc33d24b56fba2676cbc639e99b2acea50ea677 /src/glx
parent2db044d7e53d960c2d7286d0b8899ba455254475 (diff)
dri: Introduce internal Mesa DRI driver loader extension.
All DRI loaders in Mesa (EGL, GLX, gbm) now require this ext and that the driver come from a matching build. This will let us use Mesa-internal types and enums across the loader-driver bounary inside of Mesa. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Eric Engestrom <eric@igalia.com> LOL-YESed-by: Kristian Høgsberg <krh@bitplanet.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri2_glx.c1
-rw-r--r--src/glx/dri2_priv.h3
-rw-r--r--src/glx/dri3_glx.c1
-rw-r--r--src/glx/dri3_priv.h2
-rw-r--r--src/glx/drisw_glx.c1
-rw-r--r--src/glx/drisw_priv.h2
6 files changed, 10 insertions, 0 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 553ba1dba77..943c953d0fe 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1092,6 +1092,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
static const struct dri_extension_match exts[] = {
{ __DRI_CORE, 1, offsetof(struct dri2_screen, core), false },
{ __DRI_DRI2, 4, offsetof(struct dri2_screen, dri2), false },
+ { __DRI_MESA, 1, offsetof(struct dri2_screen, mesa), false },
};
if (!loader_bind_extensions(psc, exts, ARRAY_SIZE(exts), extensions))
goto handle_error;
diff --git a/src/glx/dri2_priv.h b/src/glx/dri2_priv.h
index e8f1b64b85e..837709fa5ec 100644
--- a/src/glx/dri2_priv.h
+++ b/src/glx/dri2_priv.h
@@ -37,6 +37,8 @@
extern "C" {
#endif
+#include "GL/internal/mesa_interface.h"
+
struct dri2_screen {
struct glx_screen base;
@@ -44,6 +46,7 @@ struct dri2_screen {
__GLXDRIscreen vtable;
const __DRIdri2Extension *dri2;
const __DRIcoreExtension *core;
+ const __DRImesaCoreExtension *mesa;
const __DRI2flushExtension *f;
const __DRI2configQueryExtension *config;
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index 3754bf15533..ecbefddc36c 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -878,6 +878,7 @@ dri3_create_screen(int screen, struct glx_display * priv)
static const struct dri_extension_match exts[] = {
{ __DRI_CORE, 1, offsetof(struct dri3_screen, core), false },
{ __DRI_IMAGE_DRIVER, 1, offsetof(struct dri3_screen, image_driver), false },
+ { __DRI_MESA, 1, offsetof(struct dri3_screen, mesa), false },
};
if (!loader_bind_extensions(psc, exts, ARRAY_SIZE(exts), extensions))
goto handle_error;
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index 09dcefd6115..7820033035f 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -60,6 +60,7 @@
#include <xcb/sync.h>
#include "loader_dri3_helper.h"
+#include "GL/internal/mesa_interface.h"
struct dri3_display
{
@@ -92,6 +93,7 @@ struct dri3_screen {
const __DRIimageExtension *image;
const __DRIimageDriverExtension *image_driver;
const __DRIcoreExtension *core;
+ const __DRImesaCoreExtension *mesa;
const __DRI2flushExtension *f;
const __DRI2configQueryExtension *config;
const __DRItexBufferExtension *texBuffer;
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index e760cedde91..d934e4eb79c 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -960,6 +960,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
{ __DRI_SWRAST, 4, offsetof(struct drisw_screen, swrast), false },
{ __DRI_KOPPER, 1, offsetof(struct drisw_screen, kopper), true },
{ __DRI_COPY_SUB_BUFFER, 1, offsetof(struct drisw_screen, copySubBuffer), true },
+ { __DRI_MESA, 1, offsetof(struct drisw_screen, mesa), false },
};
if (!loader_bind_extensions(psc, exts, ARRAY_SIZE(exts), extensions))
goto handle_error;
diff --git a/src/glx/drisw_priv.h b/src/glx/drisw_priv.h
index a75f2c5f575..d1f445bc0ad 100644
--- a/src/glx/drisw_priv.h
+++ b/src/glx/drisw_priv.h
@@ -28,6 +28,7 @@
#include <X11/extensions/XShm.h>
#include "kopper_interface.h"
+#include "GL/internal/mesa_interface.h"
struct drisw_display
{
@@ -42,6 +43,7 @@ struct drisw_screen
__DRIscreen *driScreen;
__GLXDRIscreen vtable;
const __DRIcoreExtension *core;
+ const __DRImesaCoreExtension *mesa;
const __DRIswrastExtension *swrast;
const __DRIkopperExtension *kopper;
const __DRI2flushExtension *f;