From 79c2b1cb237798f162b039723bc552b30aeee604 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Tue, 17 Dec 2013 16:26:39 +0100 Subject: Add drm-egl server buffer integration Change-Id: Ib72cb43e78c068ebafa8c4e8ef1576746c7015e8 Reviewed-by: Andy Nichols --- src/plugins/hardwareintegration/client/client.pro | 4 ++ .../client/drm-egl-server/drm-egl-server.json | 3 + .../client/drm-egl-server/drm-egl-server.pro | 14 ++++ .../client/drm-egl-server/main.cpp | 74 ++++++++++++++++++++++ .../hardwareintegration/compositor/compositor.pro | 4 ++ .../compositor/drm-egl-server/drm-egl-server.json | 3 + .../compositor/drm-egl-server/drm-egl-server.pro | 12 ++++ .../compositor/drm-egl-server/main.cpp | 74 ++++++++++++++++++++++ 8 files changed, 188 insertions(+) create mode 100644 src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.json create mode 100644 src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.pro create mode 100644 src/plugins/hardwareintegration/client/drm-egl-server/main.cpp create mode 100644 src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.json create mode 100644 src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro create mode 100644 src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp (limited to 'src/plugins') diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro index 8c8f74bf6..0b1191919 100644 --- a/src/plugins/hardwareintegration/client/client.pro +++ b/src/plugins/hardwareintegration/client/client.pro @@ -13,3 +13,7 @@ config_xcomposite { !contains(QT_CONFIG, opengles2):config_glx: \ SUBDIRS += xcomposite-glx } + +# we should try and resolve all symbols +# and they should be type deffed if not present +SUBDIRS += drm-egl-server diff --git a/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.json b/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.json new file mode 100644 index 000000000..e2266ec60 --- /dev/null +++ b/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "drm-egl-server" ] +} diff --git a/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.pro b/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.pro new file mode 100644 index 000000000..d282afc81 --- /dev/null +++ b/src/plugins/hardwareintegration/client/drm-egl-server/drm-egl-server.pro @@ -0,0 +1,14 @@ +PLUGIN_TYPE = wayland-graphics-integration/client +load(qt_plugin) + +QT += waylandclient-private + +include(../../../../hardwareintegration/client/drm-egl-server/drm-egl-server.pri) + +LIBS += -lEGL + +OTHER_FILES += \ + drm-egl-server.json + +SOURCES += main.cpp + diff --git a/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp b/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp new file mode 100644 index 000000000..33f484287 --- /dev/null +++ b/src/plugins/hardwareintegration/client/drm-egl-server/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "drmeglserverbufferintegration.h" + +QT_BEGIN_NAMESPACE + +class DrmEglServerBufferPlugin : public QWaylandServerBufferIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.1" FILE "drm-egl-server.json") +public: + QStringList keys() const; + QWaylandServerBufferIntegration *create(const QString&, const QStringList&); +}; + +QStringList DrmEglServerBufferPlugin::keys() const +{ + QStringList list; + list << "drm-egl-server"; + return list; +} + +QWaylandServerBufferIntegration *DrmEglServerBufferPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "drm-egl-server") + return new DrmEglServerBufferIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/compositor.pro b/src/plugins/hardwareintegration/compositor/compositor.pro index d0c8c1151..ac59e20f7 100644 --- a/src/plugins/hardwareintegration/compositor/compositor.pro +++ b/src/plugins/hardwareintegration/compositor/compositor.pro @@ -12,3 +12,7 @@ config_xcomposite { !contains(QT_CONFIG, opengles2):config_glx: \ SUBDIRS += xcomposite-glx } + +# we should try and resolve all symbols +# and they should be type deffed if not present +SUBDIRS += drm-egl-server diff --git a/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.json b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.json new file mode 100644 index 000000000..e2266ec60 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "drm-egl-server" ] +} diff --git a/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro new file mode 100644 index 000000000..a4e53f61a --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pro @@ -0,0 +1,12 @@ +PLUGIN_TYPE = wayland-graphics-integration/server +load(qt_plugin) + +QT = compositor compositor-private core-private gui-private + +OTHER_FILES += drm-egl-server.json + +SOURCES += \ + main.cpp + +include($PWD/../../../../../hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri) + diff --git a/src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp b/src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp new file mode 100644 index 000000000..713791ccc --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "drmeglserverbufferintegration.h" + +QT_BEGIN_NAMESPACE + +class DrmEglServerBufferIntegrationPlugin : public QWaylandServerBufferIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandServerBufferIntegrationFactoryInterface.5.1" FILE "drm-egl-server.json") +public: + QStringList keys() const; + QWaylandServerBufferIntegration *create(const QString&, const QStringList&); +}; + +QStringList DrmEglServerBufferIntegrationPlugin::keys() const +{ + QStringList list; + list << "drm-egl-server"; + return list; +} + +QWaylandServerBufferIntegration *DrmEglServerBufferIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "drm-egl-server") + return new DrmEglServerBufferIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" -- cgit v1.2.3