summaryrefslogtreecommitdiff
path: root/src/plugins/hardwareintegration
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2019-01-21 10:06:49 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2019-03-18 12:40:16 +0000
commitdf3a1761af2f20d59ae09a7adaa2f5b959047687 (patch)
tree142982ecf671f0e12c7d3213006340fb2e7a6cbf /src/plugins/hardwareintegration
parent617b0b063155523aa7affcdaa5aa3effac646124 (diff)
downloadqtwayland-df3a1761af2f20d59ae09a7adaa2f5b959047687.tar.gz
Add server buffer integration based on Vulkan
Using NVIDIA's Vulkan/GL interop function: glGetVkProcAddrNV [ChangeLog] Added Vulkan-based server buffer integration for NVIDIA EGLStreams. Change-Id: I500f80ff3b00a9585178976d8e400baa38e89ef6 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/plugins/hardwareintegration')
-rw-r--r--src/plugins/hardwareintegration/client/client.pro2
-rw-r--r--src/plugins/hardwareintegration/client/vulkan-server/main.cpp66
-rw-r--r--src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.json3
-rw-r--r--src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.pro15
-rw-r--r--src/plugins/hardwareintegration/compositor/compositor.pro2
-rw-r--r--src/plugins/hardwareintegration/compositor/vulkan-server/main.cpp62
-rw-r--r--src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.json3
-rw-r--r--src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro12
8 files changed, 165 insertions, 0 deletions
diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro
index 82e431ee..7b7e8a49 100644
--- a/src/plugins/hardwareintegration/client/client.pro
+++ b/src/plugins/hardwareintegration/client/client.pro
@@ -18,3 +18,5 @@ qtConfig(wayland-shm-emulation-server-buffer): \
SUBDIRS += shm-emulation-server
qtConfig(wayland-dmabuf-server-buffer): \
SUBDIRS += dmabuf-server
+qtConfig(wayland-vulkan-server-buffer): \
+ SUBDIRS += vulkan-server
diff --git a/src/plugins/hardwareintegration/client/vulkan-server/main.cpp b/src/plugins/hardwareintegration/client/vulkan-server/main.cpp
new file mode 100644
index 00000000..b8f64bf2
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/vulkan-server/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWaylandClient/private/qwaylandserverbufferintegrationplugin_p.h>
+#include "vulkanserverbufferintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+class VulkanServerBufferPlugin : public QWaylandServerBufferIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QWaylandServerBufferIntegrationFactoryInterface_iid FILE "vulkan-server.json")
+public:
+ QWaylandServerBufferIntegration *create(const QString&, const QStringList&) override;
+};
+
+QWaylandServerBufferIntegration *VulkanServerBufferPlugin::create(const QString& key, const QStringList& paramList)
+{
+ Q_UNUSED(paramList);
+ Q_UNUSED(key);
+ return new VulkanServerBufferIntegration();
+}
+
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.json b/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.json
new file mode 100644
index 00000000..baadd152
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "vulkan-server" ]
+}
diff --git a/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.pro b/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.pro
new file mode 100644
index 00000000..1be60f7c
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/vulkan-server/vulkan-server.pro
@@ -0,0 +1,15 @@
+# We have a bunch of C code with casts, so we can't have this option
+QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
+
+QT += waylandclient-private
+
+include(../../../../hardwareintegration/client/vulkan-server/vulkan-server.pri)
+
+OTHER_FILES += \
+ vulkan-server.json
+
+SOURCES += main.cpp
+
+PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_CLASS_NAME = VulkanServerBufferPlugin
+load(qt_plugin)
diff --git a/src/plugins/hardwareintegration/compositor/compositor.pro b/src/plugins/hardwareintegration/compositor/compositor.pro
index 59ea9141..32edf1f1 100644
--- a/src/plugins/hardwareintegration/compositor/compositor.pro
+++ b/src/plugins/hardwareintegration/compositor/compositor.pro
@@ -20,6 +20,8 @@ qtConfig(wayland-shm-emulation-server-buffer): \
SUBDIRS += shm-emulation-server
qtConfig(wayland-dmabuf-server-buffer): \
SUBDIRS += dmabuf-server
+qtConfig(wayland-vulkan-server-buffer): \
+ SUBDIRS += vulkan-server
qtConfig(wayland-egl): \
SUBDIRS += wayland-eglstream-controller
diff --git a/src/plugins/hardwareintegration/compositor/vulkan-server/main.cpp b/src/plugins/hardwareintegration/compositor/vulkan-server/main.cpp
new file mode 100644
index 00000000..d765dd38
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/vulkan-server/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWaylandCompositor/private/qwlserverbufferintegrationplugin_p.h>
+#include "vulkanserverbufferintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+class VulkanServerBufferIntegrationPlugin : public QtWayland::ServerBufferIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QtWaylandServerBufferIntegrationFactoryInterface_iid FILE "vulkan-server.json")
+public:
+ QtWayland::ServerBufferIntegration *create(const QString&, const QStringList&) override;
+};
+
+QtWayland::ServerBufferIntegration *VulkanServerBufferIntegrationPlugin::create(const QString& key, const QStringList& paramList)
+{
+ Q_UNUSED(paramList);
+ Q_UNUSED(key);
+ return new VulkanServerBufferIntegration();
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.json b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.json
new file mode 100644
index 00000000..baadd152
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "vulkan-server" ]
+}
diff --git a/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro
new file mode 100644
index 00000000..05365421
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/vulkan-server/vulkan-server.pro
@@ -0,0 +1,12 @@
+QT = waylandcompositor waylandcompositor-private core-private gui-private
+
+OTHER_FILES += vulkan-server.json
+
+SOURCES += \
+ main.cpp
+
+include($PWD/../../../../../hardwareintegration/compositor/vulkan-server/vulkan-server.pri)
+
+PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_CLASS_NAME = VulkanServerBufferIntegrationPlugin
+load(qt_plugin)