Skip to contentSkip to conversation

drm/panthor: Avoid showing imported BO as exported in DebugFS output

PATCH In review Akash Goel 3 participants 3 messages Dec 16, 2025 – Dec 17, 2025

Subsystems (3)
lore
Share & tools
lore

Akash Goel

author
#0 lore raw

PATCH 1/1 drm/panthor: Avoid showing imported BO as exported in DebugFS output

The "gems" DebugFS file shows the device-wide list of DRM GEM objects. It displays various information about an object, including if it is PRIME imported, PRIME exported.
This commit fixes the debugfs_bo_print() function to prevent an imported BO from also being shown as exported in the DebugFS file output. Both 'import_attach' and 'dma_buf' fields will not be NULL for an imported BO.

Fixes a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS")
---
 drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_gem.c +1 -1
index b61908fd508a..5dd92cdcf316 100644
@@ -668,7 +668,7 @@ static void panthor_gem_debugfs_bo_print(struct panthor_gem_object *bo,
 
 	if (bo->base.base.import_attach)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED;
-	if (bo->base.base.dma_buf)
+	else if (bo->base.base.dma_buf)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED;
 
 	seq_printf(m, "0x%-8x 0x%-10x", gem_state_flags, gem_usage_flags);
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Tue, 16 Dec 2025 15:32:42 +0000 Akash Goel <[email protected]> wrote:

The "gems" DebugFS file shows the device-wide list of DRM GEM objects. It displays various information about an object, including if it is PRIME imported, PRIME exported.
This commit fixes the debugfs_bo_print() function to prevent an imported BO from also being shown as exported in the DebugFS file output. Both 'import_attach' and 'dma_buf' fields will not be NULL for an imported BO.

Fixes a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS")
Quoted 17 lines
---
 drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_gem.c +1 -1
index b61908fd508a..5dd92cdcf316 100644
@@ -668,7 +668,7 @@ static void panthor_gem_debugfs_bo_print(struct panthor_gem_object *bo,
 
 	if (bo->base.base.import_attach)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED;
-	if (bo->base.base.dma_buf)
+	else if (bo->base.base.dma_buf)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED;
 
 	seq_printf(m, "0x%-8x 0x%-10x", gem_state_flags, gem_usage_flags);
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Akash Goel
Quoted 10 lines · Akash Goel

The "gems" DebugFS file shows the device-wide list of DRM GEM objects. It displays various information about an object, including if it is PRIME imported, PRIME exported.
This commit fixes the debugfs_bo_print() function to prevent an imported BO from also being shown as exported in the DebugFS file output. Both 'import_attach' and 'dma_buf' fields will not be NULL for an imported BO.

Fixes a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS")
Quoted 17 lines
---
 drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_gem.c +1 -1
index b61908fd508a..5dd92cdcf316 100644
@@ -668,7 +668,7 @@ static void panthor_gem_debugfs_bo_print(struct panthor_gem_object *bo,
 
 	if (bo->base.base.import_attach)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED;
-	if (bo->base.base.dma_buf)
+	else if (bo->base.base.dma_buf)
 		gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED;
 
 	seq_printf(m, "0x%-8x 0x%-10x", gem_state_flags, gem_usage_flags);