summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/gem_basic.c (renamed from tests/mm_basic.c)16
-rw-r--r--tests/gem_mmap.c (renamed from tests/mm_mmap.c)22
-rw-r--r--tests/gem_readwrite.c (renamed from tests/mm_readwrite.c)12
4 files changed, 28 insertions, 28 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f997e26e..718cc436 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,9 +23,9 @@ TESTS = auth \
lock \
setversion \
updatedraw \
- mm_basic \
- mm_readwrite \
- mm_mmap
+ gem_basic \
+ gem_readwrite \
+ gem_mmap
EXTRA_PROGRAMS = $(TESTS)
CLEANFILES = $(EXTRA_PROGRAMS) $(EXTRA_LTLIBRARIES)
diff --git a/tests/mm_basic.c b/tests/gem_basic.c
index 94240ee1..6e1f3ddb 100644
--- a/tests/mm_basic.c
+++ b/tests/gem_basic.c
@@ -38,13 +38,13 @@
static void
test_bad_unref(int fd)
{
- struct drm_mm_unreference_args unref;
+ struct drm_gem_unreference unref;
int ret;
printf("Testing error return on bad unreference ioctl.\n");
unref.handle = 0x10101010;
- ret = ioctl(fd, DRM_IOCTL_MM_UNREFERENCE, &unref);
+ ret = ioctl(fd, DRM_IOCTL_GEM_UNREFERENCE, &unref);
assert(ret == -1 && errno == EINVAL);
}
@@ -52,32 +52,32 @@ test_bad_unref(int fd)
static void
test_alloc_unref(int fd)
{
- struct drm_mm_alloc_args alloc;
- struct drm_mm_unreference_args unref;
+ struct drm_gem_alloc alloc;
+ struct drm_gem_unreference unref;
int ret;
printf("Testing allocating and unreferencing an object.\n");
memset(&alloc, 0, sizeof(alloc));
alloc.size = 16 * 1024;
- ret = ioctl(fd, DRM_IOCTL_MM_ALLOC, &alloc);
+ ret = ioctl(fd, DRM_IOCTL_GEM_ALLOC, &alloc);
assert(ret == 0);
unref.handle = alloc.handle;
- ret = ioctl(fd, DRM_IOCTL_MM_UNREFERENCE, &unref);
+ ret = ioctl(fd, DRM_IOCTL_GEM_UNREFERENCE, &unref);
}
static void
test_alloc_close(int fd)
{
- struct drm_mm_alloc_args alloc;
+ struct drm_gem_alloc alloc;
int ret;
printf("Testing closing with an object allocated.\n");
memset(&alloc, 0, sizeof(alloc));
alloc.size = 16 * 1024;
- ret = ioctl(fd, DRM_IOCTL_MM_ALLOC, &alloc);
+ ret = ioctl(fd, DRM_IOCTL_GEM_ALLOC, &alloc);
assert(ret == 0);
close(fd);
diff --git a/tests/mm_mmap.c b/tests/gem_mmap.c
index e5c4538a..2cdc9343 100644
--- a/tests/mm_mmap.c
+++ b/tests/gem_mmap.c
@@ -39,7 +39,7 @@
int do_read(int fd, int handle, void *buf, int offset, int size)
{
- struct drm_mm_pread_args read;
+ struct drm_gem_pread read;
/* Ensure that we don't have any convenient data in buf in case
* we fail.
@@ -52,12 +52,12 @@ int do_read(int fd, int handle, void *buf, int offset, int size)
read.size = size;
read.offset = offset;
- return ioctl(fd, DRM_IOCTL_MM_PREAD, &read);
+ return ioctl(fd, DRM_IOCTL_GEM_PREAD, &read);
}
int do_write(int fd, int handle, void *buf, int offset, int size)
{
- struct drm_mm_pwrite_args write;
+ struct drm_gem_pwrite write;
memset(&write, 0, sizeof(write));
write.handle = handle;
@@ -65,15 +65,15 @@ int do_write(int fd, int handle, void *buf, int offset, int size)
write.size = size;
write.offset = offset;
- return ioctl(fd, DRM_IOCTL_MM_PWRITE, &write);
+ return ioctl(fd, DRM_IOCTL_GEM_PWRITE, &write);
}
int main(int argc, char **argv)
{
int fd;
- struct drm_mm_alloc_args alloc;
- struct drm_mm_mmap_args mmap;
- struct drm_mm_unreference_args unref;
+ struct drm_gem_alloc alloc;
+ struct drm_gem_mmap mmap;
+ struct drm_gem_unreference unref;
uint8_t expected[OBJECT_SIZE];
uint8_t buf[OBJECT_SIZE];
int ret;
@@ -86,12 +86,12 @@ int main(int argc, char **argv)
mmap.offset = 0;
mmap.size = 4096;
printf("Testing mmaping of bad object.\n");
- ret = ioctl(fd, DRM_IOCTL_MM_MMAP, &mmap);
+ ret = ioctl(fd, DRM_IOCTL_GEM_MMAP, &mmap);
assert(ret == -1 && errno == EINVAL);
memset(&alloc, 0, sizeof(alloc));
alloc.size = OBJECT_SIZE;
- ret = ioctl(fd, DRM_IOCTL_MM_ALLOC, &alloc);
+ ret = ioctl(fd, DRM_IOCTL_GEM_ALLOC, &alloc);
assert(ret == 0);
handle = alloc.handle;
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
mmap.handle = handle;
mmap.offset = 0;
mmap.size = OBJECT_SIZE;
- ret = ioctl(fd, DRM_IOCTL_MM_MMAP, &mmap);
+ ret = ioctl(fd, DRM_IOCTL_GEM_MMAP, &mmap);
assert(ret == 0);
printf("Testing contents of newly allocated object.\n");
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
printf("Testing that mapping stays after unreference\n");
unref.handle = handle;
- ret = ioctl(fd, DRM_IOCTL_MM_UNREFERENCE, &unref);
+ ret = ioctl(fd, DRM_IOCTL_GEM_UNREFERENCE, &unref);
assert(ret == 0);
assert(memcmp(buf, mmap.addr, sizeof(buf)) == 0);
diff --git a/tests/mm_readwrite.c b/tests/gem_readwrite.c
index a778231a..5065732d 100644
--- a/tests/mm_readwrite.c
+++ b/tests/gem_readwrite.c
@@ -39,7 +39,7 @@
int do_read(int fd, int handle, void *buf, int offset, int size)
{
- struct drm_mm_pread_args read;
+ struct drm_gem_pread read;
/* Ensure that we don't have any convenient data in buf in case
* we fail.
@@ -52,12 +52,12 @@ int do_read(int fd, int handle, void *buf, int offset, int size)
read.size = size;
read.offset = offset;
- return ioctl(fd, DRM_IOCTL_MM_PREAD, &read);
+ return ioctl(fd, DRM_IOCTL_GEM_PREAD, &read);
}
int do_write(int fd, int handle, void *buf, int offset, int size)
{
- struct drm_mm_pwrite_args write;
+ struct drm_gem_pwrite write;
memset(&write, 0, sizeof(write));
write.handle = handle;
@@ -65,13 +65,13 @@ int do_write(int fd, int handle, void *buf, int offset, int size)
write.size = size;
write.offset = offset;
- return ioctl(fd, DRM_IOCTL_MM_PWRITE, &write);
+ return ioctl(fd, DRM_IOCTL_GEM_PWRITE, &write);
}
int main(int argc, char **argv)
{
int fd;
- struct drm_mm_alloc_args alloc;
+ struct drm_gem_alloc alloc;
uint8_t expected[OBJECT_SIZE];
uint8_t buf[OBJECT_SIZE];
int ret;
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
memset(&alloc, 0, sizeof(alloc));
alloc.size = OBJECT_SIZE;
- ret = ioctl(fd, DRM_IOCTL_MM_ALLOC, &alloc);
+ ret = ioctl(fd, DRM_IOCTL_GEM_ALLOC, &alloc);
assert(ret == 0);
handle = alloc.handle;