etnaviv: Add nn_core_version field to etna_specs

Use the NN_XYDP0 and NN_VIP7 feature flags to determine the NN core
version [1] and store it in etna_specs.

[1] https://github.com/nxp-imx/linux-imx/blob/lf-6.1.36-2.1.0/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware_func.c#L5464-L5465

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28878>
This commit is contained in:
Philipp Zabel 2024-04-23 15:23:59 +02:00 committed by Marge Bot
parent db2d5a0103
commit c2290843df
2 changed files with 9 additions and 0 deletions

View file

@ -145,6 +145,8 @@ struct etna_specs {
unsigned num_constants;
/* number of NN cores */
unsigned nn_core_count;
/* architecture version of NN cores */
unsigned nn_core_version;
/* number of MAD units per NN core */
unsigned nn_mad_per_core;
/* number of TP cores */

View file

@ -859,6 +859,13 @@ etna_get_specs(struct etna_screen *screen)
screen->specs.on_chip_sram_size = info->npu.on_chip_sram_size;
screen->specs.axi_sram_size = info->npu.axi_sram_size;
screen->specs.nn_zrl_bits = info->npu.nn_zrl_bits;
if (etna_core_has_feature(info, ETNA_FEATURE_NN_XYDP0))
screen->specs.nn_core_version = 8;
else if (etna_core_has_feature(info, ETNA_FEATURE_VIP_V7))
screen->specs.nn_core_version = 7;
else
screen->specs.nn_core_version = 6;
}
/* Figure out gross GPU architecture. See rnndb/common.xml for a specific