Skip to contentSkip to conversation

drm/amdgpu: drop printing the BO offset in the gem debugfs

PATCH In review Christian König 2 participants 4 messages May 11, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: drop printing the BO offset in the gem debugfs

It is meaningless anyway.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -4
index 7d3dc229fa47..c3f8c5573a97 100644
@@ -803,10 +803,6 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
 	seq_printf(m, "\t0x%08x: %12ld byte %s",
 		   id, amdgpu_bo_size(bo), placement);
 
-	offset = READ_ONCE(bo->tbo.mem.start);
-	if (offset != AMDGPU_BO_INVALID_OFFSET)
-		seq_printf(m, " @ 0x%010Lx", offset);
-
 	pin_count = READ_ONCE(bo->pin_count);
 	if (pin_count)
 		seq_printf(m, " pin count %d", pin_count);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180511154001.1754-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu: print the BO flags in the gem debugfs entry

Quite usfull to know.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +15 -0
index c3f8c5573a97..b09030167c44 100644
@@ -774,6 +774,12 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 }
 
 #if defined(CONFIG_DEBUG_FS)
+
+#define amdgpu_debugfs_gem_bo_print_flag(m, bo, flag)	\
+	if (bo->flags & (AMDGPU_GEM_CREATE_ ## flag)) {	\
+		seq_printf((m), " " #flag);		\
+	}
+
 static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
 {
 	struct drm_gem_object *gobj = ptr;
@@ -815,6 +821,15 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
 	else if (dma_buf)
 		seq_printf(m, " exported as %p", dma_buf);
 
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, CPU_ACCESS_REQUIRED);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, NO_CPU_ACCESS);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, CPU_GTT_USWC);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, VRAM_CLEARED);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, SHADOW);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, VRAM_CONTIGUOUS);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, VM_ALWAYS_VALID);
+	amdgpu_debugfs_gem_bo_print_flag(m, bo, EXPLICIT_SYNC);
+
 	seq_printf(m, "\n");
 
 	return 0;
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180511154001.1754-2-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: print the BO flags in the gem debugfs entry

Quoted 1 line · Christian König

Quite usfull to know.

"useful"

With that fixed:

Quoted 42 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +15 -1
index c3f8c5573a97..b09030167c44 100644
@@ -774,6 +774,12 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 }
 
 #if defined(CONFIG_DEBUG_FS)
+
+#define amdgpu_debugfs_gem_bo_print_flag(m, bo, flag)  \
+       if (bo->flags & (AMDGPU_GEM_CREATE_ ## flag)) { \
+               seq_printf((m), " " #flag);             \
+       }
+
 static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
 {
        struct drm_gem_object *gobj = ptr;
@@ -815,6 +821,15 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
        else if (dma_buf)
                seq_printf(m, " exported as %p", dma_buf);
 
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, CPU_ACCESS_REQUIRED);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, NO_CPU_ACCESS);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, CPU_GTT_USWC);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, VRAM_CLEARED);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, SHADOW);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, VRAM_CONTIGUOUS);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, VM_ALWAYS_VALID);
+       amdgpu_debugfs_gem_bo_print_flag(m, bo, EXPLICIT_SYNC);
+
        seq_printf(m, "\n");
 
        return 0;
--

2.14.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · Christian König

It is meaningless anyway.

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -5
index 7d3dc229fa47..c3f8c5573a97 100644
@@ -803,10 +803,6 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
        seq_printf(m, "\t0x%08x: %12ld byte %s",
                   id, amdgpu_bo_size(bo), placement);
 
-       offset = READ_ONCE(bo->tbo.mem.start);
-       if (offset != AMDGPU_BO_INVALID_OFFSET)
-               seq_printf(m, " @ 0x%010Lx", offset);
-
        pin_count = READ_ONCE(bo->pin_count);
        if (pin_count)
                seq_printf(m, " pin count %d", pin_count);
--

2.14.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx