From 3d98e9c2e0cf33b18046bd0fe3da711ecceca345 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Fri, 9 Jun 2023 19:03:33 +0200 Subject: [PATCH] etnaviv: query: correct max number of perfmon samples The real maximium for the perfmon samples is much higher than what the code currently claims to support as we always allocate a full 4KB buffer to store the query results. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c index e9747730ca5..b6a9eb0caa3 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c @@ -33,6 +33,8 @@ #include "etnaviv_emit.h" #include "etnaviv_query_acc.h" +#define MAX_PERFMON_SAMPLES 1022 /* (4KB / 4Byte/sample) - 1 reserved seqno */ + struct etna_pm_query { struct etna_acc_query base; @@ -65,8 +67,8 @@ pm_query(struct etna_context *ctx, struct etna_acc_query *aq, unsigned flags) unsigned offset; assert(flags); - if (aq->samples > 127) { - aq->samples = 127; + if (aq->samples > MAX_PERFMON_SAMPLES) { + aq->samples = MAX_PERFMON_SAMPLES; BUG("samples overflow perfmon"); }