[Mesa-dev] [PATCH 07/11] panfrost: Use polygon list header size computation
Alyssa Rosenzweig
alyssa.rosenzweig at collabora.com
Fri Jun 14 17:04:39 UTC 2019
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 0363591f79f..ecb68c990a0 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;
}
--
2.20.1
More information about the mesa-dev
mailing list