mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 11:33:36 -04:00
drm/amdgpu: update GPU addresses for SMU and PSP
add amdgpu_bo_fb_aper_addr() and update the cached GPU addresses to use the FB aperture address for SMU and PSP. 2 reasons for this change: 1. when pdb0 is enabled, gpu addr from amdgpu_bo_create_kernel() is GART aperture address, it is not compatible with SMU and PSP, it need to be updated to use FB aperture address. 2. Since FB aperture address will change after switching to new GPU index after hibernation, it need to be updated on resume. Signed-off-by: Jiang Liu <gerry@linux.alibaba.com> Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
0f566f0e9c
commit
18b66a6c2a
@@ -1472,6 +1472,26 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
|
||||
return amdgpu_bo_gpu_offset_no_check(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_bo_fb_aper_addr - return FB aperture GPU offset of the VRAM bo
|
||||
* @bo: amdgpu VRAM buffer object for which we query the offset
|
||||
*
|
||||
* Returns:
|
||||
* current FB aperture GPU offset of the object.
|
||||
*/
|
||||
u64 amdgpu_bo_fb_aper_addr(struct amdgpu_bo *bo)
|
||||
{
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
uint64_t offset, fb_base;
|
||||
|
||||
WARN_ON_ONCE(bo->tbo.resource->mem_type != TTM_PL_VRAM);
|
||||
|
||||
fb_base = adev->gmc.fb_start;
|
||||
fb_base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
|
||||
offset = (bo->tbo.resource->start << PAGE_SHIFT) + fb_base;
|
||||
return amdgpu_gmc_sign_extend(offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_bo_gpu_offset_no_check - return GPU offset of bo
|
||||
* @bo: amdgpu object for which we query the offset
|
||||
|
||||
Reference in New Issue
Block a user