Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 634 Lines • ▼ Show 20 Line(s) | 634 | } else { | |||
---|---|---|---|---|---|
635 | dpmsFinishOff(); | 635 | dpmsFinishOff(); | ||
636 | } | 636 | } | ||
637 | m_dpmsMode = m_dpmsModePending; | 637 | m_dpmsMode = m_dpmsModePending; | ||
638 | return true; | 638 | return true; | ||
639 | } | 639 | } | ||
640 | 640 | | |||
641 | // TODO: Rotation is currently broken in the DRM backend for 90° and 270°. Disable all rotation for | 641 | // TODO: Rotation is currently broken in the DRM backend for 90° and 270°. Disable all rotation for | ||
642 | // now to not break user setups until it is possible again. | 642 | // now to not break user setups until it is possible again. | ||
643 | #if 0 | 643 | #if 1 | ||
644 | void DrmOutput::transform(KWayland::Server::OutputDeviceInterface::Transform transform) | 644 | void DrmOutput::transform(KWayland::Server::OutputDeviceInterface::Transform transform) | ||
645 | { | 645 | { | ||
646 | waylandOutputDevice()->setTransform(transform); | | |||
647 | using KWayland::Server::OutputDeviceInterface; | 646 | using KWayland::Server::OutputDeviceInterface; | ||
648 | using KWayland::Server::OutputInterface; | | |||
649 | auto wlOutput = waylandOutput(); | | |||
650 | 647 | | |||
651 | switch (transform) { | 648 | switch (transform) { | ||
652 | case OutputDeviceInterface::Transform::Normal: | 649 | case OutputDeviceInterface::Transform::Normal: | ||
653 | if (m_primaryPlane) { | 650 | if (m_primaryPlane) { | ||
654 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate0); | 651 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate0); | ||
655 | } | 652 | } | ||
656 | if (wlOutput) { | | |||
657 | wlOutput->setTransform(OutputInterface::Transform::Normal); | | |||
658 | } | | |||
659 | setOrientation(Qt::PrimaryOrientation); | | |||
660 | break; | 653 | break; | ||
661 | case OutputDeviceInterface::Transform::Rotated90: | 654 | case OutputDeviceInterface::Transform::Rotated90: | ||
662 | if (m_primaryPlane) { | 655 | if (m_primaryPlane) { | ||
663 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate90); | 656 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate90); | ||
664 | } | 657 | } | ||
665 | if (wlOutput) { | | |||
666 | wlOutput->setTransform(OutputInterface::Transform::Rotated90); | | |||
667 | } | | |||
668 | setOrientation(Qt::PortraitOrientation); | | |||
669 | break; | 658 | break; | ||
670 | case OutputDeviceInterface::Transform::Rotated180: | 659 | case OutputDeviceInterface::Transform::Rotated180: | ||
671 | if (m_primaryPlane) { | 660 | if (m_primaryPlane) { | ||
672 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate180); | 661 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate180); | ||
673 | } | 662 | } | ||
674 | if (wlOutput) { | | |||
675 | wlOutput->setTransform(OutputInterface::Transform::Rotated180); | | |||
676 | } | | |||
677 | setOrientation(Qt::InvertedLandscapeOrientation); | | |||
678 | break; | 663 | break; | ||
679 | case OutputDeviceInterface::Transform::Rotated270: | 664 | case OutputDeviceInterface::Transform::Rotated270: | ||
680 | if (m_primaryPlane) { | 665 | if (m_primaryPlane) { | ||
681 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate270); | 666 | m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate270); | ||
682 | } | 667 | } | ||
683 | if (wlOutput) { | | |||
684 | wlOutput->setTransform(OutputInterface::Transform::Rotated270); | | |||
685 | } | | |||
686 | setOrientation(Qt::InvertedPortraitOrientation); | | |||
687 | break; | 668 | break; | ||
688 | case OutputDeviceInterface::Transform::Flipped: | 669 | case OutputDeviceInterface::Transform::Flipped: | ||
689 | // TODO: what is this exactly? | 670 | // TODO: what is this exactly? | ||
690 | if (wlOutput) { | | |||
691 | wlOutput->setTransform(OutputInterface::Transform::Flipped); | | |||
692 | } | | |||
693 | break; | 671 | break; | ||
694 | case OutputDeviceInterface::Transform::Flipped90: | 672 | case OutputDeviceInterface::Transform::Flipped90: | ||
695 | // TODO: what is this exactly? | 673 | // TODO: what is this exactly? | ||
696 | if (wlOutput) { | | |||
697 | wlOutput->setTransform(OutputInterface::Transform::Flipped90); | | |||
698 | } | | |||
699 | break; | 674 | break; | ||
700 | case OutputDeviceInterface::Transform::Flipped180: | 675 | case OutputDeviceInterface::Transform::Flipped180: | ||
701 | // TODO: what is this exactly? | 676 | // TODO: what is this exactly? | ||
702 | if (wlOutput) { | | |||
703 | wlOutput->setTransform(OutputInterface::Transform::Flipped180); | | |||
704 | } | | |||
705 | break; | 677 | break; | ||
706 | case OutputDeviceInterface::Transform::Flipped270: | 678 | case OutputDeviceInterface::Transform::Flipped270: | ||
707 | // TODO: what is this exactly? | 679 | // TODO: what is this exactly? | ||
708 | if (wlOutput) { | | |||
709 | wlOutput->setTransform(OutputInterface::Transform::Flipped270); | | |||
710 | } | | |||
711 | break; | 680 | break; | ||
712 | } | 681 | } | ||
713 | m_modesetRequested = true; | 682 | m_modesetRequested = true; | ||
714 | // the cursor might need to get rotated | 683 | // the cursor might need to get rotated | ||
715 | updateCursor(); | 684 | updateCursor(); | ||
716 | showCursor(); | 685 | showCursor(); | ||
717 | | ||||
718 | // TODO: are these calls not enough in updateMode already? | | |||
719 | setWaylandMode(); | | |||
720 | } | 686 | } | ||
721 | #else | 687 | #else | ||
722 | void DrmOutput::transform(KWayland::Server::OutputDeviceInterface::Transform transform) | 688 | void DrmOutput::transform(KWayland::Server::OutputDeviceInterface::Transform transform) | ||
723 | { | 689 | { | ||
724 | Q_UNUSED(transform) | 690 | Q_UNUSED(transform) | ||
725 | } | 691 | } | ||
726 | #endif | 692 | #endif | ||
727 | 693 | | |||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | 829 | #endif | |||
867 | 833 | | |||
868 | if (!doAtomicCommit(AtomicCommitMode::Test)) { | 834 | if (!doAtomicCommit(AtomicCommitMode::Test)) { | ||
869 | //TODO: When we use planes for layered rendering, fallback to renderer instead. Also for direct scanout? | 835 | //TODO: When we use planes for layered rendering, fallback to renderer instead. Also for direct scanout? | ||
870 | //TODO: Probably should undo setNext and reset the flip list | 836 | //TODO: Probably should undo setNext and reset the flip list | ||
871 | qCDebug(KWIN_DRM) << "Atomic test commit failed. Aborting present."; | 837 | qCDebug(KWIN_DRM) << "Atomic test commit failed. Aborting present."; | ||
872 | // go back to previous state | 838 | // go back to previous state | ||
873 | if (m_lastWorkingState.valid) { | 839 | if (m_lastWorkingState.valid) { | ||
874 | m_mode = m_lastWorkingState.mode; | 840 | m_mode = m_lastWorkingState.mode; | ||
875 | setOrientation(m_lastWorkingState.orientation); | 841 | | ||
842 | // TODO: Add API back to set orientation from backend | ||||
843 | // setOrientation(m_lastWorkingState.orientation); | ||||
844 | | ||||
876 | setGlobalPos(m_lastWorkingState.globalPos); | 845 | setGlobalPos(m_lastWorkingState.globalPos); | ||
877 | if (m_primaryPlane) { | 846 | if (m_primaryPlane) { | ||
878 | m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); | 847 | m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); | ||
879 | } | 848 | } | ||
880 | m_modesetRequested = true; | 849 | m_modesetRequested = true; | ||
881 | // the cursor might need to get rotated | 850 | // the cursor might need to get rotated | ||
882 | updateCursor(); | 851 | updateCursor(); | ||
883 | showCursor(); | 852 | showCursor(); | ||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |