summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Ślusarz <marcin.slusarz@intel.com>2020-07-27 21:10:25 +0200
committerEric Engestrom <eric@engestrom.ch>2020-08-05 22:23:20 +0200
commite650150c812df4381150a5f13d59c6d60c9e657d (patch)
tree7f050ab6b89d03b235fecd0b63ce21a828366adc /src
parent6c1358b0248eb3a07d999ec2d20dab0cc42c25eb (diff)
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> (cherry picked from commit 627c01977c29d142d5024591bf910a1ed92814c9)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_performance_query.c4
-rw-r--r--src/gallium/include/pipe/p_context.h2
-rw-r--r--src/mesa/state_tracker/st_cb_perfquery.c4
3 files changed, 4 insertions, 6 deletions
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