diff --git a/Mesa.changes b/Mesa.changes index 4256cbd..eb38238 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Mar 1 21:55:02 UTC 2023 - Stefan Dirsch + +- U_glx-fix-indirect-initialization-crash.patch + * Fixes: b090246a ("glx: Only compute client GL extensions for + indirect contexts") + * Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393 +- supersedes n_Revert-glx-Only-compute-client-GL-extensions-for-ind.patch + ------------------------------------------------------------------- Tue Feb 28 09:49:37 UTC 2023 - Fabian Vogt diff --git a/Mesa.spec b/Mesa.spec index a46afad..7aabbce 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -139,7 +139,7 @@ Source6: Mesa-rpmlintrc Source7: Mesa.keyring Patch2: n_add-Mesa-headers-again.patch # To address https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393 -Patch3: n_Revert-glx-Only-compute-client-GL-extensions-for-ind.patch +Patch3: U_glx-fix-indirect-initialization-crash.patch # never to be upstreamed Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch Patch58: u_dep_xcb.patch diff --git a/U_glx-fix-indirect-initialization-crash.patch b/U_glx-fix-indirect-initialization-crash.patch new file mode 100644 index 0000000..9e06ecf --- /dev/null +++ b/U_glx-fix-indirect-initialization-crash.patch @@ -0,0 +1,55 @@ +From 1eab7e69e2ba84244f551f6901f4307a687a9504 Mon Sep 17 00:00:00 2001 +From: Illia Polishchuk +Date: Tue, 28 Feb 2023 16:07:59 +0200 +Subject: [PATCH] glx: fix indirect initialization crash + +Fixes: b090246a ("glx: Only compute client GL extensions for indirect contexts") +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393 + +Reviewed-by: Adam Jackson + +Signed-off-by: Illia Polishchuk +Part-of: +--- + src/glx/glxext.c | 9 ++++++++- + src/glx/indirect_glx.c | 1 - + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/glx/glxext.c b/src/glx/glxext.c +index 755a75ab568..4b3496b5a14 100644 +--- a/src/glx/glxext.c ++++ b/src/glx/glxext.c +@@ -813,10 +813,17 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) + if (psc == NULL) + psc = applegl_create_screen(i, priv); + #else ++ bool indirect = false; + if (psc == NULL) +- psc = indirect_create_screen(i, priv); ++ { ++ psc = indirect_create_screen(i, priv); ++ indirect = true; ++ } + #endif + priv->screens[i] = psc; ++ ++ if(indirect) /* Load extensions required only for indirect glx */ ++ glxSendClientInfo(priv, i); + } + SyncHandle(); + return GL_TRUE; +diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c +index dc3464fc99e..abe561f700b 100644 +--- a/src/glx/indirect_glx.c ++++ b/src/glx/indirect_glx.c +@@ -365,7 +365,6 @@ indirect_create_screen(int screen, struct glx_display * priv) + return NULL; + + glx_screen_init(psc, screen, priv); +- glxSendClientInfo(priv, screen); + psc->vtable = &indirect_screen_vtable; + + return psc; +-- +2.35.3 + diff --git a/n_Revert-glx-Only-compute-client-GL-extensions-for-ind.patch b/n_Revert-glx-Only-compute-client-GL-extensions-for-ind.patch deleted file mode 100644 index 6c782d1..0000000 --- a/n_Revert-glx-Only-compute-client-GL-extensions-for-ind.patch +++ /dev/null @@ -1,245 +0,0 @@ -From b0a48acb467959be05008f0d2603c89d51a9c4c8 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Mon, 27 Feb 2023 16:17:29 +0100 -Subject: [PATCH] Revert "glx: Only compute client GL extensions for indirect - contexts" - -This reverts commit b090246ad27457bc48ea8f5dbe8213f5899efa22. ---- - src/glx/clientinfo.c | 10 +++++++--- - src/glx/glxclient.h | 3 ++- - src/glx/glxext.c | 2 +- - src/glx/glxextensions.c | 5 +---- - src/glx/glxextensions.h | 2 +- - src/glx/indirect_glx.c | 1 - - src/glx/tests/clientinfo_unittest.cpp | 28 +++++++++++++-------------- - 7 files changed, 26 insertions(+), 25 deletions(-) - -diff --git a/src/glx/clientinfo.c b/src/glx/clientinfo.c -index 31c62ad989f..a7853ff8aa3 100644 ---- a/src/glx/clientinfo.c -+++ b/src/glx/clientinfo.c -@@ -28,8 +28,8 @@ - #include - #include - --void --glxSendClientInfo(struct glx_display *glx_dpy, int screen) -+_X_HIDDEN void -+__glX_send_client_info(struct glx_display *glx_dpy) - { - const unsigned ext_length = strlen("GLX_ARB_create_context"); - const unsigned prof_length = strlen("_profile"); -@@ -152,7 +152,11 @@ glxSendClientInfo(struct glx_display *glx_dpy, int screen) - } - } - -- gl_extension_string = __glXGetClientGLExtensionString(screen); -+ gl_extension_string = __glXGetClientGLExtensionString(); -+ if (gl_extension_string == NULL) { -+ return; -+ } -+ - gl_extension_length = strlen(gl_extension_string) + 1; - - c = XGetXCBConnection(glx_dpy->dpy); -diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h -index ad0f37b258a..8eda47988b4 100644 ---- a/src/glx/glxclient.h -+++ b/src/glx/glxclient.h -@@ -706,7 +706,8 @@ extern void __glEmptyImage(struct glx_context *, GLint, GLint, GLint, GLint, GLe - extern void __glXInitVertexArrayState(struct glx_context *); - extern void __glXFreeVertexArrayState(struct glx_context *); - --extern void glxSendClientInfo(struct glx_display *glx_dpy, int screen); -+_X_HIDDEN void -+__glX_send_client_info(struct glx_display *glx_dpy); - - /************************************************************************/ - -diff --git a/src/glx/glxext.c b/src/glx/glxext.c -index b1b98a9fadd..cc59004ccff 100644 ---- a/src/glx/glxext.c -+++ b/src/glx/glxext.c -@@ -929,7 +929,7 @@ __glXInitialize(Display * dpy) - return NULL; - } - -- glxSendClientInfo(dpyPriv, -1); -+ __glX_send_client_info(dpyPriv); - - /* Grab the lock again and add the dispay private, unless somebody - * beat us to initializing on this display in the meantime. */ -diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c -index b731042cde7..cf2d9e04fef 100644 ---- a/src/glx/glxextensions.c -+++ b/src/glx/glxextensions.c -@@ -762,10 +762,7 @@ __glXCalculateUsableGLExtensions(struct glx_context * gc, - * supported by the client to the server. - */ - char * --__glXGetClientGLExtensionString(int screen) -+__glXGetClientGLExtensionString(void) - { -- if (screen < 0) -- return strdup(""); -- - return __glXGetStringFromTable(known_gl_extensions, NULL); - } -diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h -index 3523998babd..78658003fb4 100644 ---- a/src/glx/glxextensions.h -+++ b/src/glx/glxextensions.h -@@ -269,7 +269,7 @@ extern void __IndirectGlParseExtensionOverride(struct glx_screen *psc, - const char *override); - extern void __glXCalculateUsableGLExtensions(struct glx_context *gc, - const char *server_string); --extern char *__glXGetClientGLExtensionString(int screen); -+extern char *__glXGetClientGLExtensionString(void); - - extern GLboolean __glExtensionBitIsEnabled(struct glx_context *gc, - unsigned bit); -diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c -index 80e95f6754e..ffdfec48d8b 100644 ---- a/src/glx/indirect_glx.c -+++ b/src/glx/indirect_glx.c -@@ -383,7 +383,6 @@ indirect_create_screen(int screen, struct glx_display * priv) - return NULL; - - glx_screen_init(psc, screen, priv); -- glxSendClientInfo(priv, screen); - psc->vtable = &indirect_screen_vtable; - - return psc; -diff --git a/src/glx/tests/clientinfo_unittest.cpp b/src/glx/tests/clientinfo_unittest.cpp -index f7a147e3f7a..0202768cf11 100644 ---- a/src/glx/tests/clientinfo_unittest.cpp -+++ b/src/glx/tests/clientinfo_unittest.cpp -@@ -210,7 +210,7 @@ xcb_glx_set_client_info_2arb(xcb_connection_t *c, - } - - extern "C" char * --__glXGetClientGLExtensionString(int screen) -+__glXGetClientGLExtensionString() - { - char *str = (char *) malloc(sizeof(ext)); - -@@ -279,7 +279,7 @@ glX_send_client_info_test::common_protocol_expected_false_test(unsigned major, - bool *value) - { - create_single_screen_display(major, minor, glx_ext); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - EXPECT_FALSE(*value); - } - -@@ -290,7 +290,7 @@ glX_send_client_info_test::common_protocol_expected_true_test(unsigned major, - bool *value) - { - create_single_screen_display(major, minor, glx_ext); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - EXPECT_TRUE(*value); - } - -@@ -494,14 +494,14 @@ TEST_F(glX_send_client_info_test, does_send_SetClientInfo2ARB_for_1_4_with_both_ - TEST_F(glX_send_client_info_test, uses_correct_connection) - { - create_single_screen_display(1, 1, ""); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - EXPECT_EQ((xcb_connection_t *) 0xdeadbeef, connection_used); - } - - TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string) - { - create_single_screen_display(1, 1, ""); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - ASSERT_EQ((int) sizeof(ext), gl_ext_length); - ASSERT_NE((char *) 0, gl_ext_string); -@@ -511,7 +511,7 @@ TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string) - TEST_F(glX_send_client_info_test, gl_versions_are_sane) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - ASSERT_NE(0, num_gl_versions); - -@@ -552,7 +552,7 @@ TEST_F(glX_send_client_info_test, gl_versions_are_sane) - TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - ASSERT_NE(0, num_gl_versions); - -@@ -621,7 +621,7 @@ TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane) - TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1) - { - create_single_screen_display(1, 1, ""); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - EXPECT_EQ(1, glx_major); - EXPECT_EQ(4, glx_minor); -@@ -630,7 +630,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1) - TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4) - { - create_single_screen_display(1, 4, ""); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - EXPECT_EQ(1, glx_major); - EXPECT_EQ(4, glx_minor); -@@ -639,7 +639,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4) - TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - EXPECT_EQ(1, glx_major); - EXPECT_EQ(4, glx_minor); -@@ -648,7 +648,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con - TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context_profile) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - EXPECT_EQ(1, glx_major); - EXPECT_EQ(4, glx_minor); -@@ -657,7 +657,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con - TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5) - { - create_single_screen_display(1, 5, ""); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - EXPECT_EQ(1, glx_major); - EXPECT_EQ(4, glx_minor); -@@ -666,7 +666,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5) - TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - ASSERT_NE(0, glx_ext_length); - ASSERT_NE((char *) 0, glx_ext_string); -@@ -692,7 +692,7 @@ TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context) - TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context_profile) - { - create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); -- glxSendClientInfo(this->glx_dpy, -1); -+ __glX_send_client_info(this->glx_dpy); - - ASSERT_NE(0, glx_ext_length); - ASSERT_NE((char *) 0, glx_ext_string); --- -2.39.2 -