Mesa (staging/20.1): iris: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 29 11:33:13 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 5dfa11e79ccf79b1f6fce32dad0e83e6bd1c5e80
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5dfa11e79ccf79b1f6fce32dad0e83e6bd1c5e80

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Mon Jul 27 21:10:25 2020 +0200

iris: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL

Otherwise mesa will crash in glEndPerfQueryINTEL because OA BO is NULL.

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6094>
(cherry picked from commit 627c01977c29d142d5024591bf910a1ed92814c9)

---

 .pick_status.json                                 | 2 +-
 src/gallium/drivers/iris/iris_performance_query.c | 4 ++--
 src/gallium/include/pipe/p_context.h              | 2 +-
 src/mesa/state_tracker/st_cb_perfquery.c          | 4 +---
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index a7ae4d96040..78e748b1c01 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -229,7 +229,7 @@
         "description": "iris: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c
index 825f4c44268..0192635601a 100644
--- a/src/gallium/drivers/iris/iris_performance_query.c
+++ b/src/gallium/drivers/iris/iris_performance_query.c
@@ -97,7 +97,7 @@ iris_new_perf_query_obj(struct pipe_context *pipe, unsigned query_index)
    return (struct pipe_query *)&q->base;
 }
 
-static void
+static bool
 iris_begin_perf_query(struct pipe_context *pipe, struct pipe_query *q)
 {
    struct iris_context *ice = (void *) pipe;
@@ -105,7 +105,7 @@ iris_begin_perf_query(struct pipe_context *pipe, struct pipe_query *q)
    struct gen_perf_query_object *obj = perf_query->query;
    struct gen_perf_context *perf_ctx = ice->perf_ctx;
 
-   gen_perf_begin_query(perf_ctx, obj);
+   return gen_perf_begin_query(perf_ctx, obj);
 }
 
 static void
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 37957466ded..1926feff342 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -219,7 +219,7 @@ struct pipe_context {
    struct pipe_query *(*new_intel_perf_query_obj)(struct pipe_context *pipe,
                                                  unsigned query_index);
 
-   void (*begin_intel_perf_query)(struct pipe_context *pipe, struct pipe_query *q);
+   bool (*begin_intel_perf_query)(struct pipe_context *pipe, struct pipe_query *q);
 
    void (*end_intel_perf_query)(struct pipe_context *pipe, struct pipe_query *q);
 
diff --git a/src/mesa/state_tracker/st_cb_perfquery.c b/src/mesa/state_tracker/st_cb_perfquery.c
index b405703e311..1bafc272c2d 100644
--- a/src/mesa/state_tracker/st_cb_perfquery.c
+++ b/src/mesa/state_tracker/st_cb_perfquery.c
@@ -152,9 +152,7 @@ st_BeginPerfQuery(struct gl_context *ctx, struct gl_perf_query_object *o)
    assert(!o->Active);
    assert(!o->Used || o->Ready); /* no in-flight query to worry about */
 
-   pipe->begin_intel_perf_query(pipe, (struct pipe_query *)o);
-
-   return true;
+   return pipe->begin_intel_perf_query(pipe, (struct pipe_query *)o);
 }
 
 static void



More information about the mesa-commit mailing list