Mesa (master): drisw: add robustness extension support.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 23 00:23:34 UTC 2020


Module: Mesa
Branch: master
Commit: 80f7b58d901859be216e17aaad21d6a9b34ac9ea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=80f7b58d901859be216e17aaad21d6a9b34ac9ea

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jul 20 09:21:06 2020 +1000

drisw: add robustness extension support.

Port the code from dri2 so that drisw drivers can support the
robustness extension

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5971>

---

 src/gallium/frontends/dri/drisw.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c
index fcdc59ceec8..8d7148ef6dc 100644
--- a/src/gallium/frontends/dri/drisw.c
+++ b/src/gallium/frontends/dri/drisw.c
@@ -449,6 +449,10 @@ static __DRIimageExtension driSWImageExtension = {
     .destroyImage = dri2_destroy_image,
 };
 
+static const __DRIrobustnessExtension dri2Robustness = {
+   .base = { __DRI2_ROBUSTNESS, 1 }
+};
+
 /*
  * Backend function for init_screen.
  */
@@ -464,6 +468,18 @@ static const __DRIextension *drisw_screen_extensions[] = {
    NULL
 };
 
+static const __DRIextension *drisw_robust_screen_extensions[] = {
+   &driTexBufferExtension.base,
+   &dri2RendererQueryExtension.base,
+   &dri2ConfigQueryExtension.base,
+   &dri2FenceExtension.base,
+   &dri2NoErrorExtension.base,
+   &dri2Robustness.base,
+   &driSWImageExtension.base,
+   &dri2FlushControlExtension.base,
+   NULL
+};
+
 static const struct drisw_loader_funcs drisw_lf = {
    .get_image = drisw_get_image,
    .put_image = drisw_put_image,
@@ -496,7 +512,7 @@ drisw_init_screen(__DRIscreen * sPriv)
    screen->swrast_no_present = debug_get_option_swrast_no_present();
 
    sPriv->driverPrivate = (void *)screen;
-   sPriv->extensions = drisw_screen_extensions;
+
    if (loader->base.version >= 4) {
       if (loader->putImageShm)
          lf = &drisw_shm_lf;
@@ -515,6 +531,12 @@ drisw_init_screen(__DRIscreen * sPriv)
    if (!configs)
       goto fail;
 
+   if (pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) {
+      sPriv->extensions = drisw_robust_screen_extensions;
+      screen->has_reset_status_query = true;
+   }
+   else
+      sPriv->extensions = drisw_screen_extensions;
    screen->lookup_egl_image = dri2_lookup_egl_image;
 
    return configs;



More information about the mesa-commit mailing list