Skip to content

Commit c904e3a

Browse files
Michel Dänzeralexdeucher
authored andcommitted
drm/amdgpu: Fix GTT size reporting in amdgpu_ioctl
The commit below changed the TTM manager size unit from pages to bytes, but failed to adjust the corresponding calculations in amdgpu_ioctl. Fixes: dfa714b ("drm/amdgpu: remove GTT accounting v2") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1930 Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6642 Tested-by: Martin Roukala <martin.roukala@mupuf.org> Tested-by: Mike Lothian <mike@fireburn.co.uk> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Michel Dänzer <mdaenzer@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org # 5.18.x
1 parent 1f192b9 commit c904e3a

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
642642
atomic64_read(&adev->visible_pin_size),
643643
vram_gtt.vram_size);
644644
vram_gtt.gtt_size = ttm_manager_type(&adev->mman.bdev, TTM_PL_TT)->size;
645-
vram_gtt.gtt_size *= PAGE_SIZE;
646645
vram_gtt.gtt_size -= atomic64_read(&adev->gart_pin_size);
647646
return copy_to_user(out, &vram_gtt,
648647
min((size_t)size, sizeof(vram_gtt))) ? -EFAULT : 0;
@@ -675,7 +674,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
675674
mem.cpu_accessible_vram.usable_heap_size * 3 / 4;
676675

677676
mem.gtt.total_heap_size = gtt_man->size;
678-
mem.gtt.total_heap_size *= PAGE_SIZE;
679677
mem.gtt.usable_heap_size = mem.gtt.total_heap_size -
680678
atomic64_read(&adev->gart_pin_size);
681679
mem.gtt.heap_usage = ttm_resource_manager_usage(gtt_man);

0 commit comments

Comments
 (0)