kwin/src/plugins/platforms/drm/drm_abstract_output.h
Xaver Hugl 1041ef8275 platforms/drm: introduce virtual outputs
When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.

CCBUG: 420160
CCBUG: 438839
2021-08-07 17:18:40 +02:00

55 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 "abstract_wayland_output.h"
namespace KWin
{
class DrmBackend;
class DrmGpu;
class DrmBuffer;
class GbmBuffer;
class DrmAbstractOutput : public AbstractWaylandOutput
{
Q_OBJECT
public:
virtual bool initCursor(const QSize &cursorSize);
virtual bool showCursor();
virtual bool hideCursor();
virtual bool updateCursor();
virtual bool moveCursor();
virtual bool present(const QSharedPointer<DrmBuffer> &buffer, QRegion damagedRegion) = 0;
virtual bool isDpmsEnabled() const = 0;
virtual GbmBuffer *currentBuffer() const = 0;
virtual QSize sourceSize() const = 0;
DrmGpu *gpu() const;
RenderLoop *renderLoop() const override;
protected:
friend class DrmBackend;
friend class DrmGpu;
DrmAbstractOutput(DrmGpu *gpu);
virtual void updateMode(int modeIndex) override {
Q_UNUSED(modeIndex)
}
virtual void updateMode(uint32_t width, uint32_t height, uint32_t refreshRate) = 0;
RenderLoop *m_renderLoop;
DrmGpu *m_gpu;
};
}