panfrost: Use panfrost_blendable_formats for blending
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 28 Oct 2020 00:24:46 +0000 (20:24 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sat, 31 Oct 2020 14:09:18 +0000 (14:09 +0000)
Finally the yak shaving pays off.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7352>

src/gallium/drivers/panfrost/pan_blending.c

index e1b6a7b..6063ad3 100644 (file)
 bool
 panfrost_can_fixed_blend(enum pipe_format format)
 {
-        /* Fixed-function can handle sRGB */
-        format = util_format_linear(format);
-
-        switch (panfrost_pipe_format_table[format].hw) {
-        case MALI_RGB565:
-        case MALI_RGB5_A1_UNORM:
-        case MALI_RGB10_A2_UNORM:
-        case MALI_RGBA4_UNORM:
-        case MALI_R8_UNORM:
-        case MALI_RG8_UNORM:
-        case MALI_RGB8_UNORM:
-        case MALI_RGBA8_UNORM:
-                return true;
-        default:
-                return false;
-        }
+        return panfrost_blend_format(format).internal != 0;
 }
 
 /* Helper to find the uncomplemented Gallium blend factor corresponding to a