2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2019-10-26 03:40:01 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
|
2019-10-26 03:40:01 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2019-10-26 03:40:01 +00:00
|
|
|
#include "linux_dmabuf.h"
|
|
|
|
|
|
|
|
#include "wayland_server.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(const QVector<KWaylandServer::LinuxDmaBufV1Plane> &planes,
|
|
|
|
quint32 format,
|
|
|
|
const QSize &size,
|
|
|
|
quint32 flags)
|
|
|
|
: KWaylandServer::LinuxDmaBufV1ClientBuffer(size, format, flags, planes)
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
|
|
|
waylandServer()->addLinuxDmabufBuffer(this);
|
|
|
|
}
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
LinuxDmaBufV1ClientBuffer::~LinuxDmaBufV1ClientBuffer()
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
|
|
|
if (waylandServer()) {
|
|
|
|
waylandServer()->removeLinuxDmabufBuffer(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
LinuxDmaBufV1RendererInterface::LinuxDmaBufV1RendererInterface()
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
|
|
|
Q_ASSERT(waylandServer());
|
2021-07-20 19:37:03 +00:00
|
|
|
waylandServer()->linuxDmabuf()->setRendererInterface(this);
|
2019-10-26 03:40:01 +00:00
|
|
|
}
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
LinuxDmaBufV1RendererInterface::~LinuxDmaBufV1RendererInterface()
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
2021-07-20 19:37:03 +00:00
|
|
|
waylandServer()->linuxDmabuf()->setRendererInterface(nullptr);
|
2019-10-26 03:40:01 +00:00
|
|
|
}
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
KWaylandServer::LinuxDmaBufV1ClientBuffer *LinuxDmaBufV1RendererInterface::importBuffer(const QVector<KWaylandServer::LinuxDmaBufV1Plane> &planes,
|
|
|
|
quint32 format,
|
|
|
|
const QSize &size,
|
|
|
|
quint32 flags)
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
|
|
|
Q_UNUSED(planes)
|
|
|
|
Q_UNUSED(format)
|
|
|
|
Q_UNUSED(size)
|
|
|
|
Q_UNUSED(flags)
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-07-20 19:37:03 +00:00
|
|
|
void LinuxDmaBufV1RendererInterface::setSupportedFormatsAndModifiers(const QHash<uint32_t, QSet<uint64_t>> &set)
|
2019-10-26 03:40:01 +00:00
|
|
|
{
|
|
|
|
waylandServer()->linuxDmabuf()->setSupportedFormatsWithModifiers(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|