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

Ville Syrjala ville.syrjala at linux.intel.com
Thu Sep 21 14:39:28 UTC 2017


From: Ville Syrjälä <ville.syrjala at 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 at linux.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



More information about the Intel-gfx mailing list