From f1e77e83d620f66f98401854a63b93dc4cead880 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Thu, 21 Sep 2017 16:36:32 +0300 Subject: tests/kms_draw_crc: Skip tests for unsupported formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 10bpc formats aren't supported on all platforms, so skip the test when we can't create the framebuffer. Signed-off-by: Ville Syrjälä Reviewed-by: Petri Latvala --- tests/kms_draw_crc.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'tests/kms_draw_crc.c') diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c index 260950c7..723e7a18 100644 --- a/tests/kms_draw_crc.c +++ b/tests/kms_draw_crc.c @@ -153,16 +153,33 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format, igt_remove_fb(drm_fd, &fb); } +static bool format_is_supported(uint32_t format, uint64_t modifier) +{ + uint32_t gem_handle, fb_id; + unsigned int stride; + int ret; + + gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64, + format, modifier, + 0, NULL, &stride, NULL); + ret = __kms_addfb(drm_fd, gem_handle, 64, 64, + stride, format, modifier, + LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id); + drmModeRmFB(drm_fd, fb_id); + gem_close(drm_fd, gem_handle); + + return ret == 0; +} + static void draw_method_subtest(enum igt_draw_method method, uint32_t format_index, uint64_t tiling) { igt_crc_t crc; - if (tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) - igt_require(intel_gen(intel_get_drm_devid(drm_fd)) >= 9); - igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd)); + igt_require(format_is_supported(formats[format_index], tiling)); + /* Use IGT_DRAW_MMAP_GTT on an untiled buffer as the parameter for * comparison. Cache the value so we don't recompute it for every single * subtest. */ -- cgit v1.2.3