Skip to contentSkip to conversation

drm/xe: Add define WQ_HEADER_SIZE

PATCH In review Matthew Brost 2 participants 2 messages Jul 28, 2023

Subsystems (2)
lore
Share & tools
lore

Matthew Brost

author maintainer
#0 lore raw

PATCH 1/1 drm/xe: Add define WQ_HEADER_SIZE

Previously used a a magic '+ 3', use define instead.

---
 drivers/gpu/drm/xe/xe_guc_submit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_guc_submit.c +3 -2
index d623cd9f6cc4..5efecbc18836 100644
@@ -557,8 +557,9 @@ static void wq_item_append(struct xe_engine *e)
 	struct xe_guc *guc = engine_to_guc(e);
 	struct xe_device *xe = guc_to_xe(guc);
 	struct iosys_map map = xe_lrc_parallel_map(e->lrc);
-	u32 wqi[XE_HW_ENGINE_MAX_INSTANCE + 3];
-	u32 wqi_size = (e->width + 3) * sizeof(u32);
+#define WQ_HEADER_SIZE	4	/* Includes 1 LRC address too */
+	u32 wqi[XE_HW_ENGINE_MAX_INSTANCE + (WQ_HEADER_SIZE - 1)];
+	u32 wqi_size = (e->width + (WQ_HEADER_SIZE - 1)) * sizeof(u32);
 	u32 len_dw = (wqi_size / sizeof(u32)) - 1;
 	int i = 0, j;
 
Signature · 1 line
2.34.1