[Intel-gfx] [PATCH] drm/i915/fdinfo: Don't show engine classes not present

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Thu Jun 16 14:19:43 UTC 2022


On Thu, Jun 16, 2022 at 03:00:56PM +0100, Tvrtko Ursulin wrote:
>From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
>Stop displaying engine classes with no engines - it is not a huge problem
>if they are shown, since the values will correctly be all zeroes, but it
>does count as misleading.
>
>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>Fixes: 055634e4b62f ("drm/i915: Expose client engine utilisation via fdinfo")
>Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
>---
> drivers/gpu/drm/i915/i915_drm_client.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c
>index 18d38cb59923..b09d1d386574 100644
>--- a/drivers/gpu/drm/i915/i915_drm_client.c
>+++ b/drivers/gpu/drm/i915/i915_drm_client.c
>@@ -116,8 +116,9 @@ show_client_class(struct seq_file *m,
> 		total += busy_add(ctx, class);
> 	rcu_read_unlock();
>
>-	seq_printf(m, "drm-engine-%s:\t%llu ns\n",
>-		   uabi_class_names[class], total);
>+	if (capacity)
>+		seq_printf(m, "drm-engine-%s:\t%llu ns\n",
>+			   uabi_class_names[class], total);

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Regards,
Umesh
>
> 	if (capacity > 1)
> 		seq_printf(m, "drm-engine-capacity-%s:\t%u\n",
>-- 
>2.34.1
>


More information about the Intel-gfx mailing list