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

Author: Rob Clark <[email protected]>
Date:   Wed Sep  3 19:45:19 2014 -0400

freedreno/ir3: fix error in bail logic

all_delayed will also be true if we didn't attempt to schedule anything
due to no more instructions using current addr/pred.  We rely on coming
in to block_sched_undelayed() to detect and clean up when there are no
more uses of the current addr/pred, which isn't necessarily an error.

This fixes a regression introduced in b823abed.

Signed-off-by: Rob Clark <[email protected]>

---

 src/gallium/drivers/freedreno/ir3/ir3_sched.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_sched.c 
b/src/gallium/drivers/freedreno/ir3/ir3_sched.c
index 33d1caa..cf09cea 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_sched.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_sched.c
@@ -310,7 +310,7 @@ static int block_sched_undelayed(struct ir3_sched_ctx *ctx,
        bool addr_in_use = false;
        bool pred_in_use = false;
        bool all_delayed = true;
-       unsigned cnt = ~0;
+       unsigned cnt = ~0, attempted = 0;
 
        while (instr) {
                struct ir3_instruction *next = instr->next;
@@ -331,6 +331,8 @@ static int block_sched_undelayed(struct ir3_sched_ctx *ctx,
                                addr_in_use = true;
                        if (pred)
                                pred_in_use = true;
+
+                       attempted++;
                }
 
                instr = next;
@@ -345,7 +347,7 @@ static int block_sched_undelayed(struct ir3_sched_ctx *ctx,
        /* detect if we've gotten ourselves into an impossible situation
         * and bail if needed
         */
-       if (all_delayed)
+       if (all_delayed && (attempted > 0))
                ctx->error = true;
 
        return cnt;

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to