diff options
author | Xin Li <delphij@google.com> | 2024-01-17 22:14:14 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2024-01-17 22:14:14 -0800 |
commit | 62ae5ff177c6659737e908a756ac67eea8122db7 (patch) | |
tree | c3011fd5345243dc195ac4cacae026a301773787 | |
parent | 8dc2ef449fc54c572d0d9eb76523cda97cfc5f81 (diff) | |
parent | 9e950e74600db0e32084d0430fe9f2d10c816fd4 (diff) | |
download | gs101-temp_319669529.tar.gz |
Merge Android 24Q1 Release (ab/11220357)temp_319669529
Bug: 319669529
Merged-In: I00f6412ac3986aaa9663e585ee76fd599286c18c
Change-Id: Icbe11cd026652e4490a2dcd2b8a377367142ade5
-rw-r--r-- | include/histogram/HistogramInfo.h | 2 | ||||
-rw-r--r-- | include/histogram/histogram.h | 2 | ||||
-rw-r--r-- | libhwc2.1/libdevice/ExynosDeviceModule.cpp | 10 | ||||
-rw-r--r-- | libhwc2.1/libdevice/ExynosDeviceModule.h | 2 | ||||
-rw-r--r-- | libhwc2.1/libdevice/HistogramController.cpp | 4 | ||||
-rw-r--r-- | libhwc2.1/libdevice/HistogramController.h | 5 | ||||
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp | 29 | ||||
-rw-r--r-- | libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp | 28 | ||||
-rw-r--r-- | libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h | 13 |
9 files changed, 48 insertions, 47 deletions
diff --git a/include/histogram/HistogramInfo.h b/include/histogram/HistogramInfo.h index 34eada3..2e6602c 100644 --- a/include/histogram/HistogramInfo.h +++ b/include/histogram/HistogramInfo.h @@ -57,7 +57,7 @@ public: HistogramInfo(HistogramType type) { mHistogramType = type; } virtual ~HistogramInfo() {} - virtual void setHistogramPos(HistogramPos pos) = 0; + virtual void setHistogramPos(const HistogramPos& pos) = 0; virtual void callbackHistogram(char16_t* bin) = 0; std::mutex mSetHistInfoMutex; diff --git a/include/histogram/histogram.h b/include/histogram/histogram.h index 7e7693d..cc0cacf 100644 --- a/include/histogram/histogram.h +++ b/include/histogram/histogram.h @@ -27,7 +27,7 @@ class IDLHistogram : public HistogramInfo { public: IDLHistogram() : HistogramInfo(HistogramType::HISTOGRAM_HIDL) {} virtual ~IDLHistogram() {} - virtual void setHistogramPos(HistogramPos pos) {} + virtual void setHistogramPos(const HistogramPos& pos) {} }; #endif // HISTOGRAM_H_ diff --git a/libhwc2.1/libdevice/ExynosDeviceModule.cpp b/libhwc2.1/libdevice/ExynosDeviceModule.cpp index be259aa..99dd8ba 100644 --- a/libhwc2.1/libdevice/ExynosDeviceModule.cpp +++ b/libhwc2.1/libdevice/ExynosDeviceModule.cpp @@ -23,16 +23,18 @@ extern struct exynos_hwc_control exynosHWCControl; using namespace gs101; -ExynosDeviceModule::ExynosDeviceModule() : ExynosDevice(), mDisplayColorLoader(DISPLAY_COLOR_LIB) { +ExynosDeviceModule::ExynosDeviceModule(bool isVrrApiSupported) + : ExynosDevice(isVrrApiSupported), mDisplayColorLoader(DISPLAY_COLOR_LIB) { exynosHWCControl.skipStaticLayers = false; std::vector<displaycolor::DisplayInfo> display_info; for (uint32_t i = 0; i < mDisplays.size(); i++) { ExynosDisplay* display = mDisplays[i]; - ExynosDisplayDrmInterfaceModule* moduleDisplayInterface = - (ExynosDisplayDrmInterfaceModule*)(display->mDisplayInterface.get()); - + // TODO(b/288608645): Allow HWC_DISPLAY_EXTERNAL here when displaycolor + // supports external displays. if (display->mType == HWC_DISPLAY_PRIMARY) { + ExynosDisplayDrmInterfaceModule* moduleDisplayInterface = + (ExynosDisplayDrmInterfaceModule*)(display->mDisplayInterface.get()); moduleDisplayInterface->getDisplayInfo(display_info); } } diff --git a/libhwc2.1/libdevice/ExynosDeviceModule.h b/libhwc2.1/libdevice/ExynosDeviceModule.h index 6c772b6..42c2e18 100644 --- a/libhwc2.1/libdevice/ExynosDeviceModule.h +++ b/libhwc2.1/libdevice/ExynosDeviceModule.h @@ -27,7 +27,7 @@ namespace gs101 { class ExynosDeviceModule : public ExynosDevice { using GsInterfaceType = gs::ColorDrmBlobFactory::GsInterfaceType; public: - ExynosDeviceModule(); + ExynosDeviceModule(bool isVrrApiSupported); virtual ~ExynosDeviceModule(); GsInterfaceType* getDisplayColorInterface() { return mDisplayColorInterface; } diff --git a/libhwc2.1/libdevice/HistogramController.cpp b/libhwc2.1/libdevice/HistogramController.cpp index 137fd61..0b9a38d 100644 --- a/libhwc2.1/libdevice/HistogramController.cpp +++ b/libhwc2.1/libdevice/HistogramController.cpp @@ -15,7 +15,3 @@ */ #include "HistogramController.h" - -void HistogramController::initSupportSamplePosList() { - mHistogramCapability.supportSamplePosList.push_back(HistogramSamplePos::POST_POSTPROC); -} diff --git a/libhwc2.1/libdevice/HistogramController.h b/libhwc2.1/libdevice/HistogramController.h index 988e6e3..b9be3b8 100644 --- a/libhwc2.1/libdevice/HistogramController.h +++ b/libhwc2.1/libdevice/HistogramController.h @@ -14,10 +14,11 @@ * limitations under the License. */ +#pragma once + #include "HistogramDevice.h" class HistogramController : public HistogramDevice { public: - HistogramController(ExynosDisplay *display) : HistogramDevice(display, 1, {}) {} - virtual void initSupportSamplePosList() override; + HistogramController(ExynosDisplay* display) : HistogramDevice(display, 1, {}) {} }; diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp index 9d5f1c1..8190e3c 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp @@ -440,21 +440,32 @@ uint32_t ExynosDisplayDrmInterfaceModule::SaveBlob::getBlob(uint32_t type) void ExynosDisplayDrmInterfaceModule::getDisplayInfo( std::vector<displaycolor::DisplayInfo> &display_info) { - displaycolor::DisplayInfo primary_display; - - primary_display.brightness_ranges = - mExynosDisplay->mBrightnessController->getBrightnessRanges(); - primary_display.panel_name = GetPanelName(); - primary_display.panel_serial = GetPanelSerial(); + displaycolor::DisplayInfo disp_info; + + if (mExynosDisplay->mType == HWC_DISPLAY_PRIMARY) { + disp_info.brightness_ranges = mExynosDisplay->mBrightnessController->getBrightnessRanges(); + disp_info.panel_name = GetPanelName(); + disp_info.panel_serial = GetPanelSerial(); + if (mExynosDisplay->mIndex == 0) + disp_info.display_type = DisplayType::DISPLAY_PRIMARY; + else + disp_info.display_type = DisplayType::DISPLAY_SECONDARY; + } else if (mExynosDisplay->mType == HWC_DISPLAY_EXTERNAL) { + disp_info.display_type = DisplayType::DISPLAY_EXTERNAL; + disp_info.panel_name = "external_display"; + disp_info.panel_serial = "0001"; + } else { + ALOGE("Unsupported display type (%d) in getDisplayInfo!", mExynosDisplay->mType); + return; + } - display_info.push_back(primary_display); + display_info.push_back(disp_info); } const std::string ExynosDisplayDrmInterfaceModule::GetPanelInfo(const std::string &sysfs_rel, char delim) { ExynosPrimaryDisplayModule* display = (ExynosPrimaryDisplayModule*)mExynosDisplay; - const DisplayType type = display->getBuiltInDisplayType(); - const std::string &sysfs = display->getPanelSysfsPath(type); + const std::string& sysfs = display->getPanelSysfsPath(); if (sysfs.empty()) { return ""; diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp index e21999c..f376447 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp @@ -125,7 +125,7 @@ int32_t ExynosPrimaryDisplayModule::getColorModes( uint32_t* outNumModes, int32_t* outModes) { GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); const ColorModesMap colorModeMap = displayColorInterface == nullptr ? ColorModesMap() : displayColorInterface->ColorModesAndRenderIntents(display); @@ -155,7 +155,7 @@ int32_t ExynosPrimaryDisplayModule::setColorMode(int32_t mode) { ALOGD("%s: mode(%d)", __func__, mode); GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); const ColorModesMap colorModeMap = displayColorInterface == nullptr ? ColorModesMap() : displayColorInterface->ColorModesAndRenderIntents(display); @@ -179,7 +179,7 @@ int32_t ExynosPrimaryDisplayModule::getRenderIntents(int32_t mode, uint32_t* outNumIntents, int32_t* outIntents) { GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); const ColorModesMap colorModeMap = displayColorInterface == nullptr ? ColorModesMap() : displayColorInterface->ColorModesAndRenderIntents(display); @@ -216,7 +216,7 @@ int32_t ExynosPrimaryDisplayModule::setColorModeWithRenderIntent(int32_t mode, int32_t intent) { GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); const ColorModesMap colorModeMap = displayColorInterface == nullptr ? ColorModesMap() : displayColorInterface->ColorModesAndRenderIntents(display); @@ -280,7 +280,7 @@ int32_t ExynosPrimaryDisplayModule::getClientTargetProperty( return ExynosDisplay::getClientTargetProperty(outClientTargetProperty); } - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); hwc::PixelFormat pixelFormat; hwc::Dataspace dataspace; bool dimming_linear; @@ -301,14 +301,14 @@ int32_t ExynosPrimaryDisplayModule::getClientTargetProperty( } int32_t ExynosPrimaryDisplayModule::updateBrightnessTable() { - const IBrightnessTable* table = nullptr; + std::unique_ptr<const IBrightnessTable> table; auto displayColorInterface = getDisplayColorInterface(); if (displayColorInterface == nullptr) { ALOGE("%s displaycolor interface not available!", __func__); return HWC2_ERROR_NO_RESOURCES; } - auto displayType = getBuiltInDisplayType(); + auto displayType = getDcDisplayType(); auto ret = displayColorInterface->GetBrightnessTable(displayType, table); if (ret != android::OK) { ALOGE("%s brightness table not available!", __func__); @@ -397,7 +397,7 @@ bool ExynosPrimaryDisplayModule::hasDppForLayer(ExynosMPPSource* layer) return false; uint32_t index = mDisplaySceneInfo.layerDataMappingInfo[layer].dppIdx; - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); auto size = displayColorInterface->GetPipelineData(display)->Dpp().size(); if (index >= size) { DISPLAY_LOGE("%s: invalid dpp index(%d) dpp size(%zu)", __func__, index, size); @@ -411,7 +411,7 @@ const ExynosPrimaryDisplayModule::GsInterfaceType::IDpp& ExynosPrimaryDisplayMod ExynosMPPSource* layer) { uint32_t index = mDisplaySceneInfo.layerDataMappingInfo[layer].dppIdx; GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); return displayColorInterface->GetPipelineData(display)->Dpp()[index].get(); } @@ -727,7 +727,7 @@ int32_t ExynosPrimaryDisplayModule::updateColorConversionInfo() if (hwcCheckDebugMessages(eDebugColorManagement)) mDisplaySceneInfo.printDisplayScene(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); if ((ret = displayColorInterface->Update(display, mDisplaySceneInfo.displayScene)) != 0) { DISPLAY_LOGE("Display Scene update error (%d)", ret); return ret; @@ -767,7 +767,7 @@ int32_t ExynosPrimaryDisplayModule::updatePresentColorConversionInfo() mDisplaySceneInfo.displayScene.lhbm_on = mBrightnessController->isLhbmOn(); mDisplaySceneInfo.displayScene.dbv = mBrightnessController->getBrightnessLevel(); - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); if ((ret = displayColorInterface->UpdatePresent(display, mDisplaySceneInfo.displayScene)) != 0) { DISPLAY_LOGE("Display Scene update error (%d)", ret); @@ -783,7 +783,7 @@ int32_t ExynosPrimaryDisplayModule::getColorAdjustedDbv(uint32_t &dbv_adj) { return NO_ERROR; } - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); dbv_adj = displayColorInterface->GetPipelineData(display)->Panel().GetAdjustedBrightnessLevel(); return NO_ERROR; } @@ -1121,7 +1121,7 @@ PanelCalibrationStatus ExynosPrimaryDisplayModule::getPanelCalibrationStatus() { return PanelCalibrationStatus::UNCALIBRATED; } - auto displayType = getBuiltInDisplayType(); + auto displayType = getDcDisplayType(); auto calibrationInfo = displayColorInterface->GetCalibrationInfo(displayType); if (calibrationInfo.factory_cal_loaded) { @@ -1217,7 +1217,7 @@ bool ExynosPrimaryDisplayModule::isDisplaySwitched(int32_t mode, int32_t prevMod } bool ExynosPrimaryDisplayModule::isColorCalibratedByDevice() { - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); GsInterfaceType* displayColorInterface = getDisplayColorInterface(); return displayColorInterface->GetCalibrationInfo(display).factory_cal_loaded; }; diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h index 1b1cade..c6404d3 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h @@ -119,7 +119,7 @@ class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay { virtual int32_t resetColorMappingInfo(ExynosMPPSource* mppSrc); virtual int32_t updatePresentColorConversionInfo(); virtual bool checkRrCompensationEnabled() { - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); GsInterfaceType* displayColorInterface = getDisplayColorInterface(); return displayColorInterface ? displayColorInterface->IsRrCompensationEnabled(display) @@ -248,22 +248,13 @@ class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay { return change; } - size_t getNumOfDpp() { - const DisplayType display = getDisplayTypeFromIndex(mIndex); - GsInterfaceType* displayColorInterface = getDisplayColorInterface(); - return displayColorInterface->GetPipelineData(display)->Dpp().size(); - }; - const GsInterfaceType::IDqe& getDqe() { - const DisplayType display = getDisplayTypeFromIndex(mIndex); + const DisplayType display = getDcDisplayType(); GsInterfaceType* displayColorInterface = getDisplayColorInterface(); return displayColorInterface->GetPipelineData(display)->Dqe(); }; - // primary or secondary - DisplayType getBuiltInDisplayType() { return getDisplayTypeFromIndex(mIndex); } - int32_t updateBrightnessTable(); private: |