[PATCH i-g-t 11/12] gputop: Extract clrscr()
Lucas De Marchi
lucas.demarchi at intel.com
Fri Apr 5 06:00:55 UTC 2024
Make it clear what the CSI is doing.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
tools/gputop.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/gputop.c b/tools/gputop.c
index 1f349b3ed..ea23e1de5 100644
--- a/tools/gputop.c
+++ b/tools/gputop.c
@@ -260,6 +260,11 @@ static void update_console_size(int *w, int *h)
}
}
+static void clrscr(void)
+{
+ printf("\033[H\033[J");
+}
+
int main(int argc, char **argv)
{
unsigned int period_us = 2e6;
@@ -276,12 +281,11 @@ int main(int argc, char **argv)
struct igt_drm_client *c, *prevc = NULL;
int i, engine_w = 0, lines = 0;
- update_console_size(&con_w, &con_h);
-
igt_drm_clients_scan(clients, NULL, NULL, 0, NULL, 0);
igt_drm_clients_sort(clients, client_cmp);
- printf("\033[H\033[J");
+ update_console_size(&con_w, &con_h);
+ clrscr();
igt_for_each_drm_client(clients, c, i) {
assert(c->status != IGT_DRM_CLIENT_PROBE);
--
2.44.0
More information about the igt-dev
mailing list