Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/fbdev/fb_backend.cpp
Show All 38 Lines | |||||
39 | 39 | | |||
40 | void FramebufferOutput::init(const QSize &pixelSize, const QSize &physicalSize) | 40 | void FramebufferOutput::init(const QSize &pixelSize, const QSize &physicalSize) | ||
41 | { | 41 | { | ||
42 | KWayland::Server::OutputDeviceInterface::Mode mode; | 42 | KWayland::Server::OutputDeviceInterface::Mode mode; | ||
43 | mode.id = 0; | 43 | mode.id = 0; | ||
44 | mode.size = pixelSize; | 44 | mode.size = pixelSize; | ||
45 | mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; | 45 | mode.flags = KWayland::Server::OutputDeviceInterface::ModeFlag::Current; | ||
46 | mode.refreshRate = 60000; // TODO: get actual refresh rate of fb device? | 46 | mode.refreshRate = 60000; // TODO: get actual refresh rate of fb device? | ||
47 | AbstractWaylandOutput::initWaylandOutputDevice("model_TODO", "manufacturer_TODO", | 47 | initInterfaces("model_TODO", "manufacturer_TODO", "UUID_TODO", physicalSize, { mode }); | ||
48 | "UUID_TODO", physicalSize, { mode }); | | |||
49 | } | 48 | } | ||
50 | 49 | | |||
51 | FramebufferBackend::FramebufferBackend(QObject *parent) | 50 | FramebufferBackend::FramebufferBackend(QObject *parent) | ||
52 | : Platform(parent) | 51 | : Platform(parent) | ||
53 | { | 52 | { | ||
54 | } | 53 | } | ||
55 | 54 | | |||
56 | FramebufferBackend::~FramebufferBackend() | 55 | FramebufferBackend::~FramebufferBackend() | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 127 | { | |||
144 | 143 | | |||
145 | // Probe the device for new screen information. | 144 | // Probe the device for new screen information. | ||
146 | if (ioctl(m_fd, FBIOGET_VSCREENINFO, &varinfo) < 0) { | 145 | if (ioctl(m_fd, FBIOGET_VSCREENINFO, &varinfo) < 0) { | ||
147 | return false; | 146 | return false; | ||
148 | } | 147 | } | ||
149 | 148 | | |||
150 | auto *output = new FramebufferOutput(this); | 149 | auto *output = new FramebufferOutput(this); | ||
151 | output->init(QSize(varinfo.xres, varinfo.yres), QSize(varinfo.width, varinfo.height)); | 150 | output->init(QSize(varinfo.xres, varinfo.yres), QSize(varinfo.width, varinfo.height)); | ||
152 | output->setEnabled(true); | | |||
153 | m_outputs << output; | 151 | m_outputs << output; | ||
154 | 152 | | |||
155 | m_id = QByteArray(fixinfo.id); | 153 | m_id = QByteArray(fixinfo.id); | ||
156 | m_red = {varinfo.red.offset, varinfo.red.length}; | 154 | m_red = {varinfo.red.offset, varinfo.red.length}; | ||
157 | m_green = {varinfo.green.offset, varinfo.green.length}; | 155 | m_green = {varinfo.green.offset, varinfo.green.length}; | ||
158 | m_blue = {varinfo.blue.offset, varinfo.blue.length}; | 156 | m_blue = {varinfo.blue.offset, varinfo.blue.length}; | ||
159 | m_alpha = {varinfo.transp.offset, varinfo.transp.length}; | 157 | m_alpha = {varinfo.transp.offset, varinfo.transp.length}; | ||
160 | m_bitsPerPixel = varinfo.bits_per_pixel; | 158 | m_bitsPerPixel = varinfo.bits_per_pixel; | ||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |