From: YuBiao Wang Date: Fri, 15 Sep 2023 02:47:50 +0000 (+0800) Subject: drm/amdkfd: Use gpu_offset for user queue's wptr X-Git-Tag: v6.6.17~3880^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc39f9ccb82426e576734b493e1777ea01b144a8;p=platform%2Fkernel%2Flinux-rpi.git drm/amdkfd: Use gpu_offset for user queue's wptr Directly use tbo's start address will miss the domain start offset. Need to use gpu_offset instead. Signed-off-by: YuBiao Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 8a6cb41..0d3d538 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -216,7 +216,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q, if (q->wptr_bo) { wptr_addr_off = (uint64_t)q->properties.write_ptr & (PAGE_SIZE - 1); - queue_input.wptr_mc_addr = ((uint64_t)q->wptr_bo->tbo.resource->start << PAGE_SHIFT) + wptr_addr_off; + queue_input.wptr_mc_addr = amdgpu_bo_gpu_offset(q->wptr_bo) + wptr_addr_off; } queue_input.is_kfd_process = 1;