From decbf5a3b11878b93caaddda7c738b866939c1e2 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 24 Feb 2016 10:38:25 +0100 Subject: kms_addfb_basic: call igt_create_bo_with_dimensions Many tests can do their work on drivers other than i915 and even with just dumb buffers, so call igt_create_bo_with_dimensions instead of gem_create which will paper out the differences and call the proper ioctls or cause the subtest to be skipped if that's not possible. Signed-off-by: Tomeu Vizoso Reviewed-by: Daniel Stone Acked-by: Daniel Vetter --- tests/kms_addfb_basic.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tests/kms_addfb_basic.c') diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c index 73000d6e..1cf09767 100644 --- a/tests/kms_addfb_basic.c +++ b/tests/kms_addfb_basic.c @@ -51,9 +51,11 @@ static void invalid_tests(int fd) f.pitches[0] = 512*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); f.handles[0] = gem_bo; @@ -129,7 +131,8 @@ static void pitch_tests(int fd) f.pitches[0] = 1024*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); } @@ -211,9 +214,11 @@ static void size_tests(int fd) f_8.pitches[0] = 1024*2; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); } @@ -293,7 +298,8 @@ static void addfb25_tests(int fd) struct local_drm_mode_fb_cmd2 f = {}; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); memset(&f, 0, sizeof(f)); @@ -364,9 +370,11 @@ static void addfb25_ytile(int fd, int gen) int shouldret; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1023*4); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); shouldret = gen >= 9 ? 0 : -1; -- cgit v1.2.3