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_atomic.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_atomic.c')
-rw-r--r-- | tests/kms_atomic.c | 13 |
1 files changed, 3 insertions, 10 deletions
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; |