From c60cf3b51244334117c69db1f4665ff52815de03 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 2 Feb 2018 11:32:40 +0100 Subject: lib/igt_fb: Add igt_fb_supported_format() This makes it possible to iterate whether a format is supported or not, without each driver having to open code it. Signed-off-by: Maarten Lankhorst Reviewed-by: Mika Kahola Tested-by: Vidya Srinivas --- tests/kms_atomic.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'tests/kms_atomic.c') diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index 2e21b53b..ac02baf0 100644 --- a/tests/kms_atomic.c +++ b/tests/kms_atomic.c @@ -264,20 +264,13 @@ static void crtc_commit_atomic_flags_err(igt_pipe_t *pipe, igt_plane_t *plane, static uint32_t plane_get_igt_format(igt_plane_t *plane) { drmModePlanePtr plane_kms; - const uint32_t *igt_formats; - int num_igt_formats; int i; plane_kms = plane->drm_plane; - igt_get_all_cairo_formats(&igt_formats, &num_igt_formats); - for (i = 0; i < num_igt_formats; i++) { - int j; - - for (j = 0; j < plane_kms->count_formats; j++) { - if (plane_kms->formats[j] == igt_formats[i]) - return plane_kms->formats[j]; - } + for (i = 0; i < plane_kms->count_formats; i++) { + if (igt_fb_supported_format(plane_kms->formats[i])) + return plane_kms->formats[i]; } return 0; -- cgit v1.2.3