Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -1678,6 +1678,29 @@ Error AidlComposer::setLayerPictureProfileId(Display display, Layer layer, Pictu return error; } Error AidlComposer::getLuts(Display display, const std::vector<sp<GraphicBuffer>>& buffers, std::vector<aidl::android::hardware::graphics::composer3::Luts>* luts) { std::vector<aidl::android::hardware::graphics::composer3::Buffer> aidlBuffers; aidlBuffers.reserve(buffers.size()); for (auto& buffer : buffers) { if (buffer.get()) { aidl::android::hardware::graphics::composer3::Buffer aidlBuffer; aidlBuffer.handle.emplace(::android::dupToAidl(buffer->getNativeBuffer()->handle)); aidlBuffers.emplace_back(std::move(aidlBuffer)); } } const auto status = mAidlComposerClient->getLuts(translate<int64_t>(display), aidlBuffers, luts); if (!status.isOk()) { ALOGE("getLuts failed %s", status.getDescription().c_str()); return static_cast<Error>(status.getServiceSpecificError()); } return Error::NONE; } ftl::Optional<std::reference_wrapper<ComposerClientWriter>> AidlComposer::getWriter(Display display) REQUIRES_SHARED(mMutex) { return mWriters.get(display); Loading services/surfaceflinger/DisplayHardware/AidlComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,8 @@ public: Error getMaxLayerPictureProfiles(Display, int32_t* outMaxProfiles) override; Error setDisplayPictureProfileId(Display, PictureProfileId id) override; Error setLayerPictureProfileId(Display, Layer, PictureProfileId id) override; Error getLuts(Display, const std::vector<sp<GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) override; private: // Many public functions above simply write a command into the command Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ #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/Luts.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <optional> Loading Loading @@ -313,6 +314,8 @@ public: virtual Error getMaxLayerPictureProfiles(Display display, int32_t* outMaxProfiles) = 0; virtual Error setDisplayPictureProfileId(Display display, PictureProfileId id) = 0; virtual Error setLayerPictureProfileId(Display display, Layer layer, PictureProfileId id) = 0; virtual Error getLuts(Display display, const std::vector<sp<GraphicBuffer>>&, std::vector<V3_0::Luts>*) = 0; }; } // namespace Hwc2 Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,12 @@ Error Display::setPictureProfileHandle(const PictureProfileHandle& handle) { return static_cast<Error>(error); } Error Display::getLuts(const std::vector<sp<GraphicBuffer>>& buffers, std::vector<aidl::android::hardware::graphics::composer3::Luts>* outLuts) { const auto error = mComposer.getLuts(mId, buffers, outLuts); return static_cast<Error>(error); } // For use by Device void Display::setConnected(bool connected) { Loading services/surfaceflinger/DisplayHardware/HWC2.h +5 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,9 @@ public: [[nodiscard]] virtual hal::Error getMaxLayerPictureProfiles(int32_t* maxProfiles) = 0; [[nodiscard]] virtual hal::Error setPictureProfileHandle( const PictureProfileHandle& handle) = 0; [[nodiscard]] virtual hal::Error getLuts( const std::vector<android::sp<android::GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) = 0; }; namespace impl { Loading Loading @@ -288,6 +291,8 @@ public: hal::Error setIdleTimerEnabled(std::chrono::milliseconds timeout) override; hal::Error getMaxLayerPictureProfiles(int32_t* maxProfiles) override; hal::Error setPictureProfileHandle(const android::PictureProfileHandle& handle) override; hal::Error getLuts(const std::vector<android::sp<android::GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) override; // Other Display methods hal::HWDisplayId getId() const override { return mId; } Loading Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -1678,6 +1678,29 @@ Error AidlComposer::setLayerPictureProfileId(Display display, Layer layer, Pictu return error; } Error AidlComposer::getLuts(Display display, const std::vector<sp<GraphicBuffer>>& buffers, std::vector<aidl::android::hardware::graphics::composer3::Luts>* luts) { std::vector<aidl::android::hardware::graphics::composer3::Buffer> aidlBuffers; aidlBuffers.reserve(buffers.size()); for (auto& buffer : buffers) { if (buffer.get()) { aidl::android::hardware::graphics::composer3::Buffer aidlBuffer; aidlBuffer.handle.emplace(::android::dupToAidl(buffer->getNativeBuffer()->handle)); aidlBuffers.emplace_back(std::move(aidlBuffer)); } } const auto status = mAidlComposerClient->getLuts(translate<int64_t>(display), aidlBuffers, luts); if (!status.isOk()) { ALOGE("getLuts failed %s", status.getDescription().c_str()); return static_cast<Error>(status.getServiceSpecificError()); } return Error::NONE; } ftl::Optional<std::reference_wrapper<ComposerClientWriter>> AidlComposer::getWriter(Display display) REQUIRES_SHARED(mMutex) { return mWriters.get(display); Loading
services/surfaceflinger/DisplayHardware/AidlComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,8 @@ public: Error getMaxLayerPictureProfiles(Display, int32_t* outMaxProfiles) override; Error setDisplayPictureProfileId(Display, PictureProfileId id) override; Error setLayerPictureProfileId(Display, Layer, PictureProfileId id) override; Error getLuts(Display, const std::vector<sp<GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) override; private: // Many public functions above simply write a command into the command Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ #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/Luts.h> #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> #include <optional> Loading Loading @@ -313,6 +314,8 @@ public: virtual Error getMaxLayerPictureProfiles(Display display, int32_t* outMaxProfiles) = 0; virtual Error setDisplayPictureProfileId(Display display, PictureProfileId id) = 0; virtual Error setLayerPictureProfileId(Display display, Layer layer, PictureProfileId id) = 0; virtual Error getLuts(Display display, const std::vector<sp<GraphicBuffer>>&, std::vector<V3_0::Luts>*) = 0; }; } // namespace Hwc2 Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,12 @@ Error Display::setPictureProfileHandle(const PictureProfileHandle& handle) { return static_cast<Error>(error); } Error Display::getLuts(const std::vector<sp<GraphicBuffer>>& buffers, std::vector<aidl::android::hardware::graphics::composer3::Luts>* outLuts) { const auto error = mComposer.getLuts(mId, buffers, outLuts); return static_cast<Error>(error); } // For use by Device void Display::setConnected(bool connected) { Loading
services/surfaceflinger/DisplayHardware/HWC2.h +5 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,9 @@ public: [[nodiscard]] virtual hal::Error getMaxLayerPictureProfiles(int32_t* maxProfiles) = 0; [[nodiscard]] virtual hal::Error setPictureProfileHandle( const PictureProfileHandle& handle) = 0; [[nodiscard]] virtual hal::Error getLuts( const std::vector<android::sp<android::GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) = 0; }; namespace impl { Loading Loading @@ -288,6 +291,8 @@ public: hal::Error setIdleTimerEnabled(std::chrono::milliseconds timeout) override; hal::Error getMaxLayerPictureProfiles(int32_t* maxProfiles) override; hal::Error setPictureProfileHandle(const android::PictureProfileHandle& handle) override; hal::Error getLuts(const std::vector<android::sp<android::GraphicBuffer>>&, std::vector<aidl::android::hardware::graphics::composer3::Luts>*) override; // Other Display methods hal::HWDisplayId getId() const override { return mId; } Loading