Commit a60f9300 authored by Chris Wilson's avatar Chris Wilson 🤔

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's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 93550043
......@@ -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;
......
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