From d60415bad5d37d94517a795af05e07ed0e9d1763 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 8 Aug 2023 15:10:08 +0100 Subject: [PATCH] dri/kopper: Add translations for sRGB formats There was DRI_IMAGE_FORMAT -> FourCC format translation, but this was unreachable as we only ever called image_format_to_fourcc() on the result of get_dri_format(). Part-of: --- src/gallium/frontends/dri/kopper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index b5980af84ad..a2fb8896374 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -186,6 +186,15 @@ get_dri_format(enum pipe_format pf) { int image_format; switch (pf) { + case PIPE_FORMAT_BGRA8888_SRGB: + image_format = __DRI_IMAGE_FORMAT_SARGB8; + break; + case PIPE_FORMAT_BGRX8888_SRGB: + image_format = __DRI_IMAGE_FORMAT_SXRGB8; + break; + case PIPE_FORMAT_RGBA8888_SRGB: + image_format = __DRI_IMAGE_FORMAT_SABGR8; + break; case PIPE_FORMAT_R16G16B16A16_FLOAT: image_format = __DRI_IMAGE_FORMAT_ABGR16161616F; break;