Module: Mesa
Branch: main
Commit: d0a5129fdee2f2e97fcc0373d22e36069a880e6e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0a5129fdee2f2e97fcc0373d22e36069a880e6e

Author: Christian Gmeiner <[email protected]>
Date:   Fri Jan 28 20:49:56 2022 +0100

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 <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7398>

---

 src/gallium/drivers/etnaviv/etnaviv_perfmon.h           | 1 +
 src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_perfmon.h 
b/src/gallium/drivers/etnaviv/etnaviv_perfmon.h
index bd658d46e39..056fed0d3af 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_perfmon.h
+++ b/src/gallium/drivers/etnaviv/etnaviv_perfmon.h
@@ -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 *
diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c 
b/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c
index 7c49fc88fad..72fa7776915 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c
@@ -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;
 }
 

Reply via email to