From 1637fa3d85756be4926d1d77f402540a4a07946e Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 26 Sep 2024 19:22:57 +0200 Subject: [PATCH] panfrost: store texfeat_bit in panfrost_format To avoid increasing memory usage, make sure we pack this together with the hw format. This will be used in the next commit. Fixes: 0c1fde956bf ("panfrost: Add Valhall compressed formats") Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/lib/pan_format.c | 2 ++ src/panfrost/lib/pan_format.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panfrost/lib/pan_format.c b/src/panfrost/lib/pan_format.c index 74f9e741ab0..28fac18fda1 100644 --- a/src/panfrost/lib/pan_format.c +++ b/src/panfrost/lib/pan_format.c @@ -149,6 +149,7 @@ const struct pan_blendable_format [PIPE_FORMAT_##pipe] = { \ .hw = MALI_PACK_FMT(texfeat, swizzle, srgb), \ .bind = PAN_BIND_SAMPLER_VIEW, \ + .texfeat_bit = MALI_##texfeat, \ } #else /* Map to interchange format, as compression is specified in the plane @@ -158,6 +159,7 @@ const struct pan_blendable_format [PIPE_FORMAT_##pipe] = { \ .hw = MALI_PACK_FMT(interchange, swizzle, srgb), \ .bind = PAN_BIND_SAMPLER_VIEW, \ + .texfeat_bit = MALI_##texfeat, \ } #endif diff --git a/src/panfrost/lib/pan_format.h b/src/panfrost/lib/pan_format.h index ffb3d9a78ab..d97cd2f42aa 100644 --- a/src/panfrost/lib/pan_format.h +++ b/src/panfrost/lib/pan_format.h @@ -43,7 +43,8 @@ typedef uint32_t mali_pixel_format; #define PAN_BIND_VERTEX_BUFFER (1 << 4) struct panfrost_format { - mali_pixel_format hw; + uint32_t hw : 22; + uint32_t texfeat_bit : 5; unsigned bind; };