etnaviv: blt: Add sRGB support to blt_imginfo

Add sRGB field to blt_imginfo and use it to conditionally set the
BLT_SRC_IMAGE_CONFIG_SRGB and BLT_DEST_IMAGE_CONFIG_SRGB bits in
the BLT config register setup.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39879>
This commit is contained in:
Christian Gmeiner 2026-02-04 14:16:56 +01:00 committed by Marge Bot
parent dfc608260a
commit 4cb7c63f21
2 changed files with 3 additions and 0 deletions

View file

@ -83,6 +83,7 @@ blt_compute_dest_img_config_bits(const struct blt_imginfo *img)
COND(img->use_ts && img->ts_compress_fmt >= 0, BLT_DEST_IMAGE_CONFIG_COMPRESSION) |
BLT_DEST_IMAGE_CONFIG_COMPRESSION_FORMAT(img->ts_compress_fmt) |
BLT_DEST_IMAGE_CONFIG_UNK22 |
COND(img->srgb, BLT_DEST_IMAGE_CONFIG_SRGB) |
BLT_DEST_IMAGE_CONFIG_SWIZ_R(img->swizzle[0]) |
BLT_DEST_IMAGE_CONFIG_SWIZ_G(img->swizzle[1]) |
BLT_DEST_IMAGE_CONFIG_SWIZ_B(img->swizzle[2]) |
@ -97,6 +98,7 @@ blt_compute_src_img_config_bits(const struct blt_imginfo *img)
COND(img->use_ts, BLT_SRC_IMAGE_CONFIG_TS) |
COND(img->use_ts && img->ts_compress_fmt >= 0, BLT_SRC_IMAGE_CONFIG_COMPRESSION) |
BLT_SRC_IMAGE_CONFIG_COMPRESSION_FORMAT(img->ts_compress_fmt) |
COND(img->srgb, BLT_SRC_IMAGE_CONFIG_SRGB) |
BLT_SRC_IMAGE_CONFIG_SWIZ_R(img->swizzle[0]) |
BLT_SRC_IMAGE_CONFIG_SWIZ_G(img->swizzle[1]) |
BLT_SRC_IMAGE_CONFIG_SWIZ_B(img->swizzle[2]) |

View file

@ -41,6 +41,7 @@ struct blt_imginfo
unsigned downsample_x : 1; /* Downsample in x direction */
unsigned downsample_y : 1; /* Downsample in y direction */
unsigned use_ts:1;
unsigned srgb : 1;
struct etna_reloc addr;
struct etna_reloc ts_addr;
uint32_t format; /* BLT_FORMAT_* */