drm/amdgpu: improve amdgpu_gem_info debugfs file
authorChristian König <christian.koenig@amd.com>
Tue, 10 Mar 2020 13:23:12 +0000 (14:23 +0100)
committerChristian König <christian.koenig@amd.com>
Wed, 1 Apr 2020 07:02:45 +0000 (09:02 +0200)
Note if a buffer was imported using peer2peer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/359296
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 4277125a79ee45ef61a8f9ad42f903e9b0a0fe7f..e42608115c99a5c4b574471c1717d992b15376ae 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/module.h>
 #include <linux/pagemap.h>
 #include <linux/pci.h>
+#include <linux/dma-buf.h>
 
 #include <drm/amdgpu_drm.h>
 #include <drm/drm_debugfs.h>
@@ -854,7 +855,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
        attachment = READ_ONCE(bo->tbo.base.import_attach);
 
        if (attachment)
-               seq_printf(m, " imported from %p", dma_buf);
+               seq_printf(m, " imported from %p%s", dma_buf,
+                          attachment->peer2peer ? " P2P" : "");
        else if (dma_buf)
                seq_printf(m, " exported as %p", dma_buf);