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_plane.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'tests/kms_plane.c') diff --git a/tests/kms_plane.c b/tests/kms_plane.c index 54bcffc1..23173b96 100644 --- a/tests/kms_plane.c +++ b/tests/kms_plane.c @@ -366,20 +366,6 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags) igt_skip_on(connected_outs == 0); } -static bool can_draw(uint32_t drm_format) -{ - const uint32_t *drm_formats; - int format_count, i; - - igt_get_all_cairo_formats(&drm_formats, &format_count); - - for (i = 0; i < format_count; i++) - if (drm_formats[i] == drm_format) - return true; - - return false; -} - static void test_format_plane(data_t *data, enum pipe pipe, igt_output_t *output, igt_plane_t *plane) { @@ -420,7 +406,7 @@ static void test_format_plane(data_t *data, enum pipe pipe, for (i = 0; i < plane->drm_plane->count_formats; i++) { format = plane->drm_plane->formats[i]; - if (!can_draw(format)) + if (!igt_fb_supported_format(format)) continue; igt_debug("Testing format 0x%x on %s.%u\n", -- cgit v1.2.3