kms: skip lease resume when drm device activation fails in resume_session()

When smithay's DrmDevice::activate() returns an error (e.g. because
drmSetMaster() failed during VT resume), resume_session() was only
logging the error and then proceeding to resume DRM leases on a device
that has no master. This leaves the compositor in a broken render state
where every atomic page flip returns EPERM.

Fix: continue to the next device on activate() failure. The device
surface stays inactive and lease resume is deferred. On the next
ActivateSession event (next VT switch to this TTY), resume_session()
will be called again and activate() will succeed once the seat manager
has granted DRM master.

Reproducer: hybrid GPU system (Intel iGPU render + NVIDIA display),
VT switch away from and back to COSMIC session. On return, drmSetMaster
races the seat notification; activate() fails; without this fix
the compositor floods journald with EPERM at 60fps.

Fixes: pop-os#2331, pop-os#2302
This commit is contained in:
Richard Chennault 2026-06-16 13:41:01 -07:00 committed by GitHub
parent aff506bb7b
commit dddf51b441
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -374,6 +374,7 @@ impl State {
for device in backend.drm_devices.values_mut() { for device in backend.drm_devices.values_mut() {
if let Err(err) = device.drm.lock().activate(true) { if let Err(err) = device.drm.lock().activate(true) {
error!(?err, "Failed to resume drm device"); error!(?err, "Failed to resume drm device");
continue;
} }
if let Some(lease_state) = device.inner.leasing_global.as_mut() { if let Some(lease_state) = device.inner.leasing_global.as_mut() {
lease_state.resume::<State>(); lease_state.resume::<State>();