diff -Nru intel-gpu-tools-1.27.1/debian/changelog intel-gpu-tools-1.27.1/debian/changelog --- intel-gpu-tools-1.27.1/debian/changelog 2023-02-08 07:40:10.000000000 +0000 +++ intel-gpu-tools-1.27.1/debian/changelog 2024-04-15 15:23:37.000000000 +0000 @@ -1,3 +1,9 @@ +intel-gpu-tools (1.27.1-1ubuntu0.1) mantic; urgency=medium + + * tools/intel_gpu_top: Handle narrow terminals more gracefully (LP: #1949314) + + -- Hector Cao Mon, 15 Apr 2024 17:23:37 +0200 + intel-gpu-tools (1.27.1-1) unstable; urgency=medium * New upstream release. diff -Nru intel-gpu-tools-1.27.1/debian/patches/series intel-gpu-tools-1.27.1/debian/patches/series --- intel-gpu-tools-1.27.1/debian/patches/series 2023-02-08 07:29:00.000000000 +0000 +++ intel-gpu-tools-1.27.1/debian/patches/series 2024-04-15 15:23:37.000000000 +0000 @@ -1,2 +1,3 @@ #placeholder libproc2_library +ubuntu/0001-tools-intel_gpu_top-Handle-narrow-terminals-more-gra.patch diff -Nru intel-gpu-tools-1.27.1/debian/patches/ubuntu/0001-tools-intel_gpu_top-Handle-narrow-terminals-more-gra.patch intel-gpu-tools-1.27.1/debian/patches/ubuntu/0001-tools-intel_gpu_top-Handle-narrow-terminals-more-gra.patch --- intel-gpu-tools-1.27.1/debian/patches/ubuntu/0001-tools-intel_gpu_top-Handle-narrow-terminals-more-gra.patch 1970-01-01 00:00:00.000000000 +0000 +++ intel-gpu-tools-1.27.1/debian/patches/ubuntu/0001-tools-intel_gpu_top-Handle-narrow-terminals-more-gra.patch 2024-04-15 15:23:37.000000000 +0000 @@ -0,0 +1,40 @@ +From bc7526f5bf67bce486128d37e9bb64e62d82502c Mon Sep 17 00:00:00 2001 +From: Hector Cao +Date: Mon, 15 Apr 2024 20:06:36 +0200 +Subject: [PATCH] tools/intel_gpu_top: Handle narrow terminals more gracefully + +This patch is a modified version of the following upstream fix to +be compatible with the version 1.27 or older: + +9e4079c6 tools/intel_gpu_top: Handle narrow terminals more gracefully +Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/9e4079c622d43dee45ddac00b2d6b06d6bdb327b +--- + tools/intel_gpu_top.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c +index 6de8a16..de83491 100644 +--- a/tools/intel_gpu_top.c ++++ b/tools/intel_gpu_top.c +@@ -1222,7 +1222,8 @@ print_percentage_bar(double percent, int max_len, bool numeric) + int bar_len, i, len = max_len - 2; + const int w = 8; + +- assert(max_len > 0); ++ if (len < 2) /* For edge lines '|' */ ++ return; + + bar_len = ceil(w * percent * len / 100.0); + if (bar_len > w * len) +@@ -1237,6 +1238,8 @@ print_percentage_bar(double percent, int max_len, bool numeric) + + len -= (bar_len + (w - 1)) / w; + n_spaces(len); ++ if (len < 1) ++ return; + + putchar('|'); + +-- +2.39.2 +