diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2024-04-30 12:01:50 -0700 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2024-05-01 01:48:55 -0500 |
commit | 68a055ff91b91dadb01d9501cd8670f654b5b952 (patch) | |
tree | 7ee0568e5b596fdfc59685e48c5b488ac867373a /tools | |
parent | d407d11c9659fb30d46206606e157b4bfa03b971 (diff) |
tools/gputop: Extract clrscr()
Make it clear what the CSI is doing.
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://lore.kernel.org/r/20240430190150.3654507-6-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gputop.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/gputop.c b/tools/gputop.c index 455f77d0c..8cec951b4 100644 --- a/tools/gputop.c +++ b/tools/gputop.c @@ -285,6 +285,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; @@ -301,12 +306,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); |