[Intel-gfx] [PATCH i-g-t v4 2/6] lib/igt_kms: Fix off-by-one bug on skip of missing pipe

Petri Latvala petri.latvala at intel.com
Thu Sep 28 08:33:48 UTC 2017


On Wed, Sep 27, 2017 at 03:34:15PM -0300, Gabriel Krisman Bertazi wrote:
> 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.
                                                          ^unexisting




-- 
Petri Latvala



> 
> Signed-off-by: Gabriel Krisman Bertazi <krisman at collabora.co.uk>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  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 7bcafc072f70..c7b169afba54 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1865,7 +1865,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(pipe >= igt_display_get_n_pipes(display),
>  		      "Pipe %s does not exist.\n", kmstest_pipe_name(pipe));
>  
>  	for_each_valid_output_on_pipe(display, pipe, output)
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list