diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-24 23:20:43 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-24 23:20:43 +0000 |
commit | 6b02acd7feba971dab75723be62e237dd3176aa2 (patch) | |
tree | c109f66cd9b95e30d9ee74a24d32b759b4739f52 | |
parent | 475778d84df3e4f99fe99b85a36199e43c761eb5 (diff) | |
parent | c7c7c27b7cd347f9440a6e0a522219b6e3d20be6 (diff) | |
download | gs201-android13-d1-s3-release.tar.gz |
Snap for 8637604 from c7c7c27b7cd347f9440a6e0a522219b6e3d20be6 to tm-d1-releaseandroid-13.0.0_r9android-13.0.0_r15android-13.0.0_r14android-13.0.0_r13android-13.0.0_r11android-13.0.0_r10android13-d1-s3-releaseandroid13-d1-s2-releaseandroid13-d1-s1-releaseandroid13-d1-release
Change-Id: I2c8e423cab78bf44e3f70f1dbbe42cce0d69698c
-rw-r--r-- | histogram/histogram.h | 38 | ||||
-rw-r--r-- | libhwc2.1/Android.mk | 1 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp | 40 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h | 11 |
4 files changed, 90 insertions, 0 deletions
diff --git a/histogram/histogram.h b/histogram/histogram.h new file mode 100644 index 0000000..ff981bf --- /dev/null +++ b/histogram/histogram.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HISTOGRAM_GS201_H_ +#define HISTOGRAM_GS201_H_ + +#include <../gs101/include/histogram/HistogramInfo.h> +#include <../gs101/include/histogram/histogram_control.h> +#include <aidl/com/google/hardware/pixel/display/HistogramPos.h> + +using HistogramPos = + ::aidl::com::google::hardware::pixel::display::HistogramPos; + +class IDLHistogram : public HistogramInfo { + public: + IDLHistogram() : HistogramInfo(HistogramType::HISTOGRAM_HIDL) {} + virtual ~IDLHistogram() {} + virtual void setHistogramPos(HistogramPos pos) { mHistogramPos = pos; } + HistogramPos getHistogramPos() { return mHistogramPos; } + + private: + HistogramPos mHistogramPos = HistogramPos::POST; +}; + +#endif // HISTOGRAM_GS201_H_ diff --git a/libhwc2.1/Android.mk b/libhwc2.1/Android.mk index e7a8592..68fe25b 100644 --- a/libhwc2.1/Android.mk +++ b/libhwc2.1/Android.mk @@ -26,4 +26,5 @@ LOCAL_SRC_FILES += \ LOCAL_CFLAGS += -DDISPLAY_COLOR_LIB=\"libdisplaycolor.so\" LOCAL_C_INCLUDES += \ + $(TOP)/hardware/google/graphics/gs201/histogram \ $(TOP)/hardware/google/graphics/gs101/include diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp index 1bfccc2..6c1284a 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp @@ -175,6 +175,46 @@ int32_t ExynosDisplayDrmInterfaceModule::setDisplayColorSetting( return setCgcLutDmaProperty(mDrmCrtc->cgc_lut_fd_property(), drmReq); } + +int32_t ExynosDisplayDrmInterfaceModule::setHistoPosProperty( + const DrmProperty &prop, + ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq) { + if (!prop.id()) return NO_ERROR; + + int32_t ret = 0; + + if ((ret = drmReq.atomicAddProperty( + mDrmCrtc->id(), prop, (uint64_t)mHistogramInfo->getHistogramPos(), + true)) < 0) { + HWC_LOGE(mExynosDisplay, "%s: Fail to set histogram position property", + __func__); + return ret; + } + + return NO_ERROR; +} + +int32_t ExynosDisplayDrmInterfaceModule::setDisplayHistogramSetting( + ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq) { + if ((mHistogramInfoRegistered == false) || (isPrimary() == false)) + return -ENOTSUP; + + int32_t ret = + gs101::ExynosDisplayDrmInterfaceModule::setDisplayHistogramSetting( + drmReq); + if (ret != NO_ERROR) return ret; + + ret = setHistoPosProperty(mDrmCrtc->histogram_position_property(), drmReq); + + return ret; +} + +void ExynosDisplayDrmInterfaceModule::registerHistogramInfo( + IDLHistogram *info) { + gs101::ExynosDisplayDrmInterfaceModule::registerHistogramInfo(info); + mHistogramInfo.reset(info); +} + //////////////////////////////////////////////////// ExynosPrimaryDisplayDrmInterfaceModule ////////////////////////////////////////////////////////////////// ExynosPrimaryDisplayDrmInterfaceModule::ExynosPrimaryDisplayDrmInterfaceModule(ExynosDisplay *exynosDisplay) : ExynosDisplayDrmInterfaceModule(exynosDisplay) diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h index e7a1ca9..a341f39 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.h @@ -37,16 +37,27 @@ class ExynosDisplayDrmInterfaceModule : public gs101::ExynosDisplayDrmInterfaceM virtual int32_t setDisplayColorSetting( ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq); + /* For Histogram */ + virtual int32_t setDisplayHistogramSetting( + ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq) override; + virtual void registerHistogramInfo(IDLHistogram *info) override; + private: int32_t createCgcDMAFromIDqe(const IDisplayColorGS101::IDqe::CgcData &cgcData); int32_t setCgcLutDmaProperty(const DrmProperty &prop, ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq); + /* For Histogram */ + int32_t setHistoPosProperty( + const DrmProperty &prop, + ExynosDisplayDrmInterface::DrmModeAtomicReq &drmReq); bool mCgcEnabled = false; using CGCDataInfo = std::pair<int32_t, struct cgc_dma_lut *>; std::vector<CGCDataInfo> mCGCDataInfos; size_t iCGCDataInfo = 0; + /* For Histogram */ + std::shared_ptr<IDLHistogram> mHistogramInfo; }; class ExynosPrimaryDisplayDrmInterfaceModule : public ExynosDisplayDrmInterfaceModule { |