Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | #include <xf86drm.h> | 46 | #include <xf86drm.h> | ||
47 | #include <xf86drmMode.h> | 47 | #include <xf86drmMode.h> | ||
48 | #include <libdrm/drm_mode.h> | 48 | #include <libdrm/drm_mode.h> | ||
49 | 49 | | |||
50 | namespace KWin | 50 | namespace KWin | ||
51 | { | 51 | { | ||
52 | 52 | | |||
53 | DrmOutput::DrmOutput(DrmBackend *backend) | 53 | DrmOutput::DrmOutput(DrmBackend *backend) | ||
54 | : AbstractOutput(backend) | 54 | : AbstractWaylandOutput(backend) | ||
55 | , m_backend(backend) | 55 | , m_backend(backend) | ||
56 | { | 56 | { | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | DrmOutput::~DrmOutput() | 59 | DrmOutput::~DrmOutput() | ||
60 | { | 60 | { | ||
61 | Q_ASSERT(!m_pageFlipPending); | 61 | Q_ASSERT(!m_pageFlipPending); | ||
62 | if (!m_deleted) { | 62 | if (!m_deleted) { | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 163 | { | |||
175 | p.drawImage(QPoint(0, 0), cursorImage); | 175 | p.drawImage(QPoint(0, 0), cursorImage); | ||
176 | p.end(); | 176 | p.end(); | ||
177 | } | 177 | } | ||
178 | 178 | | |||
179 | void DrmOutput::moveCursor(const QPoint &globalPos) | 179 | void DrmOutput::moveCursor(const QPoint &globalPos) | ||
180 | { | 180 | { | ||
181 | const QMatrix4x4 hotspotMatrix = matrixDisplay(m_backend->softwareCursor().size()); | 181 | const QMatrix4x4 hotspotMatrix = matrixDisplay(m_backend->softwareCursor().size()); | ||
182 | 182 | | |||
183 | QPoint p = globalPos-AbstractOutput::globalPos(); | 183 | QPoint p = globalPos - AbstractWaylandOutput::globalPos(); | ||
184 | switch (orientation()) { | 184 | switch (orientation()) { | ||
185 | case Qt::PrimaryOrientation: | 185 | case Qt::PrimaryOrientation: | ||
186 | case Qt::LandscapeOrientation: | 186 | case Qt::LandscapeOrientation: | ||
187 | break; | 187 | break; | ||
188 | case Qt::PortraitOrientation: | 188 | case Qt::PortraitOrientation: | ||
189 | p = QPoint(p.y(), pixelSize().height() - p.x()); | 189 | p = QPoint(p.y(), pixelSize().height() - p.x()); | ||
190 | break; | 190 | break; | ||
191 | case Qt::InvertedPortraitOrientation: | 191 | case Qt::InvertedPortraitOrientation: | ||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | 326 | for (int i = 0; i < connector->count_modes; ++i) { | |||
338 | KWayland::Server::OutputDeviceInterface::Mode mode; | 338 | KWayland::Server::OutputDeviceInterface::Mode mode; | ||
339 | mode.id = i; | 339 | mode.id = i; | ||
340 | mode.size = QSize(m->hdisplay, m->vdisplay); | 340 | mode.size = QSize(m->hdisplay, m->vdisplay); | ||
341 | mode.flags = deviceflags; | 341 | mode.flags = deviceflags; | ||
342 | mode.refreshRate = refreshRateForMode(m); | 342 | mode.refreshRate = refreshRateForMode(m); | ||
343 | modes << mode; | 343 | modes << mode; | ||
344 | } | 344 | } | ||
345 | 345 | | |||
346 | AbstractOutput::initWaylandOutputDevice(model, manufacturer, m_uuid, modes); | 346 | AbstractWaylandOutput::initWaylandOutputDevice(model, manufacturer, m_uuid, modes); | ||
347 | } | 347 | } | ||
348 | 348 | | |||
349 | bool DrmOutput::isCurrentMode(const drmModeModeInfo *mode) const | 349 | bool DrmOutput::isCurrentMode(const drmModeModeInfo *mode) const | ||
350 | { | 350 | { | ||
351 | return mode->clock == m_mode.clock | 351 | return mode->clock == m_mode.clock | ||
352 | && mode->hdisplay == m_mode.hdisplay | 352 | && mode->hdisplay == m_mode.hdisplay | ||
353 | && mode->hsync_start == m_mode.hsync_start | 353 | && mode->hsync_start == m_mode.hsync_start | ||
354 | && mode->hsync_end == m_mode.hsync_end | 354 | && mode->hsync_end == m_mode.hsync_end | ||
▲ Show 20 Lines • Show All 459 Lines • ▼ Show 20 Line(s) | |||||
814 | 814 | | |||
815 | QSize DrmOutput::pixelSize() const | 815 | QSize DrmOutput::pixelSize() const | ||
816 | { | 816 | { | ||
817 | return orientateSize(QSize(m_mode.hdisplay, m_mode.vdisplay)); | 817 | return orientateSize(QSize(m_mode.hdisplay, m_mode.vdisplay)); | ||
818 | } | 818 | } | ||
819 | 819 | | |||
820 | void DrmOutput::setWaylandMode() | 820 | void DrmOutput::setWaylandMode() | ||
821 | { | 821 | { | ||
822 | AbstractOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | 822 | AbstractWaylandOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | ||
823 | refreshRateForMode(&m_mode)); | 823 | refreshRateForMode(&m_mode)); | ||
824 | } | 824 | } | ||
825 | 825 | | |||
826 | void DrmOutput::pageFlipped() | 826 | void DrmOutput::pageFlipped() | ||
827 | { | 827 | { | ||
828 | m_pageFlipPending = false; | 828 | m_pageFlipPending = false; | ||
829 | if (m_deleted) { | 829 | if (m_deleted) { | ||
830 | deleteLater(); | 830 | deleteLater(); | ||
▲ Show 20 Lines • Show All 384 Lines • Show Last 20 Lines |