Multiple device node handling with logind
When using launcher-logind on a system with multiple drm device nodes (one of which is KMS) if a device is not specified, the session will be deactivated before it has a chance to be used.
As find_primary_gpu() is going though each device to test for KMS, we see the following dbus messages:
method call time=1560376397.130735 sender=:1.83 -> destination=org.freedesktop.login1 serial=8 path=/org/freedesktop/login1/session/c2; interface=org.freedesktop.login1.Session; member=TakeDevice uint32 226 uint32 0 method return time=1560376397.132196 sender=:1.3 -> destination=:1.83 serial=132 reply_serial=8 file descriptor inode: 1136 type: char boolean false method call time=1560376397.135030 sender=:1.83 -> destination=org.freedesktop.login1 serial=9 path=/org/freedesktop/login1/session/c2; interface=org.freedesktop.login1.Session; member=ReleaseDevice uint32 226 uint32 0 signal time=1560376397.136477 sender=:1.3 -> destination=:1.83 serial=133 path=/org/freedesktop/login1/session/c2; interface=org.freedesktop.login1.Session; member=PauseDevice uint32 226 uint32 0 string "gone" method return time=1560376397.137292 sender=:1.3 -> destination=:1.83 serial=134 reply_serial=9 method call time=1560376397.137510 sender=:1.83 -> destination=org.freedesktop.login1 serial=10 path=/org/freedesktop/login1/session/c2; interface=org.freedesktop.login1.Session; member=TakeDevice uint32 226 uint32 1
When the PauseDevice message is seen, device_paused() in launcher-logind.c sets the session inactive as it only checks the major number, and currently has no way to check that the minor corresponds to the drm backend's chosen device.
This results in black screens as no rendering gets done due weston thinking that the session is inactive. (a chvt to another vt and back again triggers the active state again and we see the output correctly).
Suggestion: Either add a callback in weston_backend that login interfaces (or anything else) can send device removal and attachments notifications with a dev_t for the device observed, or use a signal. The handler in drm backend should check the dev_t against it's chosen KMS device, and either return whether it cars (in case of direct callback) or set the session active/inactive itself.