diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-02-02 11:32:40 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-02-12 13:13:07 +0100 |
commit | c60cf3b51244334117c69db1f4665ff52815de03 (patch) | |
tree | d7d9acfae339678c5f3bf659ae9cc343b0af5711 /tests/kms_plane.c | |
parent | aa5068c58947f31252cad69d80686e40bbce29db (diff) |
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 <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
Diffstat (limited to 'tests/kms_plane.c')
-rw-r--r-- | tests/kms_plane.c | 16 |
1 files changed, 1 insertions, 15 deletions
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", |