diff options
author | Matthew Brost <matthew.brost@intel.com> | 2023-07-27 19:36:00 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:39:16 -0500 |
commit | e3828ebf6cde583b76143e283f8c4a4e8a252145 (patch) | |
tree | 755ff678480c2b9443ef5d15f73690ec20af248f | |
parent | 8d7a91fe58c982a7709fabb53a51d87dbf94f6e9 (diff) |
drm/xe: Add define WQ_HEADER_SIZE
Previously used a a magic '+ 3', use define instead.
Suggested-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_submit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 99c9b7139195..a2eeb3ffe548 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -558,8 +558,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; |