panfrost: RGBA4 and RGB5_A1 framebuffer support
authorIcecream95 <ixn@keemail.me>
Sat, 20 Jun 2020 06:53:33 +0000 (18:53 +1200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Jun 2020 12:15:05 +0000 (12:15 +0000)
Tested with fbo_firecube.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5573>

src/gallium/drivers/panfrost/pan_mfbd.c
src/gallium/drivers/panfrost/pan_sfbd.c
src/panfrost/util/pan_lower_framebuffer.c

index 62d86a678e74dbaebf4de364c9ad91b52a934247..41f21128198fe36624417877d772f43a8e87dea8 100644 (file)
@@ -74,6 +74,7 @@ panfrost_mfbd_format(struct pipe_surface *surf)
 
         case PIPE_FORMAT_A4B4G4R4_UNORM:
         case PIPE_FORMAT_B4G4R4A4_UNORM:
+        case PIPE_FORMAT_R4G4B4A4_UNORM:
                 fmt.unk1 = 0x10000000;
                 fmt.unk3 = 0x5;
                 fmt.nr_channels = MALI_POSITIVE(1);
@@ -89,6 +90,7 @@ panfrost_mfbd_format(struct pipe_surface *surf)
                 break;
 
         case PIPE_FORMAT_B5G5R5A1_UNORM:
+        case PIPE_FORMAT_R5G5B5A1_UNORM:
         case PIPE_FORMAT_B5G5R5X1_UNORM:
                 fmt.unk1 = 0x18000000;
                 fmt.unk3 = 0x7;
index 7a0deaf4d39b75366e996f174036314028f91e4d..a163fa9b6a61221ff508ecca27fcbbd82ee69f63 100644 (file)
@@ -68,6 +68,7 @@ panfrost_sfbd_format(struct pipe_surface *surf)
 
         case PIPE_FORMAT_A4B4G4R4_UNORM:
         case PIPE_FORMAT_B4G4R4A4_UNORM:
+        case PIPE_FORMAT_R4G4B4A4_UNORM:
                 fmt.unk1 = 0x4;
                 fmt.nr_channels = MALI_POSITIVE(1);
                 fmt.unk2 = 0x5;
index 6e704f7763c65928e8fa1538df8f844d354bfa25..76adcfbcaa3dc2ffdb325a3422dbe263fada4e2f 100644 (file)
@@ -506,6 +506,7 @@ pan_is_unorm4(const struct util_format_description *desc)
         case PIPE_FORMAT_A4R4_UNORM:
         case PIPE_FORMAT_R4A4_UNORM:
         case PIPE_FORMAT_A4B4G4R4_UNORM:
+        case PIPE_FORMAT_R4G4B4A4_UNORM:
                 return true;
         default:
                 return false;
@@ -545,6 +546,7 @@ pan_unpack(nir_builder *b,
 
         switch (desc->format) {
         case PIPE_FORMAT_B5G5R5A1_UNORM:
+        case PIPE_FORMAT_R5G5B5A1_UNORM:
                 return pan_unpack_unorm_5551(b, packed);
         case PIPE_FORMAT_B5G6R5_UNORM:
                 return pan_unpack_unorm_565(b, packed);
@@ -597,6 +599,7 @@ pan_pack(nir_builder *b,
 
         switch (desc->format) {
         case PIPE_FORMAT_B5G5R5A1_UNORM:
+        case PIPE_FORMAT_R5G5B5A1_UNORM:
                 return pan_pack_unorm_5551(b, unpacked);
         case PIPE_FORMAT_B5G6R5_UNORM:
                 return pan_pack_unorm_565(b, unpacked);