<div dir="auto">Thanks for finding this<div dir="auto"><br></div><div dir="auto">I'll have access to my machine on Monday and will close those issues off once I've tested things</div><div dir="auto"><br></div><div dir="auto">Cheers</div><div dir="auto"><br></div><div dir="auto">Mike</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 11 Jun 2022, 09:19 Christian König, <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 10.06.22 um 15:54 schrieb Michel Dänzer:<br>
> From: Michel Dänzer <<a href="mailto:mdaenzer@redhat.com" target="_blank" rel="noreferrer">mdaenzer@redhat.com</a>><br>
><br>
> The commit below changed the TTM manager size unit from pages to<br>
> bytes, but failed to adjust the corresponding calculations in<br>
> amdgpu_ioctl.<br>
><br>
> Fixes: dfa714b88eb0 ("drm/amdgpu: remove GTT accounting v2")<br>
> Bug: <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/1930" rel="noreferrer noreferrer" target="_blank">https://gitlab.freedesktop.org/drm/amd/-/issues/1930</a><br>
> Bug: <a href="https://gitlab.freedesktop.org/mesa/mesa/-/issues/6642" rel="noreferrer noreferrer" target="_blank">https://gitlab.freedesktop.org/mesa/mesa/-/issues/6642</a><br>
> Signed-off-by: Michel Dänzer <<a href="mailto:mdaenzer@redhat.com" target="_blank" rel="noreferrer">mdaenzer@redhat.com</a>><br>
<br>
Ah, WTF! You won't believe how long I have been searching for this one.<br>
<br>
Reviewed-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank" rel="noreferrer">christian.koenig@amd.com</a>><br>
<br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 --<br>
> 1 file changed, 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
> index 801f6fa692e9..6de63ea6687e 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
> @@ -642,7 +642,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)<br>
> atomic64_read(&adev->visible_pin_size),<br>
> vram_gtt.vram_size);<br>
> vram_gtt.gtt_size = ttm_manager_type(&adev->mman.bdev, TTM_PL_TT)->size;<br>
> - vram_gtt.gtt_size *= PAGE_SIZE;<br>
> vram_gtt.gtt_size -= atomic64_read(&adev->gart_pin_size);<br>
> return copy_to_user(out, &vram_gtt,<br>
> min((size_t)size, sizeof(vram_gtt))) ? -EFAULT : 0;<br>
> @@ -675,7 +674,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)<br>
> mem.cpu_accessible_vram.usable_heap_size * 3 / 4;<br>
> <br>
> mem.gtt.total_heap_size = gtt_man->size;<br>
> - mem.gtt.total_heap_size *= PAGE_SIZE;<br>
> mem.gtt.usable_heap_size = mem.gtt.total_heap_size -<br>
> atomic64_read(&adev->gart_pin_size);<br>
> mem.gtt.heap_usage = ttm_resource_manager_usage(gtt_man);<br>
<br>
</blockquote></div>