Mesa (staging/22.1): crocus: fail query begin if upload allocation fails.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 28 16:40:29 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: f0a8da08198e8b3e7b3760400ae2f4c82a9c0922
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0a8da08198e8b3e7b3760400ae2f4c82a9c0922

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jul 19 15:46:14 2022 +1000

crocus: fail query begin if upload allocation fails.

This is the only place I think I can see this crashing.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17615>
(cherry picked from commit e14022c05255edafbb4db7df71379ba2f6964bae)

---

 .pick_status.json                         | 2 +-
 src/gallium/drivers/crocus/crocus_query.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 140b684bb20..2d5c5f7e121 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3910,7 +3910,7 @@
         "description": "crocus: fail query begin if upload allocation fails.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/crocus/crocus_query.c b/src/gallium/drivers/crocus/crocus_query.c
index 677affd7513..576b1383ea8 100644
--- a/src/gallium/drivers/crocus/crocus_query.c
+++ b/src/gallium/drivers/crocus/crocus_query.c
@@ -542,6 +542,8 @@ crocus_begin_query(struct pipe_context *ctx, struct pipe_query *query)
                   size, size, &q->query_state_ref.offset,
                   &q->query_state_ref.res, &ptr);
 
+   if (!q->query_state_ref.res)
+      return false;
    if (!crocus_resource_bo(q->query_state_ref.res))
       return false;
 



More information about the mesa-commit mailing list