drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible
From: Michel Dänzer <[email protected]>
It incorrectly claimed a resource isn't CPU visible if it's located at the very end of CPU visible VRAM.
Fixes a6ff969fe9 ("drm/amdgpu: fix visible VRAM handling during faults")
Reported-and-Tested-by Jeremy Day <[email protected]>
Signed-off-by Michel Dänzer <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -427,7 +427,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev,amdgpu_res_first (res,0 , res->size, &cursor);while (cursor.remaining) { -if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size) +if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size)return false;amdgpu_res_next (&cursor, cursor.size); }
Signature · 1 line
2.43.0
Quoted 9 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
It incorrectly claimed a resource isn't CPU visible if it's located at the very end of CPU visible VRAM.
Fixes a6ff969fe9 ("drm/amdgpu: fix visible VRAM handling during faults")Reported-and-Tested-by Jeremy Day <[email protected]>Signed-off-by Michel Dänzer <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
and applied. Thanks!
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2@@ -427,7 +427,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev,amdgpu_res_first (res,0 , res->size, &cursor);while (cursor.remaining) { -if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size) +if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size)return false;amdgpu_res_next (&cursor, cursor.size); } --2.43.0
Am 08.05.24 um 15:45 schrieb Alex Deucher:
Quoted 10 lines · Michel Dänzer
Quoted 8 lines
From: Michel Dänzer <[email protected]>
It incorrectly claimed a resource isn't CPU visible if it's located at the very end of CPU visible VRAM.
Fixes a6ff969fe9 ("drm/amdgpu: fix visible VRAM handling during faults")Reported-and-Tested-by Jeremy Day <[email protected]>Signed-off-by Michel Dänzer <[email protected]>Reviewed-by Alex Deucher <[email protected]>
Reviewed-by Christian König <[email protected]>
Christian.
Quoted 24 lines
and applied. Thanks!
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2@@ -427,7 +427,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev,amdgpu_res_first (res,0 , res->size, &cursor);while (cursor.remaining) { -if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size) +if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size)return false;amdgpu_res_next (&cursor, cursor.size); } --2.43.0