backends/drm: fix the commit thread
commit 1: handle atomic commits failing correctly. If the pending pageflip flag in DrmPipeline
is not reset, KWin will wait for a pageflip that never comes
commit 2: backends/drm: remove the race condition in DrmAtomicCommit
There is a chance that DrmGpu::pageFlipHandler gets executed on the main
thread while drmModeAtomicCommit hasn't returned yet on the commit thread.
When this situation happens, the destructor of DrmAtomicCommit doesn't set
the buffers to be current for the relevant drm planes, and once it gets
deleted, the framebuffers get destroyed and the output turns off.
To prevent that from happening, this commit moves the relevant code to a
method that gets explicitly called from the pageflip handler.
Edited by Xaver Hugl