lima/gpir: Fix schedule_first insertion logic
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 2 Sep 2019 20:31:00 +0000 (22:31 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Mon, 9 Sep 2019 10:41:35 +0000 (17:41 +0700)
The idea was to make sure schedule_first nodes were always first in the
ready list. I made sure they were inserted first, but not that other
nodes wouldn't later be scheduled ahead of them. Fixes
spec@glsl-1.10@execution@built-in-functions@vs-exp-float and probably
others.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/ir/gp/scheduler.c

index bfb64543e065eb5d9ccc9448132b3376ea3e8377..8fff4f79b362869f989b57e935228e3831f21bc6 100644 (file)
@@ -441,8 +441,9 @@ static void schedule_insert_ready_list(sched_ctx *ctx,
 
    struct list_head *insert_pos = &ctx->ready_list;
    list_for_each_entry(gpir_node, node, &ctx->ready_list, list) {
-      if (insert_node->sched.dist > node->sched.dist ||
-          gpir_op_infos[insert_node->op].schedule_first) {
+      if ((insert_node->sched.dist > node->sched.dist ||
+          gpir_op_infos[insert_node->op].schedule_first) &&
+          !gpir_op_infos[node->op].schedule_first) {
          insert_pos = &node->list;
          break;
       }