ir3/postsched: fix calculation of max_delay

max_delay is a measure for the maximum delay from a node to the end of a
block. However, the current calculation would include the delay of the
node itself (which is the maximum delay from the node's sources). At the
point a node is scheduled, this source delay might already be much
smaller (or even zero) because its sources have hopefully been scheduled
much earlier. This means the max_delay value would be an overestimate of
the actual delay from the node to the block's end.

This commit fixes this and makes sure max_delay is always the maximum
delay from a node to the end of the block from the point where the node
is scheduled.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30437>
This commit is contained in:
Job Noorman
2024-08-05 13:35:20 +02:00
committed by Marge Bot
parent db21255d72
commit 8cc269a16f
+3 -2
View File
@@ -581,10 +581,11 @@ sched_dag_max_delay_cb(struct dag_node *node, void *state)
util_dynarray_foreach (&n->dag.edges, struct dag_edge, edge) {
struct ir3_postsched_node *child =
(struct ir3_postsched_node *)edge->child;
max_delay = MAX2(child->max_delay, max_delay);
unsigned delay = edge->data;
max_delay = MAX2(child->max_delay + delay, max_delay);
}
n->max_delay = MAX2(n->max_delay, max_delay + n->delay);
n->max_delay = MAX2(n->max_delay, max_delay);
}
static void