summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-08-11 21:04:01 -0400
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2020-08-13 08:55:17 +0200
commit99d17fb771b77af5c693ce86aae6a61a05c05843 (patch)
treeaf87c41b0779d44a318f4b1d026c47f626fa31a2
parentc9bdba26b0c16cac05bb14674458da2acd462797 (diff)
panfrost: XMLify MSAA writeout mode
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
-rw-r--r--src/panfrost/include/panfrost-job.h16
-rw-r--r--src/panfrost/lib/decode.c18
-rw-r--r--src/panfrost/lib/midgard.xml10
3 files changed, 12 insertions, 32 deletions
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 48379cce905..c4481de5101 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1391,20 +1391,6 @@ struct mali_single_framebuffer {
} __attribute__((packed));
-/* SINGLE to disable multisampling, AVERAGE for
- * EXT_multisampled_render_to_texture operation where multiple tilebuffer
- * samples are implicitly resolved before writeout, MULTIPLE to write multiple
- * samples inline, and LAYERED for ES3-style multisampling with each sample in
- * a different buffer.
- */
-
-enum mali_msaa_mode {
- MALI_MSAA_SINGLE = 0,
- MALI_MSAA_AVERAGE = 1,
- MALI_MSAA_MULTIPLE = 2,
- MALI_MSAA_LAYERED = 3,
-};
-
#define MALI_MFBD_FORMAT_SRGB (1 << 0)
struct mali_rt_format {
@@ -1416,7 +1402,7 @@ struct mali_rt_format {
unsigned unk3 : 4;
unsigned unk4 : 1;
enum mali_block_format block : 2;
- enum mali_msaa_mode msaa : 2;
+ enum mali_msaa msaa : 2;
unsigned flags : 2;
unsigned swizzle : 12;
diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/decode.c
index c47b8f52b6c..6538b47f8a3 100644
--- a/src/panfrost/lib/decode.c
+++ b/src/panfrost/lib/decode.c
@@ -453,22 +453,6 @@ static char *pandecode_format(enum mali_format format)
#undef DEFINE_CASE
-#define DEFINE_CASE(name) case MALI_MSAA_ ## name: return "MALI_MSAA_" #name
-static char *
-pandecode_msaa_mode(enum mali_msaa_mode mode)
-{
- switch (mode) {
- DEFINE_CASE(SINGLE);
- DEFINE_CASE(AVERAGE);
- DEFINE_CASE(MULTIPLE);
- DEFINE_CASE(LAYERED);
- default:
- unreachable("Impossible");
- return "";
- }
-}
-#undef DEFINE_CASE
-
static char *pandecode_attr_mode_short(enum mali_attr_mode mode)
{
switch(mode) {
@@ -1027,7 +1011,7 @@ pandecode_rt_format(struct mali_rt_format format)
pandecode_log_decoded_flags(mfbd_fmt_flag_info, format.flags);
pandecode_log_cont(",\n");
- pandecode_prop("msaa = %s", pandecode_msaa_mode(format.msaa));
+ pandecode_prop("msaa = %s", mali_msaa_as_str(format.msaa));
/* In theory, the no_preload bit can be cleared to enable MFBD preload,
* which is a faster hardware-based alternative to the wallpaper method
diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml
index 57de518972a..37aa98987de 100644
--- a/src/panfrost/lib/midgard.xml
+++ b/src/panfrost/lib/midgard.xml
@@ -51,6 +51,16 @@
<value name="Trilinear" value="3"/>
</enum>
+ <enum name="MSAA">
+ <value name="Single" value="0"/>
+ <!-- N samples, 1 surface, resolved -->
+ <value name="Average" value="1"/>
+ <!-- N samples, 1 surface, unresolved -->
+ <value name="Multiple" value="2"/>
+ <!-- N samples, N surfaces -->
+ <value name="Layered" value="3"/>
+ </enum>
+
<enum name="Stencil Op">
<value name="Keep" value="0"/>
<value name="Replace" value="1"/>