summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-29 17:55:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-29 18:04:11 +0100
commita60f9300181496e5539f6914c9074e6d1aed0fe3 (patch)
treeb70858bcf8e083736215f78caa73dc15683d672b
parent93550043ca80caf7f754ae89825b1f618430b29d (diff)
kms_flip: Set everything to zero to disable a CRTC
Just setting fb=0 is not enough as the kernel thinks userspace is insane. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/kms_flip.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 0b8a0a88..9f02442b 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -718,9 +718,17 @@ static int set_mode(struct test_output *o, int fb, int x, int y)
int n;
for (n = 0; n < o->count; n++) {
- if (drmModeSetCrtc(drm_fd, o->_crtc[n], fb,
- x, y, &o->_connector[n], 1, &o->kmode[n]))
- return -1;
+ if (fb == 0) {
+ if (drmModeSetCrtc(drm_fd, o->_crtc[n],
+ 0, 0, 0,
+ 0, 0, 0))
+ return -1;
+ } else {
+ if (drmModeSetCrtc(drm_fd, o->_crtc[n],
+ fb, x, y,
+ &o->_connector[n], 1, &o->kmode[n]))
+ return -1;
+ }
}
return 0;