summaryrefslogtreecommitdiff
path: root/tests/mode
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mode')
-rw-r--r--tests/mode/Makefile11
-rw-r--r--tests/mode/modetest.c10
-rwxr-xr-xtests/mode/test2
3 files changed, 17 insertions, 6 deletions
diff --git a/tests/mode/Makefile b/tests/mode/Makefile
index a3d3b49a..7a9c3c24 100644
--- a/tests/mode/Makefile
+++ b/tests/mode/Makefile
@@ -1,11 +1,14 @@
-all: modetest
+all: app
#CFLAGS = -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L \
# -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE \
-modetest: modetest.c
- @gcc $(CFLAGS) -o modetest -Wall -I../../libdrm -I../../shared-core -L../../libdrm/.libs -ldrm modetest.c
+app: modetest.c
+ @gcc $(CFLAGS) -o app -Wall -I../../libdrm -I../../shared-core -L../../libdrm/.libs -ldrm modetest.c
clean:
- @rm -f modetest
+ @rm -f app
+
+run: app
+ @sudo ./test
diff --git a/tests/mode/modetest.c b/tests/mode/modetest.c
index bd8372dc..c1f291b2 100644
--- a/tests/mode/modetest.c
+++ b/tests/mode/modetest.c
@@ -278,7 +278,15 @@ int testFrameBufferAdd(int fd, drmModeResPtr res)
printf("\tCreating BO\n");
/* TODO */
- ret = 1;
+ ret = drmBOCreate(fd, 800 * 600 * 4, 0, 0,
+ DRM_BO_FLAG_READ |
+ DRM_BO_FLAG_WRITE |
+ DRM_BO_FLAG_MEM_TT |
+ DRM_BO_FLAG_MEM_VRAM |
+ DRM_BO_FLAG_NO_EVICT,
+ DRM_BO_HINT_DONT_FENCE, &bo);
+
+ printf("\tgot %i\n", ret);
if (ret)
goto err;
diff --git a/tests/mode/test b/tests/mode/test
index fa155f4e..f98e3708 100755
--- a/tests/mode/test
+++ b/tests/mode/test
@@ -1 +1 @@
-LD_PRELOAD=../../libdrm/.libs/libdrm.so ./modetest
+LD_PRELOAD=../../libdrm/.libs/libdrm.so ./app