Implement wl_eglstream_controller Server Interface
Needs ReviewPublic

Authored by ekurzinger on Thu, Feb 7, 7:11 PM.

Details

Summary

This implements a wrapper class for the wl_eglstream_controller Wayland interface. It allows clients to inform the compositor when a new EGL Stream has been created with an Wayland surface attached as its producer. The compositor can then bind a GL texture as the stream's consumer allowing it access to the surface's buffer contents for presentation. The only client currently expected to make use of this interface is the NVIDIA EGL driver when running alongside a compositor supporting EGLStream-based buffer sharing.

Diff Detail

Repository
R127 KWayland
Lint
Lint Skipped
Unit
Unit Tests Skipped
ekurzinger created this revision.Thu, Feb 7, 7:11 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptThu, Feb 7, 7:11 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ekurzinger requested review of this revision.Thu, Feb 7, 7:11 PM
romangg added inline comments.Sat, Feb 9, 2:15 PM
src/server/CMakeLists.txt
350

alphabetical sorted

src/server/display.cpp
528

There should be always a non-null object returned. Instead check somewhere before the create call of EglStreamControllerInterface if the library can be loaded. Also this would put the logic and the QLibrary include in the class file and not in display.cpp, what I would prefer.

One could overwrite the Global::create method in the EglStreamControllerInterface child class. From there then call QLibrary::resolve and only if it succeeds the parent create method. Afterwards compositor needs to check Global::isValid.

The control flow would then be in the compositor:

auto *e = display->createEglStreamControllerInterface();
// other initial setup
e->create();
if (!e->isValid()) {
    // error handling
}

It's unfortunate that the create method is not virtual in Global. We can change this in KF6.

src/server/display.h
310

5.56

src/server/eglstream_controller_interface.cpp
54

Why is attribs unused in this implementation?

55

Use Global::Private::cast.

59

Rename controller and m_controller below to q for enhanced pimpl street cred.

src/server/eglstream_controller_interface.h
29

Cleanup includes

romangg requested changes to this revision.Sat, Feb 9, 2:16 PM

Impressive. Some small issues to resolve.

This revision now requires changes to proceed.Sat, Feb 9, 2:16 PM
ekurzinger updated this revision to Diff 51709.Thu, Feb 14, 7:28 PM

Thanks for taking a look, Roman. I've addressed your style suggestions and added support for passing stream attributes to the compositor. I had ignored these initially since the driver doesn't actually use this (fairly new) feature of the extension right now, but it probably is best to support it for future-proofness.

ekurzinger marked 7 inline comments as done.Thu, Feb 14, 7:29 PM