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 <jfalempe@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit f5bd039633)
			
			
This commit is contained in:
		
							parent
							
								
									0ed7b1224e
								
							
						
					
					
						commit
						6834f977a5
					
				|  | @ -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; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue