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@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>
diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c
index dbe649c..1e8e1d9 100644
--- a/src/gallium/drivers/iris/iris_performance_query.c
+++ b/src/gallium/drivers/iris/iris_performance_query.c
@@ -97,7 +97,7 @@
    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 @@
    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 1869d22..f17bf2d 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -219,7 +219,7 @@
    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 b405703..1bafc27 100644
--- a/src/mesa/state_tracker/st_cb_perfquery.c
+++ b/src/mesa/state_tracker/st_cb_perfquery.c
@@ -152,9 +152,7 @@
    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