From c2053c5363973435dddbc50aef3a632b7dd01979 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Thu, 25 Apr 2024 09:42:01 +0200
Subject: [PATCH] etnaviv: Allow collecing both GPU and NPU specs
If the primary core is a GPU, but a separate NPU exists, collect
NPU specs in addition to GPU specs.
Signed-off-by: Philipp Zabel
Reviewed-by: Christian Gmeiner
Part-of:
---
src/gallium/drivers/etnaviv/etnaviv_screen.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
index 17d5af72cd204..1b28d0dd6bb0e 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
@@ -858,7 +858,12 @@ etna_get_specs(struct etna_screen *screen)
screen->specs.pixel_pipes = info->gpu.pixel_pipes;
screen->specs.num_constants = info->gpu.num_constants;
screen->specs.max_varyings = MIN2(info->gpu.max_varyings, ETNA_NUM_VARYINGS);
- } else {
+
+ if (screen->npu)
+ info = etna_gpu_get_core_info(screen->npu);
+ }
+
+ if (info->type == ETNA_CORE_NPU) {
screen->specs.nn_core_count = info->npu.nn_core_count;
screen->specs.nn_mad_per_core = info->npu.nn_mad_per_core;
screen->specs.tp_core_count = info->npu.tp_core_count;