All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Cc: anonymoustranquillity@proton.me,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [PATCH i-g-t] tools/intel_gpu_top: Fix near full percentage bar formatting
Date: Thu, 18 Jan 2024 08:48:38 +0000	[thread overview]
Message-ID: <20240118084838.734165-1-tvrtko.ursulin@linux.intel.com> (raw)

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

Fix a bug where 1) the end vertical separator element would not be printed
if the progress bar portion was all filled by the progress bar characters
(no trailing spaces), and 2) the numerical overlay would be skipped to.

The bug would also shift the layout of following UI elements since the
progress bar would not be consuming all the allocated horizontal space.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: anonymoustranquillity@proton.me
---
 tools/intel_gpu_top.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 046ead15a122..5b4f94d7de7a 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1015,9 +1015,8 @@ print_percentage_bar(double percent, double max, int max_len, bool numeric)
 		printf("%s", bars[i]);
 
 	len -= (bar_len + (w - 1)) / w;
-	if (len < 1)
-		return;
-	n_spaces(len);
+	if (len >= 1)
+		n_spaces(len);
 
 	putchar('|');
 
-- 
2.40.1


WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [PATCH i-g-t] tools/intel_gpu_top: Fix near full percentage bar formatting
Date: Thu, 18 Jan 2024 08:48:38 +0000	[thread overview]
Message-ID: <20240118084838.734165-1-tvrtko.ursulin@linux.intel.com> (raw)

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

Fix a bug where 1) the end vertical separator element would not be printed
if the progress bar portion was all filled by the progress bar characters
(no trailing spaces), and 2) the numerical overlay would be skipped to.

The bug would also shift the layout of following UI elements since the
progress bar would not be consuming all the allocated horizontal space.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: anonymoustranquillity@proton.me
---
 tools/intel_gpu_top.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 046ead15a122..5b4f94d7de7a 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1015,9 +1015,8 @@ print_percentage_bar(double percent, double max, int max_len, bool numeric)
 		printf("%s", bars[i]);
 
 	len -= (bar_len + (w - 1)) / w;
-	if (len < 1)
-		return;
-	n_spaces(len);
+	if (len >= 1)
+		n_spaces(len);
 
 	putchar('|');
 
-- 
2.40.1


             reply	other threads:[~2024-01-18  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  8:48 Tvrtko Ursulin [this message]
2024-01-18  8:48 ` [PATCH i-g-t] tools/intel_gpu_top: Fix near full percentage bar formatting Tvrtko Ursulin
2024-01-18 13:55 ` ✓ CI.xeBAT: success for " Patchwork
2024-01-18 14:03 ` ✓ Fi.CI.BAT: " Patchwork
2024-01-18 16:12 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-22 10:38 ` [PATCH i-g-t] " Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240118084838.734165-1-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=anonymoustranquillity@proton.me \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.