diff --git a/src/panfrost/lib/pan_format.c b/src/panfrost/lib/pan_format.c index 33b99f69bf1..d3f645194da 100644 --- a/src/panfrost/lib/pan_format.c +++ b/src/panfrost/lib/pan_format.c @@ -44,12 +44,22 @@ #define MALI_BLEND_AU_R5G5B5A1 (MALI_RGB5_A1_AU << 12) #define MALI_BLEND_PU_R5G5B5A1 (MALI_RGB5_A1_PU << 12) +#if PAN_ARCH <= 6 #define BFMT2(pipe, internal, writeback, srgb) \ [PIPE_FORMAT_##pipe] = { \ MALI_COLOR_BUFFER_INTERNAL_FORMAT_## internal, \ MALI_MFBD_COLOR_FORMAT_## writeback, \ - MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0), \ + MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0) | \ + PAN_V6_SWIZZLE(R, G, B, A) \ } +#else +#define BFMT2(pipe, internal, writeback, srgb) \ + [PIPE_FORMAT_##pipe] = { \ + MALI_COLOR_BUFFER_INTERNAL_FORMAT_## internal, \ + MALI_MFBD_COLOR_FORMAT_## writeback, \ + MALI_BLEND_AU_ ## internal | (srgb ? (1 << 20) : 0) \ + } +#endif #define BFMT(pipe, internal_and_writeback) \ BFMT2(pipe, internal_and_writeback, internal_and_writeback, 0) diff --git a/src/panfrost/lib/pan_util.c b/src/panfrost/lib/pan_util.c index 2cef317ae56..e676a6ea460 100644 --- a/src/panfrost/lib/pan_util.c +++ b/src/panfrost/lib/pan_util.c @@ -75,12 +75,9 @@ unsigned panfrost_format_to_bifrost_blend(const struct panfrost_device *dev, enum pipe_format format) { - mali_pixel_format pixfmt = panfrost_blendable_formats_v7[format].bifrost; + mali_pixel_format pixfmt = (dev->quirks & HAS_SWIZZLES) ? + panfrost_blendable_formats_v7[format].bifrost : + panfrost_blendable_formats_v6[format].bifrost; - if (pixfmt) { - return pixfmt | ((dev->quirks & HAS_SWIZZLES) ? - panfrost_get_default_swizzle(4) : 0); - } else { - return dev->formats[format].hw; - } + return pixfmt ?: dev->formats[format].hw; }