Commit c37c7ee0 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

sna: Switch off old outputs on topology changes

The kernel may keep the old connector id around so that userspace can
gracefully switch it off, which means that on detecting a topology
change (a new id for an old connector path), we must do a SetCRTC to
release the old resources.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106250

Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 985553df
......@@ -5254,6 +5254,20 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial)
if (strcmp(output->name, name) == 0) {
assert(output->scrn == scrn);
assert(output->funcs == &sna_output_funcs);
/*
* If the old output is still in use, tell
* the kernel to switch it off so we can
* move its resources over to the new id.
*/
if (output->crtc) {
struct drm_mode_crtc arg = {
.crtc_id = __sna_crtc_id(to_sna_crtc(output->crtc)),
};
drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg);
output->crtc = NULL;
}
sna_output_destroy(output);
goto reset;
}
......
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