From 6761dbf8915d16d1408ac9b3d85751d0991f542c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 3 May 2022 16:34:52 -0400 Subject: [PATCH] panfrost: Use packed TLS on Valhall 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 Part-of: --- src/panfrost/lib/pan_cs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/panfrost/lib/pan_cs.c b/src/panfrost/lib/pan_cs.c index 880bb1878a8..ab05585abee 100644 --- a/src/panfrost/lib/pan_cs.c +++ b/src/panfrost/lib/pan_cs.c @@ -484,7 +484,19 @@ GENX(pan_emit_tls)(const struct pan_tls_info *info, 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) {