From: Marcin Ślusarz Date: Mon, 27 Jul 2020 19:10:25 +0000 (+0200) Subject: iris: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=627c01977c29d142d5024591bf910a1ed92814c9;p=mesa.git 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 Cc: Reviewed-by: Mark Janes Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c index dbe649c2762..1e8e1d9201a 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 1869d22ad47..f17bf2d3fc8 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