summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-03-25 10:10:25 +0200
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 13:43:34 -0500
commitb1f223c02a3a2b41847f48f75797eba5979ea25d (patch)
tree68bf2b1dbde061d81a0377246f8ace0de54475ca /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent1a3132a1cc03abcf153d08f4eb471cd7d396f2a3 (diff)
downloadop-kernel-dev-b1f223c02a3a2b41847f48f75797eba5979ea25d.zip
op-kernel-dev-b1f223c02a3a2b41847f48f75797eba5979ea25d.tar.gz
drm/amdgpu: print DMA-buf status in debugfs
Just note if a BO was imported/exported. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index c62c3dd..7d3dc22 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -780,6 +780,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
struct seq_file *m = data;
+ struct dma_buf_attachment *attachment;
+ struct dma_buf *dma_buf;
unsigned domain;
const char *placement;
unsigned pin_count;
@@ -808,6 +810,15 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
pin_count = READ_ONCE(bo->pin_count);
if (pin_count)
seq_printf(m, " pin count %d", pin_count);
+
+ dma_buf = READ_ONCE(bo->gem_base.dma_buf);
+ attachment = READ_ONCE(bo->gem_base.import_attach);
+
+ if (attachment)
+ seq_printf(m, " imported from %p", dma_buf);
+ else if (dma_buf)
+ seq_printf(m, " exported as %p", dma_buf);
+
seq_printf(m, "\n");
return 0;
OpenPOWER on IntegriCloud