panfrost: Fix TLS sizing if cores are missing
I have no idea if there are any implementations we care about that have missing shader cores (a mask of 1101 or something like that), but if one crops up, this would be a royal pain to debug so let's just get it right... Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8723>
This commit is contained in:
parent
26b009b054
commit
a5780cdb9b
|
@ -91,7 +91,13 @@ panfrost_query_core_count(int fd)
|
||||||
unsigned mask = panfrost_query_raw(fd,
|
unsigned mask = panfrost_query_raw(fd,
|
||||||
DRM_PANFROST_PARAM_SHADER_PRESENT, false, 0xffff);
|
DRM_PANFROST_PARAM_SHADER_PRESENT, false, 0xffff);
|
||||||
|
|
||||||
return util_bitcount(mask);
|
/* Some cores might be absent. For TLS computation purposes, we care
|
||||||
|
* about the greatest ID + 1, which equals the core count if all cores
|
||||||
|
* are present, but allocates space for absent cores if needed.
|
||||||
|
* util_last_bit is defined to return the greatest bit set + 1, which
|
||||||
|
* is exactly what we need. */
|
||||||
|
|
||||||
|
return util_last_bit(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Architectural maximums, since this register may be not implemented
|
/* Architectural maximums, since this register may be not implemented
|
||||||
|
|
Loading…
Reference in New Issue