On Mon, 15 Dec 2025 17:14:51 +0000
Lukas Zapolskas <[email protected]> wrote:

> +#define BLK_MASK(x) GENMASK_ULL((x) - 1, 0)
> +
> +static u64 get_sc_mask(struct panthor_device *ptdev)
> +{
> +     const u64 sc_mask = ptdev->gpu_info.shader_present;

Hm, so I've just merged a change to allow overriding this
shader_present with a value loaded from an nvmem cell, meaning the
value returned to userspace no longer matches the number of cores known
by the GPU. I have a local hack to apply such overrides late and keep
panthor_device::gpu_info as the HW state, but this forces us to
be careful about which variant of shader_present we want depending on
the context (in panthor_{fw,sched}.c we want the user value, in
panthor_perf.c, it we want the user value in get_sc_mask(), and the HW
value in get_reserved_sc_blocks()).

> +
> +     return BLK_MASK(hweight64(sc_mask));

I believe this should be sc_mask on v13-, and
BLK_MASK(hweight64(sc_mask)) on v14+.

> +}

Reply via email to