diff options
author | Andreas Cord-Landwehr <cordlandwehr@kde.org> | 2017-12-06 13:30:12 +0100 |
---|---|---|
committer | Andreas Cord-Landwehr <andreas.cord-landwehr@claas.com> | 2018-12-13 17:09:13 +0000 |
commit | 3f05293648fd9b135bbe675d1b2ec873bae299ce (patch) | |
tree | 795467ed58afb8267948c40cba45e59b2907a184 /config.tests | |
parent | 95dc3fd02ea3d1bea74e92b6d21c54758c461cd5 (diff) | |
download | qtwayland-3f05293648fd9b135bbe675d1b2ec873bae299ce.tar.gz |
Compositor: Implement linux-dmabuf-unstable-v1
[ChangeLog][Compositor] Added support for linux-dmabuf-unstable-v1.
Implement client side DMABUF buffer sharing support by supporting the
linux-dmabuf-unstable-v1 (version 3) protocol. For enabling DMABUF,
set the following environment variables for the compositor:
QT_QPA_PLATFORM=eglfs
QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=linux-dmabuf-unstable-v1
The current implementation supports the following DRM buffer formats:
- RGB and RGBA
- YUYV
This implementation requires Mesa with the following patch applied.
Otherwise, textures are not updated. The patch is contained in Mesa 18.1.5.
See https://patchwork.freedesktop.org/patch/238080/
Fixes: QTBUG-66288
Fixes: QTBUG-67845
Change-Id: Id4d90337dbe0be956b0f964426ebed3f281c6c30
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'config.tests')
-rw-r--r-- | config.tests/dmabuf_client_buffer/dmabuf_client_buffer.pro | 1 | ||||
-rw-r--r-- | config.tests/dmabuf_client_buffer/main.cpp | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/config.tests/dmabuf_client_buffer/dmabuf_client_buffer.pro b/config.tests/dmabuf_client_buffer/dmabuf_client_buffer.pro new file mode 100644 index 00000000..28dcadcb --- /dev/null +++ b/config.tests/dmabuf_client_buffer/dmabuf_client_buffer.pro @@ -0,0 +1 @@ +SOURCES += main.cpp diff --git a/config.tests/dmabuf_client_buffer/main.cpp b/config.tests/dmabuf_client_buffer/main.cpp new file mode 100644 index 00000000..71447dc8 --- /dev/null +++ b/config.tests/dmabuf_client_buffer/main.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Compositor. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <EGL/egl.h> +#include <EGL/eglext.h> + +//If libdrm is available, the following files should exist +#include "drm_mode.h" +#include "drm_fourcc.h" + +int main() +{ +// test if DMA BUF is supported +#ifndef EGL_LINUX_DMA_BUF_EXT +#error DMA BUF Extension not available +#endif + +// test if DMA BUF import modifier extension is supported +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#error DMA BUF Import modifier extension not available +#endif + + return 0; +} |