etnaviv: add multiply_with_8 flag

There are some HW counters that are exposing things in terms of 8bytes bundles.
From a user PoV those counters would be much more useful if we do the scaling
to single bytes internally.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7398>
This commit is contained in:
Christian Gmeiner
2022-01-28 20:49:56 +01:00
committed by Marge Bot
parent 17d143231b
commit d0a5129fde
2 changed files with 6 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ struct etna_perfmon_config
unsigned type;
unsigned group_id;
const struct etna_perfmon_source *source;
bool multiply_with_8;
};
struct etna_perfmon_signal *

View File

@@ -39,6 +39,7 @@ struct etna_pm_query
struct etna_perfmon_signal *signal;
unsigned sequence;
bool multiply_with_8;
};
static inline struct etna_pm_query *
@@ -116,6 +117,7 @@ perfmon_allocate(struct etna_context *ctx, unsigned query_type)
return NULL;
pm_add_signal(pq, ctx->screen->perfmon, cfg);
pq->multiply_with_8 = cfg->multiply_with_8;
return &pq->base;
}
@@ -155,6 +157,9 @@ perfmon_result(struct etna_acc_query *aq, void *buf,
result->u32 = sum;
if (pq->multiply_with_8)
result->u32 *= 8;
return true;
}