panfrost: Specify sRGB in the render target
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Jun 2019 23:19:33 +0000 (16:19 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 18 Jun 2019 16:59:29 +0000 (09:59 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_mfbd.c

index f9a69e47e45a74ccbfb2c3940915c599e58aea75..c082d0b91a3785662ea4d2e9d229c0ae5cf36f19 100644 (file)
@@ -36,7 +36,7 @@ panfrost_mfbd_format(struct pipe_surface *surf)
         const struct util_format_description *desc =
                 util_format_description(surf->texture->format);
 
-        /* Fill in accordingly, defaulting to RGBA8888 (UNORM) */
+        /* Fill in accordingly, defaulting to 8-bit UNORM */
 
         struct mali_rt_format fmt = {
                 .unk1 = 0x4000000,
@@ -48,6 +48,9 @@ panfrost_mfbd_format(struct pipe_surface *surf)
                 .unk4 = 0x8
         };
 
+        if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB)
+                fmt.flags |= MALI_MFBD_FORMAT_SRGB;
+
         /* Set flags for alternative formats */
 
         if (surf->texture->format == PIPE_FORMAT_B5G6R5_UNORM) {