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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 30.04.24 um 19:27 schrieb Tvrtko Ursulin:
From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxx>

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.

Regards,
Christian.


Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxx>
---
  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;




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux