wl_eglstream_controller implementation for NVIDIA

This adds a new client buffer integration: wayland-eglstream-controller,
which contains the EGLStream logic from wayland-egl, and additionally
uses NVIDIA's wayland-eglstream-controller protocol to avoid the issue
where the stream is not ready at the time of first buffer attach.

This is not enabled by default. Can be used like this:
QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=wayland-eglstream-controller ./pure-qml

Fixes: QTBUG-71697
Change-Id: I73bb2a8fe9852afe1b5807cbb8c35dc4c7624dad
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
Paul Olav Tvete 2019-01-07 15:01:20 +01:00 committed by Jani Heikkinen
parent d812e2ea35
commit 3877eac8a4
3 changed files with 55 additions and 1 deletions

View File

@ -103,5 +103,20 @@ Copyright © 2010-2013 Intel Corporation"
"LicenseFile": "HPND_LICENSE.txt",
"Copyright": "Copyright © 2012, 2013 Intel Corporation
Copyright © 2015, 2016 Jan Arne Petersen"
}
},
{
"Id": "wayland-eglstream-controller",
"Name": "Wayland EGLStream Controller Protocol",
"QDocModule": "qtwaylandcompositor",
"QtUsage": "Used in the Qt Wayland Compositor",
"Files": "wayland-eglstream-controller.xml",
"Description": "Allows clients to request that the compositor creates its EGLStream.",
"Homepage": "https://github.com/NVIDIA/egl-wayland",
"LicenseId": "MIT",
"License": "MIT License",
"LicenseFile": "MIT_LICENSE.txt",
"Copyright": "Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved."
}
]

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="wl_eglstream_controller">
<copyright>
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="wl_eglstream_controller" version="1">
<request name="attach_eglstream_consumer">
<description summary="Create server stream and attach consumer">
Creates the corresponding server side EGLStream from the given wl_buffer
and attaches a consumer to it.
</description>
<arg name="wl_surface" type="object" interface="wl_surface"
summary="wl_surface corresponds to the client surface associated with
newly created eglstream"/>
<arg name="wl_resource" type="object" interface="wl_buffer"
summary="wl_resource corresponding to an EGLStream"/>
</request>
</interface>
</protocol>

View File

@ -339,6 +339,8 @@ void QWaylandIntegration::initializeClientBufferIntegration()
targetKey = QString::fromLocal8Bit(clientBufferIntegrationName);
} else {
targetKey = mDisplay->hardwareIntegration()->clientBufferIntegration();
if (targetKey == QLatin1String("wayland-eglstream-controller"))
targetKey = QLatin1String("wayland-egl");
}
if (targetKey.isEmpty()) {