freedreno/ir3: comment + better fxn name
authorRob Clark <robclark@freedesktop.org>
Sat, 18 Oct 2014 18:46:35 +0000 (14:46 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 21 Oct 2014 01:42:44 +0000 (21:42 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_sched.c

index cf09ceaf54be19f81932812ce555b9c94921c49c..24d7c6397c1541d7eed16f524cf3f7aecf165db8 100644 (file)
@@ -162,7 +162,8 @@ static void schedule(struct ir3_sched_ctx *ctx,
  * Delay-slot calculation.  Follows fanin/fanout.
  */
 
-static unsigned delay_calc2(struct ir3_sched_ctx *ctx,
+/* calculate delay for specified src: */
+static unsigned delay_calc_srcn(struct ir3_sched_ctx *ctx,
                struct ir3_instruction *assigner,
                struct ir3_instruction *consumer, unsigned srcn)
 {
@@ -173,7 +174,7 @@ static unsigned delay_calc2(struct ir3_sched_ctx *ctx,
                for (i = 1; i < assigner->regs_count; i++) {
                        struct ir3_register *reg = assigner->regs[i];
                        if (reg->flags & IR3_REG_SSA) {
-                               unsigned d = delay_calc2(ctx, reg->instr,
+                               unsigned d = delay_calc_srcn(ctx, reg->instr,
                                                consumer, srcn);
                                delay = MAX2(delay, d);
                        }
@@ -186,6 +187,7 @@ static unsigned delay_calc2(struct ir3_sched_ctx *ctx,
        return delay;
 }
 
+/* calculate delay for instruction (maximum of delay for all srcs): */
 static unsigned delay_calc(struct ir3_sched_ctx *ctx,
                struct ir3_instruction *instr)
 {
@@ -194,7 +196,7 @@ static unsigned delay_calc(struct ir3_sched_ctx *ctx,
        for (i = 1; i < instr->regs_count; i++) {
                struct ir3_register *reg = instr->regs[i];
                if (reg->flags & IR3_REG_SSA) {
-                       unsigned d = delay_calc2(ctx, reg->instr,
+                       unsigned d = delay_calc_srcn(ctx, reg->instr,
                                        instr, i - 1);
                        delay = MAX2(delay, d);
                }