drm/amdgpu: remove invalid resource->start check
Subsystems (2)
PATCH 1/1 drm/amdgpu: remove invalid resource->start check
The majority of those where removed in the patch aed01a68047b drm/amdgpu: Remove TTM resource->start visible VRAM condition v2
But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -3
@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,break ;case TTM_PL_VRAM : mem->bus.offset = mem->start <<PAGE_SHIFT ; -/* check if it's visible */ -if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size) -return -EINVAL ;if (adev->mman.aper_base_kaddr && mem->placement &TTM_PL_FLAG_CONTIGUOUS )
Signature · 1 line
2.34.1
Le 20/03/2024 à 13:49, Christian König a écrit :
Quoted 10 lines
The majority of those where removed in the patch
aed01a68047bdrm/amdgpu: Remove TTMresource->startvisible VRAM condition v2But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.
Fixes aed01a68047b ("drm/amdgpu: Remove TTM resource->start visible VRAM condition v2")Signed-off-by Christian König <[email protected]>
Thanks!
Quoted 18 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-3@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,break ;case TTM_PL_VRAM : mem->bus.offset = mem->start <<PAGE_SHIFT ; -/* check if it's visible */ -if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size) -return -EINVAL ;if (adev->mman.aper_base_kaddr && mem->placement &TTM_PL_FLAG_CONTIGUOUS )
On my kernel branch this produces an "unused variable" warning for 'bus_size' so it should be dropped as well.
Pierre-Eric
Le 21/03/2024 à 13:25, Pierre-Eric Pelloux-Prayer a écrit :
Quoted 35 lines
Le 20/03/2024 à 13:49, Christian König a écrit :
Quoted 10 lines
The majority of those where removed in the patch
aed01a68047bdrm/amdgpu: Remove TTMresource->startvisible VRAM condition v2But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.
Fixes aed01a68047b ("drm/amdgpu: Remove TTM resource->start visible VRAM condition v2")Signed-off-by Christian König <[email protected]>Thanks!
Quoted 17 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 3 ---1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev, break;case
TTM_PL_VRAM:
mem->bus.offset=mem->start<<PAGE_SHIFT;
- /* check if it's visible */
- if ((mem->bus.offset+bus_size) >adev->gmc.visible_vram_size) - return-EINVAL;
if (adev->mman.aper_base_kaddr&&
mem->placement&TTM_PL_FLAG_CONTIGUOUS)