egl: Replace the robustness DRI2 ext check with a pipe cap query.
authorEmma Anholt <emma@anholt.net>
Wed, 30 Nov 2022 23:23:56 +0000 (15:23 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 9 Dec 2022 05:32:18 +0000 (05:32 +0000)
This means that swkms will now report it with llvmpipe.  drisw reported it
with llvmpipe, and it appears to have been an oversight that got
refactored into an obvious "if !swkms" check later.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>

src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h

index 95052cb..9321e60 100644 (file)
@@ -736,7 +736,6 @@ static const struct dri_extension_match swrast_core_extensions[] = {
 };
 
 static const struct dri_extension_match optional_core_extensions[] = {
-   { __DRI2_ROBUSTNESS, 1, offsetof(struct dri2_egl_display, robustness), true },
    { __DRI2_CONFIG_QUERY, 1, offsetof(struct dri2_egl_display, config), true },
    { __DRI2_FENCE, 2, offsetof(struct dri2_egl_display, fence), true },
    { __DRI2_BUFFER_DAMAGE, 1, offsetof(struct dri2_egl_display, buffer_damage), true },
@@ -892,8 +891,7 @@ dri2_setup_screen(_EGLDisplay *disp)
                                    __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB))
       disp->Extensions.KHR_gl_colorspace = EGL_TRUE;
 
-   if (dri2_dpy->robustness)
-      disp->Extensions.EXT_create_context_robustness = EGL_TRUE;
+   disp->Extensions.EXT_create_context_robustness = get_screen_param(disp, PIPE_CAP_DEVICE_RESET_STATUS_QUERY);
 
    if (dri2_dpy->fence) {
       disp->Extensions.KHR_fence_sync = EGL_TRUE;
index e4c1587..6d206d3 100644 (file)
@@ -236,7 +236,6 @@ struct dri2_egl_display
    const __DRI2flushControlExtension *flush_control;
    const __DRItexBufferExtension *tex_buffer;
    const __DRIimageExtension *image;
-   const __DRIrobustnessExtension *robustness;
    const __DRI2configQueryExtension *config;
    const __DRI2fenceExtension *fence;
    const __DRI2bufferDamageExtension *buffer_damage;