summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_context.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-19 14:30:53 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-21 08:40:53 -0700
commitf5c293425fa457d91be8e689501619dfb16ccefe (patch)
treec6a49b336ba069b299a38247b77e84088478fc66 /src/gallium/drivers/panfrost/pan_context.c
parentf6e41f30d00915e677737aca6d2b10b2c1c0eb3e (diff)
panfrost: Correct polygon size computations
While the algorithm for computing the header size has been correct for a while, we used a major hack to conservatively guess the body size. Let's scrap that and figure out the algorithm we actually need to use to be bit-identical with what the hardware expects. We do have to be careful to add the header size to total comptued BO size. It's not clear how big the polygon list needs to be in practice -- but it has to be somewhat bigger than the polygon list itself. This needs more investigation. If we size the polygon list exactly based on the polygon_list_size field, we get faults like: [ 1224.219886] panfrost ff9a0000.gpu: Unhandled Page fault in AS0 at VA 0x000000001BDE8000 Reason: TODO raw fault status: 0x660003C3 decoded fault status: SLAVE FAULT exception type 0xC3: TRANSLATION_FAULT_LEVEL3 access type 0x3: WRITE source id 0x6600 Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 3d4b837697c..a07273c7da1 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -71,13 +71,15 @@ panfrost_emit_midg_tiler(
unsigned header_size = panfrost_tiler_header_size(
width, height, t.hierarchy_mask);
- unsigned body_size = panfrost_tiler_body_size(
+ t.polygon_list_size = panfrost_tiler_full_size(
width, height, t.hierarchy_mask);
/* Sanity check */
if (t.hierarchy_mask) {
- t.polygon_list = panfrost_job_get_polygon_list(batch, header_size + body_size);
+ t.polygon_list = panfrost_job_get_polygon_list(batch,
+ header_size + t.polygon_list_size);
+
/* Allow the entire tiler heap */
t.heap_start = ctx->tiler_heap.bo->gpu;
@@ -98,9 +100,6 @@ panfrost_emit_midg_tiler(
t.polygon_list_body =
t.polygon_list + header_size;
- t.polygon_list_size =
- header_size + body_size;
-
return t;
}