unsigned
panfrost_query_thread_tls_alloc(int fd)
{
- /* On older kernels, we worst-case to 1024 threads, the architectural
- * maximum for Midgard */
+ /* On older kernels, we worst-case to 256 threads, the architectural
+ * maximum for Midgard. On my current kernel/hardware, I'm seeing this
+ * readback as 0, so we'll worst-case there too */
- return panfrost_query_raw(fd,
- DRM_PANFROST_PARAM_THREAD_TLS_ALLOC, false, 1024);
+ unsigned tls = panfrost_query_raw(fd,
+ DRM_PANFROST_PARAM_THREAD_TLS_ALLOC, false, 256);
+
+ if (tls)
+ return tls;
+ else
+ return 256;
}
/* Given a GPU ID like 0x860, return a prettified model name */
* must allocate for, and DRM_PANFROST_PARAM_SHADER_PRESENT for a bitmask of
* shader cores (so take a popcount of that mask for the number of shader
* cores). On older kernels that do not support querying these values,
- * following kbase, we may use the worst-case value of 1024 threads for
+ * following kbase, we may use the worst-case value of 256 threads for
* THREAD_TLS_ALLOC, and the worst-case value of 16 cores for Midgard per the
* "shader core count" column of the implementations table in
* https://en.wikipedia.org/wiki/Mali_%28GPU% [citation needed]