panfrost: Always pick dithered tb formats

Matches current logic and simplifies the code considerably.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10188>
This commit is contained in:
Alyssa Rosenzweig
2021-04-12 12:42:50 -04:00
committed by Marge Bot
parent 884f9c7926
commit fae90a7940
5 changed files with 16 additions and 15 deletions

View File

@@ -358,7 +358,7 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch,
*/
cfg.bifrost.internal.fixed_function.num_comps = 4;
cfg.bifrost.internal.fixed_function.conversion.memory_format =
panfrost_format_to_bifrost_blend(dev, format, true);
panfrost_format_to_bifrost_blend(dev, format);
cfg.bifrost.internal.fixed_function.conversion.register_format =
bifrost_blend_type_from_nir(fs->info.bifrost.blend[i].type);
cfg.bifrost.internal.fixed_function.rt = i;

View File

@@ -614,7 +614,7 @@ pan_blend_get_bifrost_desc(const struct panfrost_device *dev,
}
cfg.fixed_function.conversion.memory_format =
panfrost_format_to_bifrost_blend(dev, fmt, true);
panfrost_format_to_bifrost_blend(dev, fmt);
}
return res;

View File

@@ -257,7 +257,7 @@ pan_blitter_emit_bifrost_blend(const struct panfrost_device *dev,
cfg.bifrost.equation.color_mask = 0xf;
cfg.bifrost.internal.fixed_function.num_comps = 4;
cfg.bifrost.internal.fixed_function.conversion.memory_format =
panfrost_format_to_bifrost_blend(dev, iview->format, true);
panfrost_format_to_bifrost_blend(dev, iview->format);
cfg.bifrost.internal.fixed_function.conversion.register_format =
blit_type_to_reg_fmt(type);

View File

@@ -691,22 +691,23 @@ panfrost_invert_swizzle(const unsigned char *in, unsigned char *out)
}
}
/* Formats requiring blend shaders are stored raw in the tilebuffer and will
* have 0 as their pixel format. Assumes dithering is set, I don't know of a
* case when it makes sense to turn off dithering. */
unsigned
panfrost_format_to_bifrost_blend(const struct panfrost_device *dev,
enum pipe_format format, bool dither)
enum pipe_format format)
{
struct pan_blendable_format fmt = panfrost_blendable_formats[format];
mali_pixel_format pixfmt =
panfrost_blendable_formats[format].bifrost_dither;
/* Formats requiring blend shaders are stored raw in the tilebuffer */
if (!fmt.internal)
if (pixfmt) {
return pixfmt | ((dev->quirks & HAS_SWIZZLES) ?
panfrost_get_default_swizzle(4) : 0);
} else {
return dev->formats[format].hw;
unsigned extra = 0;
if (dev->quirks & HAS_SWIZZLES)
extra |= panfrost_get_default_swizzle(4);
return (dither ? fmt.bifrost_dither : fmt.bifrost_no_dither) | extra;
}
}
enum mali_z_internal_format

View File

@@ -252,7 +252,7 @@ panfrost_bifrost_swizzle(unsigned components)
unsigned
panfrost_format_to_bifrost_blend(const struct panfrost_device *dev,
enum pipe_format format, bool dither);
enum pipe_format format);
struct pan_pool;
struct pan_scoreboard;