Module: Mesa Branch: staging/23.0 Commit: d6c199ae152fdd1a573273697789b45809559fef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6c199ae152fdd1a573273697789b45809559fef
Author: Emma Anholt <[email protected]> Date: Thu Jan 12 10:43:06 2023 -0800 dri2: Fix exposing robustness with swkms. In the original change I noticed that missing robustness on swkms seemed to be an oversight, since it was enabled on sw-non-kms, so I exposed the ext based on the underlying pipe query. However it turns out that there is a dri_screen flag for allowing robust contexts that exists to do error checking for GLX, which was under an !swkms check. So we would expose the ext, but then throw an error if you tried to create one. Fixes: e6285ea55fb2 ("egl: Replace the robustness DRI2 ext check with a pipe cap query.") Closes: #8066 Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20679> (cherry picked from commit 6b0db6bf8b5467fd1f357bbacd6750a26d089517) --- .pick_status.json | 2 +- src/gallium/frontends/dri/dri2.c | 8 ++++---- src/gallium/frontends/dri/dri_context.c | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 90ba6c802e8..f2e3fd6a09d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -589,7 +589,7 @@ "description": "dri2: Fix exposing robustness with swkms.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e6285ea55fb2abf3b38f40ea0c3a69c2b6d7d8e5" }, diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index f6e3bf72c78..b66f9d69142 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -2246,11 +2246,11 @@ dri2_init_screen_extensions(struct dri_screen *screen, screen->buffer_damage_extension.set_damage_region = dri2_set_damage_region; *nExt++ = &screen->buffer_damage_extension.base; + } - if (pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) { - *nExt++ = &dri2Robustness.base; - screen->has_reset_status_query = true; - } + if (pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) { + *nExt++ = &dri2Robustness.base; + screen->has_reset_status_query = true; } /* Ensure the extension list didn't overrun its buffer and is still diff --git a/src/gallium/frontends/dri/dri_context.c b/src/gallium/frontends/dri/dri_context.c index 7676f55aedc..b74fa579bf4 100644 --- a/src/gallium/frontends/dri/dri_context.c +++ b/src/gallium/frontends/dri/dri_context.c @@ -63,6 +63,11 @@ dri_create_context(struct dri_screen *screen, screen->dri2.backgroundCallable; const struct driOptionCache *optionCache = &screen->dev->option_cache; + /* This is effectively doing error checking for GLX context creation (by both + * Mesa and the X server) when the driver doesn't support the robustness ext. + * EGL already checks, so it won't send us the flags if the ext isn't + * available. + */ if (screen->has_reset_status_query) { allowed_flags |= __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS; allowed_attribs |= __DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY;
