panfrost: Allow R11G11B10 rendering
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 29 Jun 2019 01:47:10 +0000 (18:47 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 29 Jun 2019 01:48:13 +0000 (18:48 -0700)
Doesn't fully work yet, but better than crashing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_mfbd.c
src/gallium/drivers/panfrost/pan_screen.c

index 91e04a34e80a2015c6c8cb517fc718dde780218c..b209ecbf580ae4e0ef6d3635de4f65e29eeb077c 100644 (file)
@@ -81,10 +81,14 @@ panfrost_mfbd_format(struct pipe_surface *surf)
 
         /* Set flags for alternative formats */
 
-        if (surf->texture->format == PIPE_FORMAT_B5G6R5_UNORM) {
+        if (surf->format == PIPE_FORMAT_B5G6R5_UNORM) {
                 fmt.unk1 = 0x14000000;
                 fmt.nr_channels = MALI_POSITIVE(2);
                 fmt.unk3 |= 0x1;
+        } else if (surf->format == PIPE_FORMAT_R11G11B10_FLOAT) {
+                fmt.unk1 = 0x88000000;
+                fmt.unk3 = 0x0;
+                fmt.nr_channels = MALI_POSITIVE(4);
         }
 
         return fmt;
index ddb0b7f75fd352e634033f479dc09048a17c1dda..f8463d2b3f8e1336db7a259bb00cd6d6ab4e9a79 100644 (file)
@@ -458,13 +458,20 @@ panfrost_is_format_supported( struct pipe_screen *screen,
         if (format == PIPE_FORMAT_A1B5G5R5_UNORM || format == PIPE_FORMAT_X1B5G5R5_UNORM)
                 return FALSE;
 
+        /* Allow through special formats */
+
+        switch (format) {
+                case PIPE_FORMAT_R11G11B10_FLOAT:
+                case PIPE_FORMAT_B5G6R5_UNORM:
+                        return TRUE;
+                default:
+                        break;
+        }
+
         if (bind & PIPE_BIND_RENDER_TARGET) {
                 if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS)
                         return FALSE;
 
-                if (format == PIPE_FORMAT_B5G6R5_UNORM)
-                        return TRUE;
-
                 /* Check for vaguely 8UNORM formats. Looser than
                  * util_format_is_rgba8_variant, since it permits R8 (for
                  * instance) */