mirror of
https://github.com/brl/mutter.git
synced 2025-01-11 12:12:25 +00:00
monitor-manager-xrandr: Disable CRTCs if there is no monitor
After last monitor gets unplugged from the system, hotplug detection may no longer work on Intel GFX. This is because we didn't trigger a modeset to disable CRTCs, and i915 requires it to make hotplug detection continue to work [1]. There's no guarantee that DPMS off in DDX also disables CRTCs, so explicitly disable CRTCs to solve the issue. [1] https://www.kernel.org/doc/html/latest/gpu/i915.html#hotplug https://gitlab.freedesktop.org/drm/intel/-/issues/2602 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1561>
This commit is contained in:
parent
e5b07138f0
commit
ed87937faf
@ -456,6 +456,9 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
meta_crtc_unset_config (crtc);
|
||||
}
|
||||
|
||||
if (!n_crtcs)
|
||||
goto out;
|
||||
|
||||
g_assert (width > 0 && height > 0);
|
||||
/* The 'physical size' of an X screen is meaningless if that screen
|
||||
* can consist of many monitors. So just pick a size that make the
|
||||
@ -555,6 +558,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
(GFunc) meta_output_unassign_crtc,
|
||||
NULL);
|
||||
|
||||
out:
|
||||
XUngrabServer (manager_xrandr->xdisplay);
|
||||
XFlush (manager_xrandr->xdisplay);
|
||||
}
|
||||
@ -601,6 +605,9 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana
|
||||
|
||||
if (!config)
|
||||
{
|
||||
if (!manager->in_init)
|
||||
apply_crtc_assignments (manager, TRUE, NULL, 0, NULL, 0);
|
||||
|
||||
meta_monitor_manager_xrandr_rebuild_derived (manager, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user