Support restarting the OpenGL compositor on Wayland
ClosedPublic

Authored by graesslin on Jul 18 2016, 8:38 AM.

Details

Summary

KWin needs to support restarting the OpenGL compositor in case of a
graphics reset event.

On Wayland the tricky part is that the applications should not notice
this. Most importantly KWin cannot just destroy the EGLDisplay and create
a new one. But this is how a restart works: the complete compositor gets
torn down and recreated - including the EGLDisplay.

This change moves ownership of the EGLDisplay to the Platform.
The AbstractEglBackend subclasses query the Platform whether there is
already an EGLDisplay. Only if there is no EGLDisplay the EGLDisplay is
created and only if no EGLDisplay is registered with Wayland the bind
is performed.

Another change is regarding the destruction: the AbstractEglDisplay does
no longer unbind the Wayland display and does no longer destroy the
EGLDisplay. The EGLDisplay is destroyed by the Platform - so very late
on application exit. The Wayland display is unbound when the Compositor
terminates.

Test Plan

Limited testing with the added auto-test. This one needs to
be extended to fully verify that OpenGL applications continue to work.
But this requires build.kde.org to support OpenGL on Wayland.

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.
graesslin updated this revision to Diff 5260.Jul 18 2016, 8:38 AM
graesslin retitled this revision from to Support restarting the OpenGL compositor on Wayland.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptJul 18 2016, 8:38 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
This revision was automatically updated to reflect the committed changes.
graesslin reopened this revision.Jul 18 2016, 9:24 AM

erm, commit was in a branch, not on master.

bshah added a subscriber: bshah.Jul 20 2016, 11:04 AM
bshah added inline comments.
autotests/integration/scene_opengl_test.cpp
76–77

?

graesslin marked an inline comment as done.Jul 20 2016, 12:08 PM
graesslin added inline comments.
autotests/integration/scene_opengl_test.cpp
76–77

Removed the KWIN_COMPOSE=Q line.

bshah accepted this revision.Jul 20 2016, 12:09 PM
bshah added a reviewer: bshah.
This revision is now accepted and ready to land.Jul 20 2016, 12:09 PM
This revision was automatically updated to reflect the committed changes.
graesslin marked an inline comment as done.