Packed TLS has cache-locality benefits on Valhall, compared to Bifrost's flat
TLS. Valhall does support flat TLS, but requires extra arithmetic in the shader
for correct results. At least until we get to generic pointers (and maybe even
then), we can use packed TLS. So just use packed TLS always for proper spilling.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16314>
panfrost_get_stack_shift(info->tls.size);
cfg.tls_size = shift;
+#if PAN_ARCH >= 9
+ /* For now, always use packed TLS addressing. This is
+ * better for the cache and requires no fix up code in
+ * the shader. We may need to revisit this someday for
+ * OpenCL generic pointer support.
+ */
+ cfg.tls_address_mode = MALI_ADDRESS_MODE_PACKED;
+
+ assert((info->tls.ptr & 4095) == 0);
+ cfg.tls_base_pointer = info->tls.ptr >> 8;
+#else
cfg.tls_base_pointer = info->tls.ptr;
+#endif
}
if (info->wls.size) {