Mesa (master): freedreno/ir3: hack to avoid getting stuck in a loop

Rob Clark robclark at kemper.freedesktop.org
Wed Apr 13 18:38:23 UTC 2016


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

Author: Rob Clark <robclark at freedesktop.org>
Date:   Mon Apr 11 13:03:51 2016 -0400

freedreno/ir3: hack to avoid getting stuck in a loop

There are still some edge cases which result in a neighbor-loop.  Which
needs to be fixed, but this hack at least makes deqp tests finish.

Signed-off-by: Rob Clark <robclark at freedesktop.org>

---

 src/gallium/drivers/freedreno/ir3/ir3.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h
index 3859f6a..f68275e 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3.h
@@ -308,8 +308,14 @@ struct ir3_instruction {
 static inline struct ir3_instruction *
 ir3_neighbor_first(struct ir3_instruction *instr)
 {
-	while (instr->cp.left)
+	int cnt = 0;
+	while (instr->cp.left) {
 		instr = instr->cp.left;
+		if (++cnt > 0xffff) {
+			debug_assert(0);
+			break;
+		}
+	}
 	return instr;
 }
 
@@ -322,6 +328,10 @@ static inline int ir3_neighbor_count(struct ir3_instruction *instr)
 	while (instr->cp.right) {
 		num++;
 		instr = instr->cp.right;
+		if (num > 0xffff) {
+			debug_assert(0);
+			break;
+		}
 	}
 
 	return num;




More information about the mesa-commit mailing list