Commit 6fb973cf authored by Chris Wilson's avatar Chris Wilson

igt/vgem_basic: Test DRM_IOCTL_SETVERSION

vgem is a nasty test case for various parts of the core as it is a
virtual device with drm_device.dev == NULL; this includes drm_setversion
for example.
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent ee4baf0c
......@@ -263,6 +263,7 @@ igt@prime_vgem@basic-read
igt@prime_vgem@basic-sync-default
igt@prime_vgem@basic-wait-default
igt@prime_vgem@basic-write
igt@vgem_basic@setversion
igt@vgem_basic@create
igt@vgem_basic@debugfs
igt@vgem_basic@dmabuf-export
......
......@@ -34,6 +34,34 @@
IGT_TEST_DESCRIPTION("Basic sanity check of Virtual GEM module (vGEM).");
static int __gem_setversion(int fd, drm_set_version_t *sv)
{
int err;
err = 0;
if (igt_ioctl(fd, DRM_IOCTL_SET_VERSION, sv))
err = -errno;
errno = 0;
return err;
}
static void test_setversion(int fd)
{
drm_set_version_t sv;
memset(&sv, 0, sizeof(sv));
sv.drm_di_major = 1; /* must be equal to DRM_IF_MAJOR */
sv.drm_di_minor = 4; /* must be less than DRM_IF_MINOR */
sv.drm_dd_major = -1; /* don't care */
sv.drm_dd_minor = -1; /* don't care */
igt_assert_eq(__gem_setversion(fd, &sv), 0);
igt_info("vgem DRM interface v%d.%d, device v%d.%d\n",
sv.drm_di_major, sv.drm_di_minor,
sv.drm_dd_major, sv.drm_dd_minor);
}
static void test_client(int fd)
{
close(drm_open_driver(DRIVER_VGEM));
......@@ -381,6 +409,9 @@ igt_main
fd = drm_open_driver(DRIVER_VGEM);
}
igt_subtest_f("setversion")
test_setversion(fd);
igt_subtest_f("second-client")
test_client(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment