mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-27 08:14:35 +08:00
drm/amdkfd: Add more comments on GFX9 user CP queue MQD workaround
Because too many things are involved in this workaround, we need more comments to avoid pitfalls. Signed-off-by: Yong Zhao <Yong.Zhao@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Philip Yang <philip.yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fa5bde8056
commit
2f6ae2de13
@ -87,9 +87,21 @@ static struct kfd_mem_obj *allocate_mqd(struct kfd_dev *kfd,
|
||||
int retval;
|
||||
struct kfd_mem_obj *mqd_mem_obj = NULL;
|
||||
|
||||
/* From V9, for CWSR, the control stack is located on the next page
|
||||
* boundary after the mqd, we will use the gtt allocation function
|
||||
* instead of sub-allocation function.
|
||||
/* For V9 only, due to a HW bug, the control stack of a user mode
|
||||
* compute queue needs to be allocated just behind the page boundary
|
||||
* of its regular MQD buffer. So we allocate an enlarged MQD buffer:
|
||||
* the first page of the buffer serves as the regular MQD buffer
|
||||
* purpose and the remaining is for control stack. Although the two
|
||||
* parts are in the same buffer object, they need different memory
|
||||
* types: MQD part needs UC (uncached) as usual, while control stack
|
||||
* needs NC (non coherent), which is different from the UC type which
|
||||
* is used when control stack is allocated in user space.
|
||||
*
|
||||
* Because of all those, we use the gtt allocation function instead
|
||||
* of sub-allocation function for this enlarged MQD buffer. Moreover,
|
||||
* in order to achieve two memory types in a single buffer object, we
|
||||
* pass a special bo flag AMDGPU_GEM_CREATE_CP_MQD_GFX9 to instruct
|
||||
* amdgpu memory functions to do so.
|
||||
*/
|
||||
if (kfd->cwsr_enabled && (q->type == KFD_QUEUE_TYPE_COMPUTE)) {
|
||||
mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL);
|
||||
|
Loading…
Reference in New Issue
Block a user