summaryrefslogtreecommitdiff
path: root/tests/kms_draw_crc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2017-09-21 16:36:32 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2017-10-09 20:57:04 +0300
commitf1e77e83d620f66f98401854a63b93dc4cead880 (patch)
treeecf6065343e641abe9648e9dc3c84c853cd982c1 /tests/kms_draw_crc.c
parent4ac32f48a8668d928ccddfae1b4213fe7f35c390 (diff)
tests/kms_draw_crc: Skip tests for unsupported formats
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ä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/kms_draw_crc.c')
-rw-r--r--tests/kms_draw_crc.c23
1 files changed, 20 insertions, 3 deletions
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. */