The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output
@ 2025-12-16 15:32 Akash Goel
  2025-12-17 13:11 ` Boris Brezillon
  2025-12-17 15:05 ` Steven Price
  0 siblings, 2 replies; 3+ messages in thread
From: Akash Goel @ 2025-12-16 15:32 UTC (permalink / raw)
  To: boris.brezillon, liviu.dudau, steven.price
  Cc: dri-devel, linux-kernel, maarten.lankhorst, mripard, tzimmermann,
	airlied, daniel, nd, 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")
Signed-off-by: Akash Goel <akash.goel@arm.com>
---
 drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
index b61908fd508a..5dd92cdcf316 100644
--- a/drivers/gpu/drm/panthor/panthor_gem.c
+++ b/drivers/gpu/drm/panthor/panthor_gem.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output
  2025-12-16 15:32 [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output Akash Goel
@ 2025-12-17 13:11 ` Boris Brezillon
  2025-12-17 15:05 ` Steven Price
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2025-12-17 13:11 UTC (permalink / raw)
  To: Akash Goel
  Cc: liviu.dudau, steven.price, dri-devel, linux-kernel,
	maarten.lankhorst, mripard, tzimmermann, airlied, daniel, nd

On Tue, 16 Dec 2025 15:32:42 +0000
Akash Goel <akash.goel@arm.com> 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")
> Signed-off-by: Akash Goel <akash.goel@arm.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index b61908fd508a..5dd92cdcf316 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -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);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output
  2025-12-16 15:32 [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output Akash Goel
  2025-12-17 13:11 ` Boris Brezillon
@ 2025-12-17 15:05 ` Steven Price
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Price @ 2025-12-17 15:05 UTC (permalink / raw)
  To: Akash Goel, boris.brezillon, liviu.dudau
  Cc: dri-devel, linux-kernel, maarten.lankhorst, mripard, tzimmermann,
	airlied, daniel, nd

On 16/12/2025 15:32, Akash Goel 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")
> Signed-off-by: Akash Goel <akash.goel@arm.com>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index b61908fd508a..5dd92cdcf316 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -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);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-17 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 15:32 [PATCH] drm/panthor: Avoid showing imported BO as exported in DebugFS output Akash Goel
2025-12-17 13:11 ` Boris Brezillon
2025-12-17 15:05 ` Steven Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox