vc4: Add a note for the future about texture latency calculation.
authorEric Anholt <eric@anholt.net>
Tue, 15 Nov 2016 23:47:49 +0000 (15:47 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 29 Nov 2016 17:01:23 +0000 (09:01 -0800)
Debugging a shader-db reported cycle count regression from the tex
coalescing, I eventually figured out that the texture latencies were
totally bogus.  Really fixing it will probably involve mirroring
vc4_qir_schedule.c's texture fifo management here.

src/gallium/drivers/vc4/vc4_qpu_schedule.c

index 45360f73410c01c81f47389912923dc9fa2954e6..878cdf95d96030089711b3921f6ec979852eac2e 100644 (file)
@@ -705,6 +705,26 @@ static uint32_t waddr_latency(uint32_t waddr, uint64_t after)
 
         /* Apply some huge latency between texture fetch requests and getting
          * their results back.
+         *
+         * FIXME: This is actually pretty bogus.  If we do:
+         *
+         * mov tmu0_s, a
+         * <a bit of math>
+         * mov tmu0_s, b
+         * load_tmu0
+         * <more math>
+         * load_tmu0
+         *
+         * we count that as worse than
+         *
+         * mov tmu0_s, a
+         * mov tmu0_s, b
+         * <lots of math>
+         * load_tmu0
+         * <more math>
+         * load_tmu0
+         *
+         * because we associate the first load_tmu0 with the *second* tmu0_s.
          */
         if (waddr == QPU_W_TMU0_S) {
                 if (QPU_GET_FIELD(after, QPU_SIG) == QPU_SIG_LOAD_TMU0)