summaryrefslogtreecommitdiff
path: root/tests/kms_addfb_basic.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2016-02-24 10:38:25 +0100
committerDaniel Stone <daniels@collabora.com>2016-04-14 13:54:24 +0100
commitdecbf5a3b11878b93caaddda7c738b866939c1e2 (patch)
tree96908578a4e4f098d59aaab6821a8db77e8afd1e /tests/kms_addfb_basic.c
parent8a1a38661f5693409ad92b7ce60189dc52fe4ff6 (diff)
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 <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/kms_addfb_basic.c')
-rw-r--r--tests/kms_addfb_basic.c24
1 files changed, 16 insertions, 8 deletions
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;