kwin/src/backends/drm/drm_lease_output.h
Xaver Hugl e2a0863843 platforms/drm: more dynamic crtc assignment
Hardware constraints limit the number of crtcs and which connector + crtc
combinations can work together. The current code is searching for working
combinations when a hotplug happens but that's not enough, it also needs
to happen when the user enables or disables outputs and when modesets are
done, and the configuration change needs to be applied with a single atomic
commit.

This commit removes the hard dependency of DrmPipeline on crtcs by moving
the pending state of outputs from the drm objects to DrmPipeline itself,
which ensures that it's independent from the set of drm objects currently
used. It also changes requests from KScreen to be applied truly atomically.
2021-11-09 22:15:31 +01:00

51 lines
1.2 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <QVector>
#include <KWaylandServer/drmleasedevice_v1_interface.h>
namespace KWin
{
class DrmConnector;
class DrmPipeline;
/**
* a DrmLeaseOutput represents a non-desktop output (usually a VR headset)
* that is not used directly by the compositor but is instead leased out to
* applications (usually VR compositors) that drive the output themselves
*/
class DrmLeaseOutput : public KWaylandServer::DrmLeaseConnectorV1Interface
{
Q_OBJECT
public:
DrmLeaseOutput(DrmPipeline *pipeline, KWaylandServer::DrmLeaseDeviceV1Interface *leaseDevice);
~DrmLeaseOutput() override;
bool addLeaseObjects(QVector<uint32_t> &objectList);
void leased(KWaylandServer::DrmLeaseV1Interface *lease);
void leaseEnded();
KWaylandServer::DrmLeaseV1Interface *lease() const {
return m_lease;
}
DrmPipeline *pipeline() const {
return m_pipeline;
}
private:
DrmPipeline *m_pipeline;
KWaylandServer::DrmLeaseV1Interface *m_lease = nullptr;
};
}