Mesa (master): panfrost: 8x MRT support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 14:27:56 UTC 2020


Module: Mesa
Branch: master
Commit: 3ec252a3b293dc0cbba847bfc72ba50b6c4d3514
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ec252a3b293dc0cbba847bfc72ba50b6c4d3514

Author: Icecream95 <ixn at keemail.me>
Date:   Tue Jul 14 12:05:47 2020 +1200

panfrost: 8x MRT support

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5892>

---

 docs/features.txt                         | 2 +-
 src/gallium/drivers/panfrost/pan_mfbd.c   | 6 +++---
 src/gallium/drivers/panfrost/pan_screen.c | 4 ++--
 src/panfrost/include/panfrost-job.h       | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index 9d5198e62d3..44d0ec26b19 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -64,7 +64,7 @@ GL 3.0, GLSL 1.30 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llv
   Depth format cube textures                            DONE (panfrost)
   GLX_ARB_create_context (GLX 1.4 is required)          DONE (panfrost, v3d)
   Multisample anti-aliasing                             DONE (freedreno/a5xx+, freedreno (*), llvmpipe (*), softpipe (*), swr (*), panfrost)
-  8 draw buffers                                        DONE ()
+  8 draw buffers                                        DONE (panfrost/t760+)
 
 (*) freedreno (a2xx-a4xx), llvmpipe, softpipe, and swr have fake Multisample anti-aliasing support
 
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index 0ee904e9b5a..d253b897b98 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -401,7 +401,7 @@ panfrost_mfbd_upload(struct panfrost_batch *batch,
         size_t total_sz =
                 sizeof(struct mali_framebuffer) +
                 (has_extra ? sizeof(struct mali_framebuffer_extra) : 0) +
-                sizeof(struct mali_render_target) * 4;
+                sizeof(struct mali_render_target) * 8;
 
         struct panfrost_transfer m_f_trans =
                 panfrost_pool_alloc(&batch->pool, total_sz);
@@ -413,7 +413,7 @@ panfrost_mfbd_upload(struct panfrost_batch *batch,
         if (has_extra)
                 UPLOAD(m_f_trans, offset, fbx, total_sz);
 
-        for (unsigned c = 0; c < 4; ++c) {
+        for (unsigned c = 0; c < 8; ++c) {
                 UPLOAD(m_f_trans, offset, &rts[c], total_sz);
         }
 
@@ -541,7 +541,7 @@ panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws)
 
         struct mali_framebuffer fb = panfrost_emit_mfbd(batch, has_draws);
         struct mali_framebuffer_extra fbx = {0};
-        struct mali_render_target rts[4] = {0};
+        struct mali_render_target rts[8] = {0};
 
         /* We always upload at least one dummy GL_NONE render target */
 
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index e776add1f20..a9f7c4e1aa9 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -120,7 +120,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
         case PIPE_CAP_MAX_RENDER_TARGETS:
         case PIPE_CAP_FBFETCH:
         case PIPE_CAP_FBFETCH_COHERENT:
-                return has_mrt ? 4 : 1;
+                return has_mrt ? 8 : 1;
 
         case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
                 return 1;
@@ -300,7 +300,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 16;
 
         case PIPE_SHADER_CAP_MAX_OUTPUTS:
-                return shader == PIPE_SHADER_FRAGMENT ? 4 : 16;
+                return shader == PIPE_SHADER_FRAGMENT ? 8 : 16;
 
         case PIPE_SHADER_CAP_MAX_TEMPS:
                 return 256; /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index c6fd0647ca3..8ac799b81f2 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -1849,8 +1849,8 @@ struct mali_framebuffer {
         u32 zero3;
         u16 width2, height2;
         u32 unk1 : 19; // = 0x01000
-        u32 rt_count_1 : 2; // off-by-one (use MALI_POSITIVE)
-        u32 unk2 : 3; // = 0
+        u32 rt_count_1 : 3; // off-by-one (use MALI_POSITIVE)
+        u32 unk2 : 2; // = 0
         u32 rt_count_2 : 3; // no off-by-one
         u32 zero4 : 5;
         /* 0x30 */



More information about the mesa-commit mailing list