Mesa (master): panfrost: Use polygon list header size computation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 17 15:25:47 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Jun 13 15:15:53 2019 -0700

panfrost: Use polygon list header size computation

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_context.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 009ff6859e5..f66ee434c04 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -46,6 +46,7 @@
 #include "pan_blending.h"
 #include "pan_blend_shaders.h"
 #include "pan_util.h"
+#include "pan_tiler.h"
 
 static int performance_counter_number = 0;
 extern const char *pan_counters_base;
@@ -134,6 +135,9 @@ panfrost_emit_sfbd(struct panfrost_context *ctx)
 struct bifrost_framebuffer
 panfrost_emit_mfbd(struct panfrost_context *ctx)
 {
+        unsigned width = ctx->pipe_framebuffer.width;
+        unsigned height = ctx->pipe_framebuffer.height;
+
         struct bifrost_framebuffer framebuffer = {
                 /* The lower 0x1ff controls the hierarchy mask. Set more bits
                  * on for more tile granularity (which can be a performance win
@@ -149,13 +153,12 @@ panfrost_emit_mfbd(struct panfrost_context *ctx)
 
                 /* See pan_tiler.c */
                 .tiler_polygon_list  = ctx->misc_0.gpu,
-                .tiler_polygon_list_body = ctx->misc_0.gpu + 0xf0000,
                 .tiler_polygon_list_size = 0x0,
 
-                .width1 = MALI_POSITIVE(ctx->pipe_framebuffer.width),
-                .height1 = MALI_POSITIVE(ctx->pipe_framebuffer.height),
-                .width2 = MALI_POSITIVE(ctx->pipe_framebuffer.width),
-                .height2 = MALI_POSITIVE(ctx->pipe_framebuffer.height),
+                .width1 = MALI_POSITIVE(width),
+                .height1 = MALI_POSITIVE(height),
+                .width2 = MALI_POSITIVE(width),
+                .height2 = MALI_POSITIVE(height),
 
                 .unk1 = 0x1080,
 
@@ -168,6 +171,14 @@ panfrost_emit_mfbd(struct panfrost_context *ctx)
                 .scratchpad = ctx->scratchpad.gpu,
         };
 
+        /* Compute the polygon header size and use that to offset the body */
+
+        unsigned header_size = panfrost_tiler_header_size(
+                        width, height, framebuffer.tiler_hierarchy_mask);
+
+        framebuffer.tiler_polygon_list_body =
+                framebuffer.tiler_polygon_list + header_size;
+
         return framebuffer;
 }
 




More information about the mesa-commit mailing list