[SurfaceFinger] Add getDisplayLuts interface.
Bug: 329472856
Test: builds
Flag: EXEMPT HAL interface change
Change-Id: I9a7fcba9f0281662c67645b47b2978f0ee9531c6
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp
index 8c0f81e..d5f65c6 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp
@@ -41,6 +41,7 @@
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 {
@@ -607,6 +608,18 @@
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) {