From a60f9300181496e5539f6914c9074e6d1aed0fe3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 29 Aug 2013 17:55:13 +0100 Subject: [PATCH] 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 --- tests/kms_flip.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 0b8a0a8..9f02442 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; -- 2.7.4