public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Gabriel Krisman Bertazi <krisman@collabora.co.uk>,
	intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@intel.com, daniels@collabora.com,
	tomeu.vizoso@collabora.com
Subject: Re: [PATCH i-g-t v3 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe
Date: Thu, 31 Aug 2017 09:06:32 +0200	[thread overview]
Message-ID: <ca0dd9c3-2423-f8b4-b72e-758cdc89fcae@linux.intel.com> (raw)
In-Reply-To: <20170831061810.11773-3-krisman@collabora.co.uk>

Op 31-08-17 om 08:18 schreef Gabriel Krisman Bertazi:
> display->n_pipes is zero-indexed, so N returned in
> igt_display_get_n_pipes is already not a valid pipe.  This patch
> prevents kms_ccs from going nuts when testing the first unxesting pipe.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> ---
>  lib/igt_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 14e2701c3afd..ce07fcc1fc73 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1864,7 +1864,7 @@ void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe)
>  {
>  	igt_output_t *output;
>  
> -	igt_skip_on_f(igt_display_get_n_pipes(display) < pipe,
> +	igt_skip_on_f(igt_display_get_n_pipes(display) <= pipe,
>  		      "Pipe %s does not exist.\n", kmstest_pipe_name(pipe));
>  
>  	for_each_valid_output_on_pipe(display, pipe, output)

I think the original check is correct?

Although it could be inverted to make it more clear, matching the other similar checks in tests/kms_*.c:

igt_skip_on_f(pipe >= igt_display_get_n_pipes(display),

But your change doesn't match what any user of n_pipes in /tests is doing, so I'm afraid I have to NACK. :)

Kind regards,
Maarten

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-08-31  7:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31  6:18 [PATCH i-g-t v3 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
2017-08-31  7:06   ` Maarten Lankhorst [this message]
2017-08-31  7:08     ` Maarten Lankhorst
2017-08-31  6:18 ` [PATCH i-g-t v3 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size Gabriel Krisman Bertazi
2017-09-05  8:03   ` Daniel Stone
2017-08-31 12:47 ` ✓ Fi.CI.BAT: success for kms_ccs testcase improvements Patchwork
2017-08-31 18:28 ` ✓ Fi.CI.IGT: " Patchwork

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=ca0dd9c3-2423-f8b4-b72e-758cdc89fcae@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=daniels@collabora.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=krisman@collabora.co.uk \
    --cc=tomeu.vizoso@collabora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox