iris: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Mon, 27 Jul 2020 19:10:25 +0000 (21:10 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 10:44:41 +0000 (10:44 +0000)
Otherwise mesa will crash in glEndPerfQueryINTEL because OA BO is NULL.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6094>

src/gallium/drivers/iris/iris_performance_query.c
src/gallium/include/pipe/p_context.h
src/mesa/state_tracker/st_cb_perfquery.c

index dbe649c27628891b7cc4a47be23d91d8a72edac5..1e8e1d9201aa7d231d5fb0900ed98cd3ad9d4293 100644 (file)
@@ -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
index 1869d22ad47607f61578eb3dfbbc50aab40273ee..f17bf2d3fc89a942c5b37099bf22ed99b85c15aa 100644 (file)
@@ -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);
 
index b405703e31185789fa6b8b58b017533183b19541..1bafc272c2dbef3f3b0a5a75634adcbf159c57e6 100644 (file)
@@ -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