From 59d361043e69818e12dce950d4023e65bec5d9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 17 Jun 2025 10:52:41 -0700 Subject: [PATCH] intel/common: Use as much as possible spec recommended values for compute engine async thread limits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spec recommended values should give us a good balance between progress in render and compute engines, also with less possibility of values it will reduce the number of times that we need to emit STATE_COMPUTE_MODE reducing the number of stalls in the compute engine. Cc: stable Reviewed-by: Sagar Ghuge Signed-off-by: José Roberto de Souza Part-of: --- src/intel/common/intel_common.c | 52 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/intel/common/intel_common.c b/src/intel/common/intel_common.c index 484632a7f3e..7ba0901002b 100644 --- a/src/intel/common/intel_common.c +++ b/src/intel/common/intel_common.c @@ -9,6 +9,8 @@ #include "intel_engine.h" +#include "util/compiler.h" + /* Updates intel_device_info fields that has dependencies on intel/common * functions. */ @@ -61,9 +63,8 @@ intel_compute_engine_async_threads_limit(const struct intel_device_info *devinfo */ switch (hw_threads_in_wg) { case 0 ... 2: - /* Max 2 */ - pixel_async_compute_thread_limit = 1; - break; + /* Minimum is Max 2 but lets use spec recommended value below */ + FALLTHROUGH; case 3 ... 8: /* Max 8 */ pixel_async_compute_thread_limit = 2; @@ -95,21 +96,17 @@ intel_compute_engine_async_threads_limit(const struct intel_device_info *devinfo switch (hw_threads_in_wg) { case 0 ... 32: - /* Max 32 */ - z_pass_async_compute_thread_limit = 5; - break; + /* Minimum is Max 32 but lets use spec recommended value below */ + FALLTHROUGH; case 33 ... 40: - /* Max 40 */ - z_pass_async_compute_thread_limit = 4; - break; + /* Minimum is Max 40 but lets use spec recommended value below */ + FALLTHROUGH; case 41 ... 48: - /* Max 48 */ - z_pass_async_compute_thread_limit = 3; - break; + /* Minimum is Max 48 but lets use spec recommended value below */ + FALLTHROUGH; case 49 ... 56: - /* Max 56 */ - z_pass_async_compute_thread_limit = 2; - break; + /* Minimum is Max 56 but lets use spec recommended value below */ + FALLTHROUGH; case 57 ... 60: /* Max 60 */ z_pass_async_compute_thread_limit = 0; @@ -141,9 +138,8 @@ intel_compute_engine_async_threads_limit(const struct intel_device_info *devinfo } else { switch (hw_threads_in_wg) { case 0 ... 4: - /* Max 2 */ - pixel_async_compute_thread_limit = 1; - break; + /* Minimum is Max 2 but lets use spec recommended value below */ + FALLTHROUGH; case 5 ... 16: /* Max 8 */ pixel_async_compute_thread_limit = 2; @@ -175,21 +171,17 @@ intel_compute_engine_async_threads_limit(const struct intel_device_info *devinfo switch (hw_threads_in_wg) { case 0 ... 64: - /* Max 32 */ - z_pass_async_compute_thread_limit = 5; - break; + /* Minimum is Max 32 but lets use spec recommended value below */ + FALLTHROUGH; case 65 ... 80: - /* Max 40 */ - z_pass_async_compute_thread_limit = 4; - break; + /* Minimum is Max 40 but lets use spec recommended value below */ + FALLTHROUGH; case 81 ... 96: - /* Max 48 */ - z_pass_async_compute_thread_limit = 3; - break; + /* Minimum is Max 48 but lets use spec recommended value below */ + FALLTHROUGH; case 97 ... 112: - /* Max 56 */ - z_pass_async_compute_thread_limit = 2; - break; + /* Minimum is Max 56 but lets use spec recommended value below */ + FALLTHROUGH; case 113 ... 120: /* Max 60 */ z_pass_async_compute_thread_limit = 0;