From 116e5c5e8bc0f32cdbe9a11cb366c33b96b375ff Mon Sep 17 00:00:00 2001 From: "shaoyun.liu" Date: Fri, 20 Jan 2017 13:33:38 -0500 Subject: [PATCH] Thunk: Don't allocate extra control stack memory for gfx900 The control stack memory for CWSR is allocate in kernel together with MQD allocation. Change-Id: Ib1c0ab9402df3431e9555649394320380d6c6dd8 Signed-off-by: shaoyun.liu --- src/queues.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/queues.c b/src/queues.c index c9eab609b8..2aeda1bda6 100644 --- a/src/queues.c +++ b/src/queues.c @@ -418,8 +418,12 @@ static bool update_ctx_save_restore_size(uint32_t nodeid, struct queue *q) ctl_stack_size = cu_num * WAVES_PER_CU_VI * 8 + 8; wg_data_size = cu_num * WG_CONTEXT_DATA_SIZE_PER_CU_VI; q->ctl_stack_size = PAGE_ALIGN_UP(ctl_stack_size); - q->ctx_save_restore_size = - q->ctl_stack_size + PAGE_ALIGN_UP(wg_data_size); + q->ctx_save_restore_size = PAGE_ALIGN_UP(wg_data_size); + + if (q->dev_info->asic_family < CHIP_VEGA10) + /* GFX8 chips store ctl-stack with WG data */ + q->ctx_save_restore_size += q->ctl_stack_size; + return true; } return false;