diff options
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp | 64 |
1 files changed, 18 insertions, 46 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp index b8f04cf978..c23ae7caa1 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qeglfsopenwfdintegration.h" @@ -154,23 +118,23 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow if (!ok) pipelineId = pipelineIds[0]; - WFDPipeline pipeline = wfdCreatePipeline(mDevice, pipelineId, nullptr); - if (WFD_INVALID_HANDLE == pipeline) + mPipeline = wfdCreatePipeline(mDevice, pipelineId, nullptr); + if (WFD_INVALID_HANDLE == mPipeline) qFatal("Failed to create wfd pipeline"); - wfdSetPipelineAttribi(mDevice, pipeline, WFD_PIPELINE_TRANSPARENCY_ENABLE, + wfdSetPipelineAttribi(mDevice, mPipeline, WFD_PIPELINE_TRANSPARENCY_ENABLE, (WFD_TRANSPARENCY_SOURCE_ALPHA|WFD_TRANSPARENCY_GLOBAL_ALPHA)); WFDErrorCode eError = wfdGetError(mDevice); if (WFD_ERROR_NONE != eError) qFatal("Failed to set WFD_PIPELINE_TRANSPARENCY_ENABLE"); - wfdSetPipelineAttribi(mDevice, pipeline, WFD_PIPELINE_GLOBAL_ALPHA, 255); + wfdSetPipelineAttribi(mDevice, mPipeline, WFD_PIPELINE_GLOBAL_ALPHA, 255); eError = wfdGetError(mDevice); if (WFD_ERROR_NONE != eError) qFatal("Failed to set WFD_PIPELINE_GLOBAL_ALPHA"); - wfdBindPipelineToPort(mDevice, mPort, pipeline); + wfdBindPipelineToPort(mDevice, mPort, mPipeline); eError = wfdGetError(mDevice); if (WFD_ERROR_NONE != eError) qFatal("Failed to bind port to pipeline"); @@ -190,7 +154,7 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow if (WFD_INVALID_HANDLE == wfdEglImages[i]) qFatal("Failed to create WDFEGLImages"); - source[i] = wfdCreateSourceFromImage(mDevice, pipeline, eglImageHandles[i], nullptr); + source[i] = wfdCreateSourceFromImage(mDevice, mPipeline, eglImageHandles[i], nullptr); if (WFD_INVALID_HANDLE == source[i]) qFatal("Failed to create source from EGLImage"); } @@ -208,14 +172,13 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow nativeWindow->dev = mDevice; nativeWindow->port = mPort; - nativeWindow->pipeline = pipeline; + nativeWindow->pipeline = mPipeline; nativeWindow->numBuffers = MAX_NUM_OF_WFD_BUFFERS; for (int i = 0; i < MAX_NUM_OF_WFD_BUFFERS; i++) { nativeWindow->buffers[i].image = wfdEglImages[i]; nativeWindow->buffers[i].source = source[i]; } - return (EGLNativeWindowType)nativeWindow; } @@ -231,7 +194,16 @@ QSurfaceFormat QEglFSOpenWFDIntegration::surfaceFormatFor(const QSurfaceFormat & void QEglFSOpenWFDIntegration::destroyNativeWindow(EGLNativeWindowType window) { + wfdDestroyPipeline(mDevice, mPipeline); free((void*)window); } +void QEglFSOpenWFDIntegration::platformDestroy() +{ + wfdDestroyPort(mDevice, mPort); + WFDErrorCode error = wfdDestroyDevice(mDevice); + if (error != WFD_ERROR_NONE) + qWarning() << "Failed to release wfd device! Error = " << error; +} + QT_END_NAMESPACE |