kwin/src/linux_dmabuf.cpp
Xaver Hugl f2b29e3555 backends/drm: deep color support
This commit makes 10 bits per color channel the default color depth, which
should reduce banding on outputs that support color formats with more than
8 bits per color channel. In order to support this the commit also removes
the dependency of the EglGbmBackend on a specific format and EglConfig and
instead makes those per-Output properties.
2021-12-25 18:32:58 +00:00

61 lines
1.9 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "linux_dmabuf.h"
#include "wayland_server.h"
namespace KWin
{
LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(const QVector<KWaylandServer::LinuxDmaBufV1Plane> &planes,
quint32 format,
const QSize &size,
quint32 flags)
: KWaylandServer::LinuxDmaBufV1ClientBuffer(size, format, flags, planes)
{
waylandServer()->addLinuxDmabufBuffer(this);
}
LinuxDmaBufV1ClientBuffer::~LinuxDmaBufV1ClientBuffer()
{
if (waylandServer()) {
waylandServer()->removeLinuxDmabufBuffer(this);
}
}
LinuxDmaBufV1RendererInterface::LinuxDmaBufV1RendererInterface()
{
Q_ASSERT(waylandServer());
waylandServer()->linuxDmabuf()->setRendererInterface(this);
}
LinuxDmaBufV1RendererInterface::~LinuxDmaBufV1RendererInterface()
{
waylandServer()->linuxDmabuf()->setRendererInterface(nullptr);
}
KWaylandServer::LinuxDmaBufV1ClientBuffer *LinuxDmaBufV1RendererInterface::importBuffer(const QVector<KWaylandServer::LinuxDmaBufV1Plane> &planes,
quint32 format,
const QSize &size,
quint32 flags)
{
Q_UNUSED(planes)
Q_UNUSED(format)
Q_UNUSED(size)
Q_UNUSED(flags)
return nullptr;
}
void LinuxDmaBufV1RendererInterface::setSupportedFormatsAndModifiers(const QVector<KWaylandServer::LinuxDmaBufV1Feedback::Tranche> &tranches)
{
waylandServer()->linuxDmabuf()->setSupportedFormatsWithModifiers(tranches);
}
}