From: Alyssa Rosenzweig Date: Tue, 20 Aug 2019 19:07:31 +0000 (-0700) Subject: panfrost: Fix scoreboarding with dependency on job #0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be81711c0a5785d987f5b60e0e00b07dbaae184a;p=mesa.git panfrost: Fix scoreboarding with dependency on job #0 Subtle issue masked by how we emitted SET_VALUE jobs, but this case can and does occur, so let's fix it. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/pan_scoreboard.c b/src/gallium/drivers/panfrost/pan_scoreboard.c index 692f5425444..0873dd1fbe1 100644 --- a/src/gallium/drivers/panfrost/pan_scoreboard.c +++ b/src/gallium/drivers/panfrost/pan_scoreboard.c @@ -414,12 +414,12 @@ panfrost_scoreboard_link_batch(struct panfrost_job *batch) if (dep_1) { assert(!dependents[dep_1 - 1]); - dependents[dep_1 - 1] = i; + dependents[dep_1 - 1] = i + 1; } if (dep_2) { assert(!dependents[dep_2 - 1]); - dependents[dep_2 - 1] = i; + dependents[dep_2 - 1] = i + 1; } } @@ -461,9 +461,11 @@ panfrost_scoreboard_link_batch(struct panfrost_job *batch) tail = n; /* Grab the dependent, if there is one */ - unsigned node_m = dependents[node_n]; + unsigned node_m_1 = dependents[node_n]; + + if (node_m_1) { + unsigned node_m = node_m_1 - 1; - if (node_m) { struct mali_job_descriptor_header *m = DESCRIPTOR_FOR_NODE(node_m);