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 <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23557>
This commit is contained in:
Lucas Stach 2023-06-09 19:03:33 +02:00 committed by Marge Bot
parent f33a4fa602
commit 3d98e9c2e0

View file

@ -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");
}