summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2020-12-17 10:36:43 +0000
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2020-12-18 17:17:27 +0000
commit8c134d69f46a90fe149ac67798cc208091448e3d (patch)
tree6d8aa5fdf162fe25bdc6b4f9f8ec56ed48c9e667
parent7cb112175cffe162809ebdd820030963301de6a6 (diff)
intel_gpu_top: Fix interactive mode on serial console
TIOCGWINSZ returns zero columns and rows on serial so lets assume 80x24. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-rw-r--r--tools/intel_gpu_top.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index d1149eb8..72ad7cbe 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1640,6 +1640,11 @@ int main(int argc, char **argv)
} else if (ioctl(0, TIOCGWINSZ, &ws) != -1) {
con_w = ws.ws_col;
con_h = ws.ws_row;
+ if (con_w == 0 && con_h == 0) {
+ /* Serial console. */
+ con_w = 80;
+ con_h = 24;
+ }
}
pmu_sample(engines);