Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ using hardware::Return; using aidl::android::hardware::graphics::composer3::BnComposerCallback; using aidl::android::hardware::graphics::composer3::Capability; using aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness; using aidl::android::hardware::graphics::composer3::Lut; using aidl::android::hardware::graphics::composer3::PowerMode; using aidl::android::hardware::graphics::composer3::VirtualDisplay; Loading Loading @@ -1539,6 +1540,18 @@ Error AidlComposer::getClientTargetProperty( return error; } Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto reader = getReader(display)) { *outLuts = reader->get().takeDisplayLuts(translate<int64_t>(display)); } else { error = Error::BAD_DISPLAY; } mMutex.unlock_shared(); return error; } Error AidlComposer::setLayerBrightness(Display display, Layer layer, float brightness) { Error error = Error::NONE; mMutex.lock_shared(); Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,9 @@ public: Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) override; Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) override; Error getDisplayLuts( Display display, std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; private: // Many public functions above simply write a command into the command Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/DisplayConfiguration.h> #include <aidl/android/hardware/graphics/composer3/IComposerCallback.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <aidl/android/hardware/graphics/common/Transform.h> Loading Loading @@ -303,6 +304,7 @@ public: virtual Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) = 0; virtual Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) = 0; virtual Error getDisplayLuts(Display display, std::vector<V3_0::Lut>* outLuts) = 0; }; } // namespace Hwc2 Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ using aidl::android::hardware::graphics::composer3::Color; using aidl::android::hardware::graphics::composer3::Composition; using AidlCapability = aidl::android::hardware::graphics::composer3::Capability; using aidl::android::hardware::graphics::composer3::DisplayCapability; using aidl::android::hardware::graphics::composer3::Lut; using aidl::android::hardware::graphics::composer3::OverlayProperties; namespace android { Loading Loading @@ -607,6 +608,18 @@ Error Display::getClientTargetProperty( return static_cast<Error>(error); } Error Display::getDisplayLuts(std::vector<Lut>* outLuts) { std::vector<Lut> tmpLuts; const auto error = mComposer.getDisplayLuts(mId, &tmpLuts); for (Lut& lut : tmpLuts) { if (lut.pfd.get() >= 0) { outLuts->push_back( {lut.layer, ndk::ScopedFileDescriptor(lut.pfd.release()), lut.lutProperties}); } } return static_cast<Error>(error); } Error Display::getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) { Loading services/surfaceflinger/DisplayHardware/HWC2.h +5 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include <aidl/android/hardware/graphics/composer3/Color.h> #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.h> Loading Loading @@ -178,6 +179,8 @@ public: [[nodiscard]] virtual hal::Error getClientTargetProperty( aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness* outClientTargetProperty) = 0; [[nodiscard]] virtual hal::Error getDisplayLuts( std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) = 0; [[nodiscard]] virtual hal::Error getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) = 0; Loading Loading @@ -261,6 +264,8 @@ public: hal::Error getClientTargetProperty( aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness* outClientTargetProperty) override; hal::Error getDisplayLuts( std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; hal::Error getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) override; Loading Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ using hardware::Return; using aidl::android::hardware::graphics::composer3::BnComposerCallback; using aidl::android::hardware::graphics::composer3::Capability; using aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness; using aidl::android::hardware::graphics::composer3::Lut; using aidl::android::hardware::graphics::composer3::PowerMode; using aidl::android::hardware::graphics::composer3::VirtualDisplay; Loading Loading @@ -1539,6 +1540,18 @@ Error AidlComposer::getClientTargetProperty( return error; } Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto reader = getReader(display)) { *outLuts = reader->get().takeDisplayLuts(translate<int64_t>(display)); } else { error = Error::BAD_DISPLAY; } mMutex.unlock_shared(); return error; } Error AidlComposer::setLayerBrightness(Display display, Layer layer, float brightness) { Error error = Error::NONE; mMutex.lock_shared(); Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,9 @@ public: Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) override; Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) override; Error getDisplayLuts( Display display, std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; private: // Many public functions above simply write a command into the command Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/DisplayConfiguration.h> #include <aidl/android/hardware/graphics/composer3/IComposerCallback.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <aidl/android/hardware/graphics/common/Transform.h> Loading Loading @@ -303,6 +304,7 @@ public: virtual Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) = 0; virtual Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) = 0; virtual Error getDisplayLuts(Display display, std::vector<V3_0::Lut>* outLuts) = 0; }; } // namespace Hwc2 Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ using aidl::android::hardware::graphics::composer3::Color; using aidl::android::hardware::graphics::composer3::Composition; using AidlCapability = aidl::android::hardware::graphics::composer3::Capability; using aidl::android::hardware::graphics::composer3::DisplayCapability; using aidl::android::hardware::graphics::composer3::Lut; using aidl::android::hardware::graphics::composer3::OverlayProperties; namespace android { Loading Loading @@ -607,6 +608,18 @@ Error Display::getClientTargetProperty( return static_cast<Error>(error); } Error Display::getDisplayLuts(std::vector<Lut>* outLuts) { std::vector<Lut> tmpLuts; const auto error = mComposer.getDisplayLuts(mId, &tmpLuts); for (Lut& lut : tmpLuts) { if (lut.pfd.get() >= 0) { outLuts->push_back( {lut.layer, ndk::ScopedFileDescriptor(lut.pfd.release()), lut.lutProperties}); } } return static_cast<Error>(error); } Error Display::getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) { Loading
services/surfaceflinger/DisplayHardware/HWC2.h +5 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include <aidl/android/hardware/graphics/composer3/Color.h> #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.h> Loading Loading @@ -178,6 +179,8 @@ public: [[nodiscard]] virtual hal::Error getClientTargetProperty( aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness* outClientTargetProperty) = 0; [[nodiscard]] virtual hal::Error getDisplayLuts( std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) = 0; [[nodiscard]] virtual hal::Error getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) = 0; Loading Loading @@ -261,6 +264,8 @@ public: hal::Error getClientTargetProperty( aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness* outClientTargetProperty) override; hal::Error getDisplayLuts( std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; hal::Error getDisplayDecorationSupport( std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* support) override; Loading