drm/amdgpu: correctly sign extend 48bit addresses v2
Subsystems (2)
PATCH 1/1 drm/amdgpu: correctly sign extend 48bit addresses v2
Correct sign extend the GMC addresses to 48bit.
v2: sign extending turned out easier than thought.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +7 -1
@@ -1361,6 +1361,8 @@ void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,*/ u64 amdgpu_bo_gpu_offset (struct amdgpu_bo *bo) { +uint64_t addr; +WARN_ON_ONCE (bo->tbo.mem.mem_type ==TTM_PL_SYSTEM );WARN_ON_ONCE (bo->tbo.mem.mem_type ==TTM_PL_TT && !amdgpu_gtt_mgr_has_gart_addr (&bo->tbo.mem));
@@ -1370,7 +1372,11 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)WARN_ON_ONCE (bo->tbo.mem.mem_type ==TTM_PL_VRAM && !(bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS )); -return bo->tbo.offset; + addr = bo->tbo.offset; +if (addr >=AMDGPU_VA_HOLE_START ) + addr |=AMDGPU_VA_HOLE_END ; + +return addr; }/**
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx