From 738b95a35e6aac3e0656d391922f38b205dd0386 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 5 May 2025 15:01:52 +0200 Subject: [PATCH] panfrost: add max_4x_msaa quirk Turns out, some Midgard GPUs don't support more than 4x MSAA. Add a quirk for those GPUs, so don't expose it when it doesn't work. Reviewed-by: Eric R. Smith Part-of: --- src/gallium/drivers/panfrost/pan_screen.c | 3 +++ src/panfrost/lib/pan_props.c | 8 ++++---- src/panfrost/lib/pan_props.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 8fc4afd7ef5..5fd5a8c6a3b 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -151,6 +151,9 @@ get_max_msaa(struct panfrost_device *dev, enum pipe_format format) max_cbuf_atts, format_size); assert(format_size > 16 || max_msaa >= 4); + if (dev->model->quirks.max_4x_msaa) + max_msaa = 4; + return max_msaa; } diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c index 3bfe7e48a4d..410c8a6aeb4 100644 --- a/src/panfrost/lib/pan_props.c +++ b/src/panfrost/lib/pan_props.c @@ -51,12 +51,12 @@ /* Table of supported Mali GPUs */ /* clang-format off */ const struct pan_model pan_model_list[] = { - MODEL(0x600, 0, "T600", "T60x", NO_ANISO, 8192, 8192), + MODEL(0x600, 0, "T600", "T60x", NO_ANISO, 8192, 8192, .max_4x_msaa = true), MODEL(0x620, 0, "T620", "T62x", NO_ANISO, 8192, 8192), - MODEL(0x720, 0, "T720", "T72x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true), + MODEL(0x720, 0, "T720", "T72x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true, .max_4x_msaa = true), MODEL(0x750, 0, "T760", "T76x", NO_ANISO, 8192, 8192), - MODEL(0x820, 0, "T820", "T82x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true), - MODEL(0x830, 0, "T830", "T83x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true), + MODEL(0x820, 0, "T820", "T82x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true, .max_4x_msaa = true), + MODEL(0x830, 0, "T830", "T83x", NO_ANISO, 8192, 8192, .no_hierarchical_tiling = true, .max_4x_msaa = true), MODEL(0x860, 0, "T860", "T86x", NO_ANISO, 8192, 8192), MODEL(0x880, 0, "T880", "T88x", NO_ANISO, 8192, 8192), diff --git a/src/panfrost/lib/pan_props.h b/src/panfrost/lib/pan_props.h index 289a24ce20c..bef13f3b48f 100644 --- a/src/panfrost/lib/pan_props.h +++ b/src/panfrost/lib/pan_props.h @@ -77,6 +77,7 @@ struct pan_model { * size for the entire framebuffer be selected by the driver */ bool no_hierarchical_tiling; + bool max_4x_msaa; } quirks; };