From 5ef6da21d91a2ec47b229d1a702c1095dfd084b6 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Fri, 9 Jun 2023 19:06:59 +0200 Subject: [PATCH] etnaviv: query: correct max number of occlusion query samples The real maximium for the occlusion query 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_occlusion.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc_occlusion.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc_occlusion.c index 9b596dd7e04..c79b447db76 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_acc_occlusion.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc_occlusion.c @@ -36,6 +36,8 @@ #include "etnaviv_query_acc.h" #include "etnaviv_screen.h" +#define MAX_OQ_SAMPLES 511 /* 4KB / 8Bytes/sample */ + /* * Occlusion Query: * @@ -73,8 +75,8 @@ occlusion_resume(struct etna_acc_query *aq, struct etna_context *ctx) .flags = ETNA_RELOC_WRITE }; - if (aq->samples > 63) { - aq->samples = 63; + if (aq->samples > MAX_OQ_SAMPLES) { + aq->samples = MAX_OQ_SAMPLES; BUG("samples overflow"); }