From 80cd669a320fa0666d50f8427980401136f8f667 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 6 Feb 2018 17:29:32 +0000 Subject: [PATCH] i965: perf: default case for unknown query types Just some extra safety before further changes. Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Reviewed-by: Jason Ekstrand --- .../drivers/dri/i965/brw_performance_query.c | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index 613e61653fe..8cb9d8277aa 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -341,6 +341,9 @@ dump_perf_query_callback(GLuint id, void *query_void, void *brw_void) o->Active ? "Active," : (o->Ready ? "Ready," : "Pending,"), obj->pipeline_stats.bo ? "yes" : "no"); break; + default: + unreachable("Unknown query type"); + break; } } @@ -437,6 +440,10 @@ brw_get_perf_query_info(struct gl_context *ctx, case PIPELINE_STATS: *n_active = brw->perfquery.n_active_pipeline_stats_queries; break; + + default: + unreachable("Unknown query type"); + break; } } @@ -1265,6 +1272,10 @@ brw_begin_perf_query(struct gl_context *ctx, ++brw->perfquery.n_active_pipeline_stats_queries; break; + + default: + unreachable("Unknown query type"); + break; } if (INTEL_DEBUG & DEBUG_PERFMON) @@ -1321,6 +1332,10 @@ brw_end_perf_query(struct gl_context *ctx, STATS_BO_END_OFFSET_BYTES); --brw->perfquery.n_active_pipeline_stats_queries; break; + + default: + unreachable("Unknown query type"); + break; } } @@ -1341,6 +1356,10 @@ brw_wait_perf_query(struct gl_context *ctx, struct gl_perf_query_object *o) case PIPELINE_STATS: bo = obj->pipeline_stats.bo; break; + + default: + unreachable("Unknown query type"); + break; } if (bo == NULL) @@ -1386,9 +1405,12 @@ brw_is_perf_query_ready(struct gl_context *ctx, return (obj->pipeline_stats.bo && !brw_batch_references(&brw->batch, obj->pipeline_stats.bo) && !brw_bo_busy(obj->pipeline_stats.bo)); + + default: + unreachable("Unknown query type"); + break; } - unreachable("missing ready check for unknown query kind"); return false; } @@ -1502,6 +1524,10 @@ brw_get_perf_query_data(struct gl_context *ctx, case PIPELINE_STATS: written = get_pipeline_stats_data(brw, obj, data_size, (uint8_t *)data); break; + + default: + unreachable("Unknown query type"); + break; } if (bytes_written) @@ -1567,6 +1593,10 @@ brw_delete_perf_query(struct gl_context *ctx, obj->pipeline_stats.bo = NULL; } break; + + default: + unreachable("Unknown query type"); + break; } free(obj); -- 2.30.2