[PATCH i-g-t 2/2] lib/gpgpu_shader: Decrease maximal number of threads to satisfy Xe2

Dominik Grzegorzek dominik.grzegorzek at intel.com
Mon Sep 23 07:46:40 UTC 2024


Since xe2 there was a change in CFE_STATE instruction format.
Field describing maximal number of threads now has type of u16,
not u16-1 as it used to have, however upper bound of the valid range
has not changed and it is 2^16 - 1 as it used to be. So, to not introduce
conditional code, decrease maximal number of threads across all
generations (anyway the value exceeds devices capability).

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
---
 lib/gpgpu_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/gpgpu_shader.c b/lib/gpgpu_shader.c
index 6d8c7ebb8..e20aa4535 100644
--- a/lib/gpgpu_shader.c
+++ b/lib/gpgpu_shader.c
@@ -25,7 +25,7 @@ struct label_entry {
 #define PAGE_SIZE 4096
 #define BATCH_STATE_SPLIT 2048
 /* VFE STATE params */
-#define THREADS (1 << 16) /* max value */
+#define THREADS ((1 << 16) - 1) /* max value since Xe2 */
 #define GEN8_GPGPU_URB_ENTRIES 1
 #define GPGPU_URB_SIZE 0
 #define GPGPU_CURBE_SIZE 0
-- 
2.34.1



More information about the igt-dev mailing list