From f386776ea55f86d0288c955cf4cf877a1b4a027d Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Fri, 9 Feb 2018 09:37:19 +0100 Subject: loader_dri3/glx/egl: Reinstate the loader_dri3_vtable get_dri_screen callback Removing this callback caused rendering corruption in some multi-screen cases, so it is reinstated but without the drawable argument which was never used by implementations and was confusing since the drawable could have been created with another screen. Cc: "17.3 18.0" mesa-stable@lists.freedesktop.org Fixes: 5198e48a0d (loader_dri3/glx/egl: Remove the loader_dri3_vtable get_dri_screen callback) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105013 Reported-by: Daniel van Vugt Tested-by: Timo Aaltonen Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul --- src/glx/dri3_glx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/glx') diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index f280a8cef77..016f91b1963 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -116,6 +116,16 @@ glx_dri3_get_dri_context(struct loader_dri3_drawable *draw) return (gc != &dummyContext) ? dri3Ctx->driContext : NULL; } +static __DRIscreen * +glx_dri3_get_dri_screen(void) +{ + struct glx_context *gc = __glXGetCurrentContext(); + struct dri3_context *pcp = (struct dri3_context *) gc; + struct dri3_screen *psc = (struct dri3_screen *) pcp->base.psc; + + return (gc != &dummyContext && psc) ? psc->driScreen : NULL; +} + static void glx_dri3_flush_drawable(struct loader_dri3_drawable *draw, unsigned flags) { @@ -150,6 +160,7 @@ static const struct loader_dri3_vtable glx_dri3_vtable = { .set_drawable_size = glx_dri3_set_drawable_size, .in_current_context = glx_dri3_in_current_context, .get_dri_context = glx_dri3_get_dri_context, + .get_dri_screen = glx_dri3_get_dri_screen, .flush_drawable = glx_dri3_flush_drawable, .show_fps = glx_dri3_show_fps, }; -- cgit v1.2.3