summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2018-09-11 13:02:39 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2018-09-21 07:00:59 +0000
commit582af70640e411d8f423f1bc0528d5a5fce08e3a (patch)
treeffb4ff8f631902221c41c30a6b873b6dd78d76e4 /src/plugins
parent6c0b10e53ba1ecba8b4da9eefb9bd6b1693cc72f (diff)
Add server buffer integration using Linux dma-buf
Fixes: QTBUG-70494 Change-Id: Iaa4990fe9d39a1f9fb81f5e5f19039aa2e52dcac Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/hardwareintegration/client/client.pro2
-rw-r--r--src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.json3
-rw-r--r--src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.pro15
-rw-r--r--src/plugins/hardwareintegration/client/dmabuf-server/main.cpp64
-rw-r--r--src/plugins/hardwareintegration/client/wayland-egl/main.cpp4
-rw-r--r--src/plugins/hardwareintegration/compositor/compositor.pro2
-rw-r--r--src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.json3
-rw-r--r--src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro12
-rw-r--r--src/plugins/hardwareintegration/compositor/dmabuf-server/main.cpp62
9 files changed, 164 insertions, 3 deletions
diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro
index eab62f8d0..82e431ee8 100644
--- a/src/plugins/hardwareintegration/client/client.pro
+++ b/src/plugins/hardwareintegration/client/client.pro
@@ -16,3 +16,5 @@ qtConfig(wayland-libhybris-egl-server-buffer): \
SUBDIRS += libhybris-egl-server
qtConfig(wayland-shm-emulation-server-buffer): \
SUBDIRS += shm-emulation-server
+qtConfig(wayland-dmabuf-server-buffer): \
+ SUBDIRS += dmabuf-server
diff --git a/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.json b/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.json
new file mode 100644
index 000000000..22272a4ab
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "dmabuf-server" ]
+}
diff --git a/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.pro b/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-server.pro
new file mode 100644
index 000000000..5925c8b04
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/dmabuf-server/dmabuf-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/dmabuf-server/dmabuf-server.pri)
+
+OTHER_FILES += \
+ dmabuf-server.json
+
+SOURCES += main.cpp
+
+PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_CLASS_NAME = DmaBufServerBufferPlugin
+load(qt_plugin)
diff --git a/src/plugins/hardwareintegration/client/dmabuf-server/main.cpp b/src/plugins/hardwareintegration/client/dmabuf-server/main.cpp
new file mode 100644
index 000000000..d4955d458
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/dmabuf-server/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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 "dmabufserverbufferintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+class DmaBufServerBufferPlugin : public QWaylandServerBufferIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QWaylandServerBufferIntegrationFactoryInterface_iid FILE "dmabuf-server.json")
+public:
+ QWaylandServerBufferIntegration *create(const QString&, const QStringList&) override;
+};
+
+QWaylandServerBufferIntegration *DmaBufServerBufferPlugin::create(const QString&, const QStringList&)
+{
+ return new DmaBufServerBufferIntegration();
+}
+
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/hardwareintegration/client/wayland-egl/main.cpp b/src/plugins/hardwareintegration/client/wayland-egl/main.cpp
index 05053ff95..089063553 100644
--- a/src/plugins/hardwareintegration/client/wayland-egl/main.cpp
+++ b/src/plugins/hardwareintegration/client/wayland-egl/main.cpp
@@ -52,10 +52,8 @@ public:
QWaylandClientBufferIntegration *create(const QString&, const QStringList&) override;
};
-QWaylandClientBufferIntegration *QWaylandEglClientBufferPlugin::create(const QString& system, const QStringList& paramList)
+QWaylandClientBufferIntegration *QWaylandEglClientBufferPlugin::create(const QString&, const QStringList&)
{
- Q_UNUSED(paramList);
- Q_UNUSED(system);
return new QWaylandEglClientBufferIntegration();
}
diff --git a/src/plugins/hardwareintegration/compositor/compositor.pro b/src/plugins/hardwareintegration/compositor/compositor.pro
index 55bf1a7df..cd47b2676 100644
--- a/src/plugins/hardwareintegration/compositor/compositor.pro
+++ b/src/plugins/hardwareintegration/compositor/compositor.pro
@@ -16,5 +16,7 @@ qtConfig(wayland-libhybris-egl-server-buffer): \
SUBDIRS += libhybris-egl-server
qtConfig(wayland-shm-emulation-server-buffer): \
SUBDIRS += shm-emulation-server
+qtConfig(wayland-dmabuf-server-buffer): \
+ SUBDIRS += dmabuf-server
SUBDIRS += hardwarelayer
diff --git a/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.json b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.json
new file mode 100644
index 000000000..22272a4ab
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "dmabuf-server" ]
+}
diff --git a/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro
new file mode 100644
index 000000000..1601a384c
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pro
@@ -0,0 +1,12 @@
+QT = waylandcompositor waylandcompositor-private core-private gui-private
+
+OTHER_FILES += dmabuf-server.json
+
+SOURCES += \
+ main.cpp
+
+include($PWD/../../../../../hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri)
+
+PLUGIN_TYPE = wayland-graphics-integration-server
+PLUGIN_CLASS_NAME = DmaBufServerBufferIntegrationPlugin
+load(qt_plugin)
diff --git a/src/plugins/hardwareintegration/compositor/dmabuf-server/main.cpp b/src/plugins/hardwareintegration/compositor/dmabuf-server/main.cpp
new file mode 100644
index 000000000..0d82e0bb4
--- /dev/null
+++ b/src/plugins/hardwareintegration/compositor/dmabuf-server/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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 "dmabufserverbufferintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+class DmaBufServerBufferIntegrationPlugin : public QtWayland::ServerBufferIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QtWaylandServerBufferIntegrationFactoryInterface_iid FILE "dmabuf-server.json")
+public:
+ QtWayland::ServerBufferIntegration *create(const QString&, const QStringList&) override;
+};
+
+QtWayland::ServerBufferIntegration *DmaBufServerBufferIntegrationPlugin::create(const QString& system, const QStringList& paramList)
+{
+ Q_UNUSED(paramList);
+ Q_UNUSED(system);
+ return new DmaBufServerBufferIntegration();
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"