diff mbox

[i-g-t,1/6] lib/igt_kms: Don't assert on non-existent plane

Message ID 20170921143933.14618-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä Sept. 21, 2017, 2:39 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Skip when a test can't find a plane by the index. Previously
in commit 5426dc0a889a ("lib/kms: Skip rather than fail when
a suitable plane can't be found") we added similar handling for
tests trying to find a non-existent plane by type. Saves from
every test with hardcoded plane numbers having to check the
number of planes available.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Petri Latvala Sept. 27, 2017, 11:53 a.m. UTC | #1
On Thu, Sep 21, 2017 at 05:39:28PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Skip when a test can't find a plane by the index. Previously
> in commit 5426dc0a889a ("lib/kms: Skip rather than fail when
> a suitable plane can't be found") we added similar handling for
> tests trying to find a non-existent plane by type. Saves from
> every test with hardcoded plane numbers having to check the
> number of planes available.

Do you have a list of such tests? I didn't see any results in CI
change from fail to skip so I presume this means all existing tests
check the number of planes available.



> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  lib/igt_kms.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 7bcafc072f70..83ebb42e6c9a 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2008,9 +2008,9 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
>  
>  static igt_plane_t *igt_pipe_get_plane(igt_pipe_t *pipe, int plane_idx)
>  {
> -	igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
> -		"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
> -		plane_idx, pipe->n_planes);
> +	igt_require_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
> +		      "Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
> +		      plane_idx, pipe->n_planes);
>  
>  	return &pipe->planes[plane_idx];
>  }
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7bcafc072f70..83ebb42e6c9a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2008,9 +2008,9 @@  static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
 
 static igt_plane_t *igt_pipe_get_plane(igt_pipe_t *pipe, int plane_idx)
 {
-	igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
-		"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
-		plane_idx, pipe->n_planes);
+	igt_require_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
+		      "Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
+		      plane_idx, pipe->n_planes);
 
 	return &pipe->planes[plane_idx];
 }