Module: Mesa
Branch: staging/22.2
Commit: b84c8968c7fa95f5b3cc816c2b12f74b03193d0a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b84c8968c7fa95f5b3cc816c2b12f74b03193d0a

Author: Gert Wollny <[email protected]>
Date:   Tue Aug 23 15:35:06 2022 +0200

r600/sfn: Don't scan the whole block for ready instructions

Limit the number of tested instructions and the number of
ready instructions that might be taken into account.

This reduces the time needed to run the scheduler significantly.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Filip Gawin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18212>
(cherry picked from commit 1f5dccb76057666ff810d889a38e057b078f2448)

---

 .pick_status.json                              | 2 +-
 src/gallium/drivers/r600/sfn/sfn_scheduler.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1a713f4fb2d..dbeb547ce24 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -10300,7 +10300,7 @@
         "description": "r600/sfn: Don't scan the whole block for ready 
instructions",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "79ca456b4837b3bc21cf9ef3c03c505c4b4909f6"
     },
diff --git a/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp 
b/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp
index ea742f953cc..abeac5615da 100644
--- a/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_scheduler.cpp
@@ -913,7 +913,8 @@ bool BlockSheduler::collect_ready_type(std::list<T *>& 
ready, std::list<T *>& av
    auto i = available.begin();
    auto e = available.end();
 
-   while (i != e) {
+   int lookahead = 16;
+   while (i != e && ready.size() < 16 && lookahead-- > 0) {
       if ((*i)->ready()) {
          ready.push_back(*i);
          auto old_i = i;

Reply via email to