Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 1002 Lines • ▼ Show 20 Line(s) | 973 | { | |||
---|---|---|---|---|---|
1003 | ret &= m_conn->atomicPopulate(req); | 1003 | ret &= m_conn->atomicPopulate(req); | ||
1004 | ret &= m_crtc->atomicPopulate(req); | 1004 | ret &= m_crtc->atomicPopulate(req); | ||
1005 | 1005 | | |||
1006 | return ret; | 1006 | return ret; | ||
1007 | } | 1007 | } | ||
1008 | 1008 | | |||
1009 | bool DrmOutput::supportsTransformations() const | 1009 | bool DrmOutput::supportsTransformations() const | ||
1010 | { | 1010 | { | ||
1011 | /* | ||||
1012 | * Orientation sensor has issues! See valgrind output and user feedback. | ||||
1013 | * Needs to be redone before enabling again. | ||||
1014 | */ | ||||
1015 | return false; | ||||
1016 | #if 0 | ||||
1011 | if (!m_primaryPlane) { | 1017 | if (!m_primaryPlane) { | ||
1012 | return false; | 1018 | return false; | ||
1013 | } | 1019 | } | ||
1014 | const auto transformations = m_primaryPlane->supportedTransformations(); | 1020 | const auto transformations = m_primaryPlane->supportedTransformations(); | ||
1015 | return transformations.testFlag(DrmPlane::Transformation::Rotate90) | 1021 | return transformations.testFlag(DrmPlane::Transformation::Rotate90) | ||
1016 | || transformations.testFlag(DrmPlane::Transformation::Rotate180) | 1022 | || transformations.testFlag(DrmPlane::Transformation::Rotate180) | ||
1017 | || transformations.testFlag(DrmPlane::Transformation::Rotate270); | 1023 | || transformations.testFlag(DrmPlane::Transformation::Rotate270); | ||
1024 | #endif | ||||
1018 | } | 1025 | } | ||
1019 | 1026 | | |||
1020 | void DrmOutput::automaticRotation() | 1027 | void DrmOutput::automaticRotation() | ||
1021 | { | 1028 | { | ||
1022 | if (!m_primaryPlane) { | 1029 | if (!m_primaryPlane) { | ||
1023 | return; | 1030 | return; | ||
1024 | } | 1031 | } | ||
1025 | const auto supportedTransformations = m_primaryPlane->supportedTransformations(); | 1032 | const auto supportedTransformations = m_primaryPlane->supportedTransformations(); | ||
1026 | const auto requestedTransformation = screens()->orientationSensor()->orientation(); | 1033 | const auto requestedTransformation = screens()->orientationSensor()->orientation(); | ||
1027 | using KWayland::Server::OutputDeviceInterface; | 1034 | using KWayland::Server::OutputDeviceInterface; | ||
1028 | OutputDeviceInterface::Transform newTransformation = OutputDeviceInterface::Transform::Normal; | 1035 | OutputDeviceInterface::Transform newTransformation = OutputDeviceInterface::Transform::Normal; | ||
zzag: In general if you want to temporarily disable something, you have to use `#if 0 #endif` so git… | |||||
romangg: ok, good point. | |||||
1029 | switch (requestedTransformation) { | 1036 | switch (requestedTransformation) { | ||
1030 | case OrientationSensor::Orientation::TopUp: | 1037 | case OrientationSensor::Orientation::TopUp: | ||
1031 | newTransformation = OutputDeviceInterface::Transform::Normal; | 1038 | newTransformation = OutputDeviceInterface::Transform::Normal; | ||
1032 | break; | 1039 | break; | ||
1033 | case OrientationSensor::Orientation::TopDown: | 1040 | case OrientationSensor::Orientation::TopDown: | ||
1034 | if (!supportedTransformations.testFlag(DrmPlane::Transformation::Rotate180)) { | 1041 | if (!supportedTransformations.testFlag(DrmPlane::Transformation::Rotate180)) { | ||
1035 | return; | 1042 | return; | ||
1036 | } | 1043 | } | ||
Show All 35 Lines |
In general if you want to temporarily disable something, you have to use #if 0 #endif so git history is not altered.