panfrost/mfbd: Handle PIPE_FORMAT_B10G10R10A2_UNORM
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 5 Jul 2019 22:59:22 +0000 (15:59 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 10 Jul 2019 13:12:08 +0000 (06:12 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_blending.c
src/gallium/drivers/panfrost/pan_mfbd.c

index 9412408bf818651735ecca4a550d63d72fb4ca33..3acda3101c3f65333933b1544d9517cd70afcbd6 100644 (file)
@@ -118,6 +118,10 @@ panfrost_can_fixed_blend(enum pipe_format format)
         /* Certain special formats are, too */
         switch (format) {
                 case PIPE_FORMAT_B5G6R5_UNORM:
+                case PIPE_FORMAT_R10G10B10A2_UNORM:
+                case PIPE_FORMAT_B10G10R10A2_UNORM:
+                case PIPE_FORMAT_R10G10B10X2_UNORM:
+                case PIPE_FORMAT_B10G10R10X2_UNORM:
                         return true;
                 default:
                         return false;
index 731bf0dc45d6f9c4ce878aaa1f5d130636550a6e..9515b6163147e9e67dd2cd09f7ce90907e0d6ab0 100644 (file)
@@ -95,9 +95,14 @@ panfrost_mfbd_format(struct pipe_surface *surf)
                 surf->format == PIPE_FORMAT_R32_FLOAT ||
                 surf->format == PIPE_FORMAT_R32_UINT ||
                 surf->format == PIPE_FORMAT_R32_SINT ||
-                surf->format == PIPE_FORMAT_R10G10B10A2_UNORM ||
                 surf->format == PIPE_FORMAT_R10G10B10A2_UINT;
 
+        bool rgb10_unorm =
+                surf->format == PIPE_FORMAT_R10G10B10A2_UNORM ||
+                surf->format == PIPE_FORMAT_B10G10R10A2_UNORM ||
+                surf->format == PIPE_FORMAT_R10G10B10X2_UNORM ||
+                surf->format == PIPE_FORMAT_B10G10R10X2_UNORM;
+
         bool float_64 =
                 surf->format == PIPE_FORMAT_R32G32_FLOAT ||
                 surf->format == PIPE_FORMAT_R32G32_SINT ||
@@ -127,6 +132,10 @@ panfrost_mfbd_format(struct pipe_surface *surf)
                 fmt.unk1 = 0x84000000;
                 fmt.unk3 = 0x0;
                 fmt.nr_channels = MALI_POSITIVE(2);
+        } else if (rgb10_unorm) {
+                fmt.unk1 = 0x08000000;
+                fmt.unk3 = 0x6;
+                fmt.nr_channels = MALI_POSITIVE(1);
         } else if (float_32) {
                 fmt.unk1 = 0x88000000;
                 fmt.unk3 = 0x0;