summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Falempe <jfalempe@redhat.com>2022-10-21 09:06:56 +0200
committerJocelyn Falempe <jfalempe@redhat.com>2023-01-09 13:38:25 +0000
commit6969782b69ffa77d21c64b57e95941d399cc2ad1 (patch)
tree59b6b4a3908a8284e8f7e231fd2ddbfbe2f2e9ae
parent412777664a20dd3561b936c02c96571a756fe9b2 (diff)
downloadxserver-6969782b69ffa77d21c64b57e95941d399cc2ad1.tar.gz
x86/logind fix suspend/resume when there are no input devices
Make sure info->active and info->vt_active are false after dropping drm master. Normally, this is done when pausing the first input device, so it breaks when there are no input device at all. Fixes: da9d012a9 ("xf86/logind: Fix drm_drop_master before vt_reldisp") Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1387 Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
-rw-r--r--hw/xfree86/os-support/linux/systemd-logind.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
index dbb00cd85..d97e92ff8 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -310,15 +310,19 @@ cleanup:
*/
void systemd_logind_drop_master(void)
{
+ struct systemd_logind_info *info = &logind_info;
int i;
+ /* Our VT_PROCESS usage guarantees we've already given up the vt */
+ info->active = info->vt_active = FALSE;
for (i = 0; i < xf86_num_platform_devices; i++) {
if (xf86_platform_devices[i].flags & XF86_PDEV_SERVER_FD) {
dbus_int32_t major, minor;
- struct systemd_logind_info *info = &logind_info;
xf86_platform_devices[i].flags |= XF86_PDEV_PAUSED;
major = xf86_platform_odev_attributes(i)->major;
minor = xf86_platform_odev_attributes(i)->minor;
+ LogMessage(X_INFO, "systemd-logind: drop master for %u:%u\n",
+ major, minor);
systemd_logind_ack_pause(info, minor, major);
}
}