Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 777 Lines • ▼ Show 20 Line(s) | 768 | { | |||
---|---|---|---|---|---|
778 | } | 778 | } | ||
779 | m_mode = connector->modes[modeIndex]; | 779 | m_mode = connector->modes[modeIndex]; | ||
780 | m_modesetRequested = true; | 780 | m_modesetRequested = true; | ||
781 | setWaylandMode(); | 781 | setWaylandMode(); | ||
782 | } | 782 | } | ||
783 | 783 | | |||
784 | QSize DrmOutput::pixelSize() const | 784 | QSize DrmOutput::pixelSize() const | ||
785 | { | 785 | { | ||
786 | return orientateSize(QSize(m_mode.hdisplay, m_mode.vdisplay)); | 786 | return QSize(m_mode.hdisplay, m_mode.vdisplay); | ||
787 | } | 787 | } | ||
788 | 788 | | |||
789 | void DrmOutput::setWaylandMode() | 789 | void DrmOutput::setWaylandMode() | ||
790 | { | 790 | { | ||
791 | AbstractOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | 791 | AbstractOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | ||
792 | refreshRateForMode(&m_mode)); | 792 | refreshRateForMode(&m_mode)); | ||
793 | } | 793 | } | ||
794 | 794 | | |||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 856 | { | |||
872 | m_nextPlanesFlipList.clear(); | 872 | m_nextPlanesFlipList.clear(); | ||
873 | dpmsOffHandler(); | 873 | dpmsOffHandler(); | ||
874 | 874 | | |||
875 | return true; | 875 | return true; | ||
876 | 876 | | |||
877 | } | 877 | } | ||
878 | 878 | | |||
879 | bool DrmOutput::presentAtomically(DrmBuffer *buffer) | 879 | bool DrmOutput::presentAtomically(DrmBuffer *buffer) | ||
880 | { | 880 | { | ||
881 | if (!LogindIntegration::self()->isActiveSession()) { | 881 | if (!LogindIntegration::self()->isActiveSession()) { | ||
882 | qCWarning(KWIN_DRM) << "Logind session not active."; | 882 | qCWarning(KWIN_DRM) << "Logind session not active."; | ||
883 | return false; | 883 | return false; | ||
884 | } | 884 | } | ||
885 | 885 | | |||
886 | if (m_pageFlipPending) { | 886 | if (m_pageFlipPending) { | ||
887 | qCWarning(KWIN_DRM) << "Page not yet flipped."; | 887 | qCWarning(KWIN_DRM) << "Page not yet flipped."; | ||
888 | return false; | 888 | return false; | ||
889 | } | 889 | } | ||
890 | 890 | | |||
891 | m_primaryPlane->setNext(buffer); | 891 | m_primaryPlane->setNext(buffer); | ||
892 | m_nextPlanesFlipList << m_primaryPlane; | 892 | m_nextPlanesFlipList << m_primaryPlane; | ||
893 | 893 | | |||
894 | if (!doAtomicCommit(AtomicCommitMode::Test)) { | 894 | if (!doAtomicCommit(AtomicCommitMode::Test)) { | ||
895 | //TODO: When we use planes for layered rendering, fallback to renderer instead. Also for direct scanout? | 895 | //TODO: When we use planes for layered rendering, fallback to renderer instead. Also for direct scanout? | ||
896 | //TODO: Probably should undo setNext and reset the flip list | 896 | //TODO: Probably should undo setNext and reset the flip list | ||
897 | qCDebug(KWIN_DRM) << "Atomic test commit failed. Aborting present."; | 897 | qCDebug(KWIN_DRM) << "Atomic test commit failed. Aborting present."; | ||
898 | // go back to previous state | 898 | // go back to previous state | ||
zzag: I know that you copied this code, but could we maybe re-format it accordingly to the Frameworks… | |||||
apol: I would rather not. | |||||
899 | if (m_lastWorkingState.valid) { | 899 | if (m_lastWorkingState.valid) { | ||
900 | m_mode = m_lastWorkingState.mode; | 900 | m_mode = m_lastWorkingState.mode; | ||
901 | setOrientation(m_lastWorkingState.orientation); | 901 | //setOrientation(m_lastWorkingState.orientation); | ||
902 | setGlobalPos(m_lastWorkingState.globalPos); | 902 | setGlobalPos(m_lastWorkingState.globalPos); | ||
903 | if (m_primaryPlane) { | 903 | if (m_primaryPlane) { | ||
904 | m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); | 904 | m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); | ||
905 | } | 905 | } | ||
906 | m_modesetRequested = true; | 906 | m_modesetRequested = true; | ||
907 | // the cursor might need to get rotated | 907 | // the cursor might need to get rotated | ||
908 | updateCursor(); | 908 | updateCursor(); | ||
909 | showCursor(); | 909 | showCursor(); | ||
▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines |
I know that you copied this code, but could we maybe re-format it accordingly to the Frameworks coding style?
Also, it would be great to use more const.