From f5bd039633fa8360a10bd2aabb0111571f6275b0 Mon Sep 17 00:00:00 2001 From: Jocelyn Falempe Date: Thu, 18 Nov 2021 14:45:42 +0100 Subject: [PATCH] xf86/logind: fix call systemd_logind_vtenter after receiving drm device resume logind send the resume event for input devices and drm device, in any order. if we call vt_enter before logind resume the drm device, it leads to a driver error, because logind has not done the DRM_IOCTL_SET_MASTER on it. Keep the old workaround to make sure we call systemd_logind_vtenter at least once if there are no platform device Signed-off-by: Jocelyn Falempe Reviewed-by: Hans de Goede --- hw/xfree86/os-support/linux/systemd-logind.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c index 9f916aa7b..fce52ff93 100644 --- a/hw/xfree86/os-support/linux/systemd-logind.c +++ b/hw/xfree86/os-support/linux/systemd-logind.c @@ -394,14 +394,16 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) /* info->vt_active gets set by systemd_logind_vtenter() */ info->active = TRUE; - if (pdev) + if (pdev) { pdev->flags &= ~XF86_PDEV_PAUSED; - else + systemd_logind_vtenter(); + } else systemd_logind_set_input_fd_for_all_devs(major, minor, fd, info->vt_active); - /* Always call vtenter(), in case there are only legacy video devs */ - systemd_logind_vtenter(); + /* Always call vtenter(), only if there are only legacy video devs */ + if (!xf86_num_platform_devices) + systemd_logind_vtenter(); } return DBUS_HANDLER_RESULT_HANDLED; }