Loading services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +3 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,9 @@ public: std::optional<aidl::android::hardware::graphics::common:: DisplayDecorationSupport>* support)); MOCK_METHOD2(setIdleTimerEnabled, status_t(PhysicalDisplayId, std::chrono::milliseconds)); MOCK_METHOD1(hasDisplayIdleTimerCapability, bool(PhysicalDisplayId displayId)); MOCK_METHOD(bool, hasDisplayIdleTimerCapability, (PhysicalDisplayId), (const, override)); MOCK_METHOD(Hwc2::AidlTransform, getPhysicalDisplayOrientation, (PhysicalDisplayId), (const, override)); }; } // namespace mock Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ bool AidlComposer::isSupported(OptionalFeature feature) const { case OptionalFeature::DisplayBrightnessCommand: case OptionalFeature::BootDisplayConfig: case OptionalFeature::KernelIdleTimer: case OptionalFeature::PhysicalDisplayOrientation: return true; } } Loading Loading @@ -1126,5 +1127,17 @@ Error AidlComposer::setIdleTimerEnabled(Display displayId, std::chrono::millisec return Error::NONE; } Error AidlComposer::getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) { const auto status = mAidlComposerClient->getDisplayPhysicalOrientation(translate<int64_t>(displayId), outDisplayOrientation); if (!status.isOk()) { ALOGE("getPhysicalDisplayOrientation failed %s", status.getDescription().c_str()); return static_cast<Error>(status.getServiceSpecificError()); } return Error::NONE; } } // namespace Hwc2 } // namespace android services/surfaceflinger/DisplayHardware/AidlComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ public: std::optional<DisplayDecorationSupport>* support) override; Error setIdleTimerEnabled(Display displayId, std::chrono::milliseconds timeout) override; Error getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) override; private: // Many public functions above simply write a command into the command // queue to batch the calls. validateDisplay and presentDisplay will call Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +5 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/IComposerCallback.h> #include <aidl/android/hardware/graphics/common/Transform.h> #include <optional> // TODO(b/129481165): remove the #pragma below and fix conversion issues Loading Loading @@ -80,6 +81,7 @@ using V2_4::VsyncPeriodNanos; using PerFrameMetadata = IComposerClient::PerFrameMetadata; using PerFrameMetadataKey = IComposerClient::PerFrameMetadataKey; using PerFrameMetadataBlob = IComposerClient::PerFrameMetadataBlob; using AidlTransform = ::aidl::android::hardware::graphics::common::Transform; class Composer { public: Loading @@ -94,6 +96,7 @@ public: DisplayBrightnessCommand, BootDisplayConfig, KernelIdleTimer, PhysicalDisplayOrientation, }; virtual bool isSupported(OptionalFeature) const = 0; Loading Loading @@ -277,6 +280,8 @@ public: std::optional<::aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) = 0; virtual Error setIdleTimerEnabled(Display displayId, std::chrono::milliseconds timeout) = 0; virtual Error getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) = 0; }; } // namespace Hwc2 Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,11 @@ bool Display::hasDisplayIdleTimerCapability() const { isCapabilitySupported; } Error Display::getPhysicalDisplayOrientation(Hwc2::AidlTransform* outTransform) const { auto error = mComposer.getPhysicalDisplayOrientation(mId, outTransform); return static_cast<Error>(error); } Error Display::getChangedCompositionTypes(std::unordered_map<HWC2::Layer*, Composition>* outTypes) { std::vector<Hwc2::Layer> layerIds; std::vector<Composition> types; Loading Loading
services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +3 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,9 @@ public: std::optional<aidl::android::hardware::graphics::common:: DisplayDecorationSupport>* support)); MOCK_METHOD2(setIdleTimerEnabled, status_t(PhysicalDisplayId, std::chrono::milliseconds)); MOCK_METHOD1(hasDisplayIdleTimerCapability, bool(PhysicalDisplayId displayId)); MOCK_METHOD(bool, hasDisplayIdleTimerCapability, (PhysicalDisplayId), (const, override)); MOCK_METHOD(Hwc2::AidlTransform, getPhysicalDisplayOrientation, (PhysicalDisplayId), (const, override)); }; } // namespace mock Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ bool AidlComposer::isSupported(OptionalFeature feature) const { case OptionalFeature::DisplayBrightnessCommand: case OptionalFeature::BootDisplayConfig: case OptionalFeature::KernelIdleTimer: case OptionalFeature::PhysicalDisplayOrientation: return true; } } Loading Loading @@ -1126,5 +1127,17 @@ Error AidlComposer::setIdleTimerEnabled(Display displayId, std::chrono::millisec return Error::NONE; } Error AidlComposer::getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) { const auto status = mAidlComposerClient->getDisplayPhysicalOrientation(translate<int64_t>(displayId), outDisplayOrientation); if (!status.isOk()) { ALOGE("getPhysicalDisplayOrientation failed %s", status.getDescription().c_str()); return static_cast<Error>(status.getServiceSpecificError()); } return Error::NONE; } } // namespace Hwc2 } // namespace android
services/surfaceflinger/DisplayHardware/AidlComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ public: std::optional<DisplayDecorationSupport>* support) override; Error setIdleTimerEnabled(Display displayId, std::chrono::milliseconds timeout) override; Error getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) override; private: // Many public functions above simply write a command into the command // queue to batch the calls. validateDisplay and presentDisplay will call Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +5 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/IComposerCallback.h> #include <aidl/android/hardware/graphics/common/Transform.h> #include <optional> // TODO(b/129481165): remove the #pragma below and fix conversion issues Loading Loading @@ -80,6 +81,7 @@ using V2_4::VsyncPeriodNanos; using PerFrameMetadata = IComposerClient::PerFrameMetadata; using PerFrameMetadataKey = IComposerClient::PerFrameMetadataKey; using PerFrameMetadataBlob = IComposerClient::PerFrameMetadataBlob; using AidlTransform = ::aidl::android::hardware::graphics::common::Transform; class Composer { public: Loading @@ -94,6 +96,7 @@ public: DisplayBrightnessCommand, BootDisplayConfig, KernelIdleTimer, PhysicalDisplayOrientation, }; virtual bool isSupported(OptionalFeature) const = 0; Loading Loading @@ -277,6 +280,8 @@ public: std::optional<::aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) = 0; virtual Error setIdleTimerEnabled(Display displayId, std::chrono::milliseconds timeout) = 0; virtual Error getPhysicalDisplayOrientation(Display displayId, AidlTransform* outDisplayOrientation) = 0; }; } // namespace Hwc2 Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,11 @@ bool Display::hasDisplayIdleTimerCapability() const { isCapabilitySupported; } Error Display::getPhysicalDisplayOrientation(Hwc2::AidlTransform* outTransform) const { auto error = mComposer.getPhysicalDisplayOrientation(mId, outTransform); return static_cast<Error>(error); } Error Display::getChangedCompositionTypes(std::unordered_map<HWC2::Layer*, Composition>* outTypes) { std::vector<Hwc2::Layer> layerIds; std::vector<Composition> types; Loading