Loading services/surfaceflinger/CompositionEngine/tests/MockHWC2.h +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include "DisplayHardware/HWC2.h" #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion -Wextra" Loading Loading @@ -77,6 +78,7 @@ public: Error(const std::string&, bool, const std::vector<uint8_t>&)); MOCK_METHOD1(setBrightness, Error(float)); MOCK_METHOD1(setBlockingRegion, Error(const android::Region&)); MOCK_METHOD(Error, setLuts, (std::vector<aidl::android::hardware::graphics::composer3::Lut>&)); }; } // namespace mock Loading services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ public: getOverlaySupport, (), (const, override)); MOCK_METHOD(status_t, setRefreshRateChangedCallbackDebugEnabled, (PhysicalDisplayId, bool)); MOCK_METHOD(status_t, notifyExpectedPresent, (PhysicalDisplayId, TimePoint, Fps)); MOCK_METHOD(status_t, getRequestedLuts, (PhysicalDisplayId, std::vector<aidl::android::hardware::graphics::composer3::DisplayLuts::LayerLut>*), (override)); }; } // namespace mock Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -1540,7 +1540,7 @@ Error AidlComposer::getClientTargetProperty( return error; } Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { Error AidlComposer::getRequestedLuts(Display display, std::vector<DisplayLuts::LayerLut>* outLuts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto reader = getReader(display)) { Loading @@ -1552,6 +1552,18 @@ Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { return error; } Error AidlComposer::setLayerLuts(Display display, Layer layer, std::vector<Lut>& luts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto writer = getWriter(display)) { writer->get().setLayerLuts(translate<int64_t>(display), translate<int64_t>(layer), luts); } 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 +6 −2 Original line number Diff line number Diff line Loading @@ -244,9 +244,13 @@ public: Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) override; Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) override; Error getDisplayLuts( Error getRequestedLuts( Display display, std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; std::vector<aidl::android::hardware::graphics::composer3::DisplayLuts::LayerLut>* outLuts) override; Error setLayerLuts( Display display, Layer layer, std::vector<aidl::android::hardware::graphics::composer3::Lut>& luts) override; private: // Many public functions above simply write a command into the command Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +4 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/DisplayConfiguration.h> #include <aidl/android/hardware/graphics/composer3/DisplayLuts.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> Loading Loading @@ -304,7 +305,9 @@ 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; virtual Error getRequestedLuts(Display display, std::vector<V3_0::DisplayLuts::LayerLut>* outLuts) = 0; virtual Error setLayerLuts(Display display, Layer layer, std::vector<V3_0::Lut>& luts) = 0; }; } // namespace Hwc2 Loading Loading
services/surfaceflinger/CompositionEngine/tests/MockHWC2.h +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include "DisplayHardware/HWC2.h" #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/Lut.h> // TODO(b/129481165): remove the #pragma below and fix conversion issues #pragma clang diagnostic pop // ignored "-Wconversion -Wextra" Loading Loading @@ -77,6 +78,7 @@ public: Error(const std::string&, bool, const std::vector<uint8_t>&)); MOCK_METHOD1(setBrightness, Error(float)); MOCK_METHOD1(setBlockingRegion, Error(const android::Region&)); MOCK_METHOD(Error, setLuts, (std::vector<aidl::android::hardware::graphics::composer3::Lut>&)); }; } // namespace mock Loading
services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +4 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ public: getOverlaySupport, (), (const, override)); MOCK_METHOD(status_t, setRefreshRateChangedCallbackDebugEnabled, (PhysicalDisplayId, bool)); MOCK_METHOD(status_t, notifyExpectedPresent, (PhysicalDisplayId, TimePoint, Fps)); MOCK_METHOD(status_t, getRequestedLuts, (PhysicalDisplayId, std::vector<aidl::android::hardware::graphics::composer3::DisplayLuts::LayerLut>*), (override)); }; } // namespace mock Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -1540,7 +1540,7 @@ Error AidlComposer::getClientTargetProperty( return error; } Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { Error AidlComposer::getRequestedLuts(Display display, std::vector<DisplayLuts::LayerLut>* outLuts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto reader = getReader(display)) { Loading @@ -1552,6 +1552,18 @@ Error AidlComposer::getDisplayLuts(Display display, std::vector<Lut>* outLuts) { return error; } Error AidlComposer::setLayerLuts(Display display, Layer layer, std::vector<Lut>& luts) { Error error = Error::NONE; mMutex.lock_shared(); if (auto writer = getWriter(display)) { writer->get().setLayerLuts(translate<int64_t>(display), translate<int64_t>(layer), luts); } 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 +6 −2 Original line number Diff line number Diff line Loading @@ -244,9 +244,13 @@ public: Error setRefreshRateChangedCallbackDebugEnabled(Display, bool) override; Error notifyExpectedPresent(Display, nsecs_t expectedPresentTime, int32_t frameIntervalNs) override; Error getDisplayLuts( Error getRequestedLuts( Display display, std::vector<aidl::android::hardware::graphics::composer3::Lut>* outLuts) override; std::vector<aidl::android::hardware::graphics::composer3::DisplayLuts::LayerLut>* outLuts) override; Error setLayerLuts( Display display, Layer layer, std::vector<aidl::android::hardware::graphics::composer3::Lut>& luts) override; private: // Many public functions above simply write a command into the command Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +4 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include <aidl/android/hardware/graphics/composer3/Composition.h> #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/DisplayConfiguration.h> #include <aidl/android/hardware/graphics/composer3/DisplayLuts.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> Loading Loading @@ -304,7 +305,9 @@ 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; virtual Error getRequestedLuts(Display display, std::vector<V3_0::DisplayLuts::LayerLut>* outLuts) = 0; virtual Error setLayerLuts(Display display, Layer layer, std::vector<V3_0::Lut>& luts) = 0; }; } // namespace Hwc2 Loading