Mesa (master): panfrost: Compute and use polygon list body size

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


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Jun 14 07:08:51 2019 -0700

panfrost: Compute and use polygon list body size

This is a bit of a hack, but it gets the point across.

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

---

 src/gallium/drivers/panfrost/pan_context.c |  7 ++++++-
 src/gallium/drivers/panfrost/pan_tiler.c   | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index f66ee434c04..3c9c8a9f8e6 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -153,7 +153,6 @@ panfrost_emit_mfbd(struct panfrost_context *ctx)
 
                 /* See pan_tiler.c */
                 .tiler_polygon_list  = ctx->misc_0.gpu,
-                .tiler_polygon_list_size = 0x0,
 
                 .width1 = MALI_POSITIVE(width),
                 .height1 = MALI_POSITIVE(height),
@@ -176,9 +175,15 @@ panfrost_emit_mfbd(struct panfrost_context *ctx)
         unsigned header_size = panfrost_tiler_header_size(
                         width, height, framebuffer.tiler_hierarchy_mask);
 
+        unsigned body_size = panfrost_tiler_body_size(
+                        width, height, framebuffer.tiler_hierarchy_mask);
+
         framebuffer.tiler_polygon_list_body =
                 framebuffer.tiler_polygon_list + header_size;
 
+        framebuffer.tiler_polygon_list_size =
+                header_size + body_size;
+
         return framebuffer;
 }
 
diff --git a/src/gallium/drivers/panfrost/pan_tiler.c b/src/gallium/drivers/panfrost/pan_tiler.c
index 22482ff1f91..ef5a09104f6 100644
--- a/src/gallium/drivers/panfrost/pan_tiler.c
+++ b/src/gallium/drivers/panfrost/pan_tiler.c
@@ -254,3 +254,17 @@ panfrost_tiler_header_size(unsigned width, unsigned height, uint8_t mask)
 
         return panfrost_raw_header_size(width, height, masked_count);
 }
+
+/* The body seems to be about 512 bytes per tile. Noting that the header is
+ * about 8 bytes per tile, we can be a little sloppy and estimate the body size
+ * to be equal to the header size * (512/8). Given the header size is a
+ * considerable overestimate, this is fine. Eventually, we should maybe figure
+ * out how to actually implement this. */
+
+unsigned
+panfrost_tiler_body_size(unsigned width, unsigned height, uint8_t mask)
+{
+        unsigned header_size = panfrost_tiler_header_size(width, height, mask);
+        return ALIGN_POT(header_size * 512 / 8, 512);
+}
+




More information about the mesa-commit mailing list