[igt-dev] [PATCH i-g-t 11/12] libdrmclient: Unexport igt_drm_client_update

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Mar 31 14:03:47 UTC 2022


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

It is currently unused so no need to export it as API for now.

Also change the signature to take struct drm_client_fdinfo in order to
avoid needing to pass in a sized array.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 lib/igt_drm_clients.c | 16 ++++++++--------
 lib/igt_drm_clients.h |  3 ---
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/lib/igt_drm_clients.c b/lib/igt_drm_clients.c
index e8e86969f984..32e1d7a0f20e 100644
--- a/lib/igt_drm_clients.c
+++ b/lib/igt_drm_clients.c
@@ -77,9 +77,9 @@ igt_drm_clients_find(struct igt_drm_clients *clients,
 	return NULL;
 }
 
-void
+static void
 igt_drm_client_update(struct igt_drm_client *c, unsigned int pid, char *name,
-		      uint64_t val[16])
+		      const struct drm_client_fdinfo *info)
 {
 	unsigned int i;
 
@@ -104,13 +104,13 @@ igt_drm_client_update(struct igt_drm_client *c, unsigned int pid, char *name,
 	c->total_runtime = 0;
 
 	for (i = 0; i <= c->engines->max_engine_id; i++) {
-		if (val[i] < c->last[i])
+		if (info->busy[i] < c->last[i])
 			continue; /* It will catch up soon. */
 
-		c->total_runtime += val[i];
-		c->val[i] = val[i] - c->last[i];
+		c->total_runtime += info->busy[i];
+		c->val[i] = info->busy[i] - c->last[i];
 		c->last_runtime += c->val[i];
-		c->last[i] = val[i];
+		c->last[i] = info->busy[i];
 	}
 
 	c->samples++;
@@ -168,7 +168,7 @@ igt_drm_client_add(struct igt_drm_clients *clients,
 	c->last = calloc(c->engines->max_engine_id + 1, sizeof(c->last));
 	assert(c->val && c->last);
 
-	igt_drm_client_update(c, pid, name, info->busy);
+	igt_drm_client_update(c, pid, name, info);
 }
 
 void igt_drm_client_free(struct igt_drm_client *c)
@@ -418,7 +418,7 @@ igt_drm_clients_scan(struct igt_drm_clients *clients,
 						   client_name, minor);
 			else
 				igt_drm_client_update(c, client_pid,
-						      client_name, info.busy);
+						      client_name, &info);
 		}
 
 next:
diff --git a/lib/igt_drm_clients.h b/lib/igt_drm_clients.h
index 47547aa8b75f..6817acc34e81 100644
--- a/lib/igt_drm_clients.h
+++ b/lib/igt_drm_clients.h
@@ -92,9 +92,6 @@ struct igt_drm_clients *
 igt_drm_clients_sort(struct igt_drm_clients *clients,
 		     int (*cmp)(const void *, const void *, void *));
 
-void igt_drm_client_update(struct igt_drm_client *c,
-			   unsigned int pid, char *name, uint64_t val[16]);
-
 void igt_drm_client_add(struct igt_drm_clients *clients,
 			struct drm_client_fdinfo *,
 			unsigned int pid, char *name, unsigned int drm_minor);
-- 
2.32.0



More information about the igt-dev mailing list