Don't remove outputs during page flip
ClosedPublic

Authored by davidedmundson on Jul 18 2018, 3:05 PM.

Details

Summary

To do so leaves a dangling pointer on our pageFlipHandler

BUG: 396272

Test Plan

Wobbled a window whilst plugging a monitor in and out

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Jul 18 2018, 3:05 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 18 2018, 3:05 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jul 18 2018, 3:05 PM
graesslin accepted this revision.Jul 18 2018, 3:29 PM
This revision is now accepted and ready to land.Jul 18 2018, 3:29 PM
anthonyfieroni added a subscriber: anthonyfieroni.EditedJul 18 2018, 6:22 PM

It looks wrong on how it doing. When DrmOutput goes deleted m_fd is closed so fd in pageFlipHandler is invalid. Can we check fcntl(fd, F_GETFD) is valid or something ?

When DrmOutput goes deleted m_fd is closed

There's one FD for all outputs. The issue is if you remove one output.

There's one FD for all outputs. The issue is if you remove one output.

Yeah, you are right. One possible solution is to add isConnected and to check in pageFlipHandler

if (!output->isConnected()) {
    output->deleteLater();
    return;
}

So in updateOutputs you can call disconnect (or teardown) that will indicate it's not connected or deletes yourself if no pending page flip.

This revision was automatically updated to reflect the committed changes.