[platforms/fbdev] Create output device

Summary: Create output device in framebuffer backend.

Test Plan: On VT started `dbus-run-session kwin_wayland --framebuffer --xwayland`.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23478
This commit is contained in:
Roman Gilg 2019-08-27 12:28:19 +02:00
parent cd6b69a4d2
commit d960be4b3f
2 changed files with 16 additions and 4 deletions

View file

@ -37,9 +37,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin
{
void FramebufferOutput::init(const QSize &size)
{
m_pixelSize = size;
KWayland::Server::OutputDeviceInterface::Mode mode;
mode.id = 0;
mode.size = size;
mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current;
mode.refreshRate = 60000; // TODO: get actual refresh rate of fb device?
AbstractWaylandOutput::initWaylandOutputDevice("model_TODO", "manufacturer_TODO",
"UUID_TODO", { mode });
}
FramebufferBackend::FramebufferBackend(QObject *parent)
: Platform(parent)
{
handleOutputs();
}
FramebufferBackend::~FramebufferBackend()
@ -137,8 +150,9 @@ bool FramebufferBackend::handleScreenInfo()
}
auto *output = new FramebufferOutput(this);
output->setPixelSize(QSize(varinfo.xres, varinfo.yres));
output->init(QSize(varinfo.xres, varinfo.yres));
output->setRawPhysicalSize(QSize(varinfo.width, varinfo.height));
output->setEnabled(true);
m_outputs << output;
m_id = QByteArray(fixinfo.id);

View file

@ -37,12 +37,10 @@ public:
FramebufferOutput(QObject *parent = nullptr) : AbstractWaylandOutput(parent) {}
~FramebufferOutput() override = default;
void init(const QSize &size);
QSize pixelSize() const override {
return m_pixelSize;
}
void setPixelSize(const QSize &set) {
m_pixelSize = set;
}
void setRawPhysicalSize(const QSize &set) {
AbstractWaylandOutput::setRawPhysicalSize(set);