[RFC 5/5] drm/amdgpu: Only show VRAM in fdinfo if it exists

Tvrtko Ursulin tvrtko.ursulin at igalia.com
Thu May 2 14:46:31 UTC 2024


On 02/05/2024 14:16, Christian König wrote:
> Am 30.04.24 um 19:27 schrieb Tvrtko Ursulin:
>> From: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
>>
>> Do not emit the key-value pairs if the VRAM does not exist ie. VRAM
>> placement is not valid and accessible.
> 
> Yeah, that's unfortunately rather misleading.
> 
> Even APUs have VRAM or rather stolen system memory which is managed by 
> the graphics driver.
> 
> We only have a single compute model which really doesn't have VRAM at all.

Hm what is misleading and how more precisely? :) Maybe in other words, 
if is_app_apu is not the right criteria to know when TTM_PL_VRAM is 
impossible, what is? Is the compute model you mentio the only thing 
which sets is_app_apu and uses the dummy vram manager?

Regards,

Tvrtko

> Regards,
> Christian.
> 
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 29 +++++++++++++---------
>>   1 file changed, 17 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
>> index a09944104c41..603a5c010f5d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
>> @@ -83,25 +83,30 @@ void amdgpu_show_fdinfo(struct drm_printer *p, 
>> struct drm_file *file)
>>        */
>>       drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
>> -    drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL);
>>       drm_printf(p, "drm-memory-gtt: \t%llu KiB\n", stats.gtt/1024UL);
>>       drm_printf(p, "drm-memory-cpu: \t%llu KiB\n", stats.cpu/1024UL);
>> -    drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
>> -           stats.visible_vram/1024UL);
>> -    drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
>> -           stats.evicted_vram/1024UL);
>> -    drm_printf(p, "amd-evicted-visible-vram:\t%llu KiB\n",
>> -           stats.evicted_visible_vram/1024UL);
>> -    drm_printf(p, "amd-requested-vram:\t%llu KiB\n",
>> -           stats.requested_vram/1024UL);
>> -    drm_printf(p, "amd-requested-visible-vram:\t%llu KiB\n",
>> -           stats.requested_visible_vram/1024UL);
>>       drm_printf(p, "amd-requested-gtt:\t%llu KiB\n",
>>              stats.requested_gtt/1024UL);
>> -    drm_printf(p, "drm-shared-vram:\t%llu KiB\n", 
>> stats.vram_shared/1024UL);
>>       drm_printf(p, "drm-shared-gtt:\t%llu KiB\n", 
>> stats.gtt_shared/1024UL);
>>       drm_printf(p, "drm-shared-cpu:\t%llu KiB\n", 
>> stats.cpu_shared/1024UL);
>> +    if (!adev->gmc.is_app_apu) {
>> +        drm_printf(p, "drm-memory-vram:\t%llu KiB\n",
>> +               stats.vram/1024UL);
>> +        drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
>> +               stats.visible_vram/1024UL);
>> +        drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
>> +               stats.evicted_vram/1024UL);
>> +        drm_printf(p, "amd-evicted-visible-vram:\t%llu KiB\n",
>> +               stats.evicted_visible_vram/1024UL);
>> +        drm_printf(p, "amd-requested-vram:\t%llu KiB\n",
>> +               stats.requested_vram/1024UL);
>> +        drm_printf(p, "amd-requested-visible-vram:\t%llu KiB\n",
>> +               stats.requested_visible_vram/1024UL);
>> +        drm_printf(p, "drm-shared-vram:\t%llu KiB\n",
>> +               stats.vram_shared/1024UL);
>> +    }
>> +
>>       for (hw_ip = 0; hw_ip < AMDGPU_HW_IP_NUM; ++hw_ip) {
>>           if (!usage[hw_ip])
>>               continue;
> 


More information about the amd-gfx mailing list