diff options
author | Midas Chien <midaschieh@google.com> | 2023-02-01 22:11:10 +0800 |
---|---|---|
committer | Midas Chien <midaschieh@google.com> | 2023-02-03 15:32:11 +0000 |
commit | 845fe4b3da9e67cc587d7c3b1b4f57545f0dbef7 (patch) | |
tree | 034e6382500fcd69adc9dd0cae0247b787a59fc3 | |
parent | 85245b2282243ae54cd1273a221f3df112d5c890 (diff) | |
download | gs201-845fe4b3da9e67cc587d7c3b1b4f57545f0dbef7.tar.gz |
libhwc2.1: move specific restriction function to ExynosMPPModule class
We may have specific restriction to prevent underrun in high refresh
rate situation. We should need to check this restriction when switching
refresh rate from low to hight to re-assign resources if needed.
Bug: 266850798
Test: play 4k video and switch refresh rate
Change-Id: I6edeb1ddcb2df6589c447e2c59535bbf2e98db97
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.cpp | 25 | ||||
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.h | 2 |
2 files changed, 15 insertions, 12 deletions
diff --git a/libhwc2.1/libresource/ExynosMPPModule.cpp b/libhwc2.1/libresource/ExynosMPPModule.cpp index 3d9e4af..be2c834 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.cpp +++ b/libhwc2.1/libresource/ExynosMPPModule.cpp @@ -33,29 +33,30 @@ ExynosMPPModule::~ExynosMPPModule() {} /* This function is used to restrict case that current MIF voting can't cover * it. Once a solution is ready, the restriction need to be removed. */ -bool checkSpecificRestriction(const ExynosDisplay &display, - const struct exynos_image &src) { - if (src.bufferHandle == nullptr) { - return false; - } - +bool ExynosMPPModule::checkSpecificRestriction(const uint32_t refreshRate, + const struct exynos_image &src) { // case: downscale 4k video layer as equal or higher than 90FPS - const uint32_t refresh_rate = display.getBtsRefreshRate(); - if (refresh_rate >= 90) { + if (refreshRate >= 90) { VendorGraphicBufferMeta gmeta(src.bufferHandle); - if (src.fullWidth == 3840 && src.w >= 3584 && src.fullHeight >= 2160 && src.h >= 1600 && + if (src.fullWidth == 3840 && src.w >= 3584 && src.fullHeight >= 2000 && src.h >= 1600 && isFormatYUV(gmeta.format)) { return true; } } - return false; + + return ExynosMPP::checkSpecificRestriction(refreshRate, src); } int64_t ExynosMPPModule::isSupported(ExynosDisplay &display, struct exynos_image &src, struct exynos_image &dst) { - if (mPhysicalType < MPP_DPP_NUM && checkSpecificRestriction(display, src)) { - return -eMPPSatisfiedRestriction; + if (mPhysicalType < MPP_DPP_NUM && src.bufferHandle != nullptr) { + const uint32_t refreshRate = display.getBtsRefreshRate(); + + if (checkSpecificRestriction(refreshRate, src)) { + return -eMPPSatisfiedRestriction; + } } + return ExynosMPP::isSupported(display, src, dst); } diff --git a/libhwc2.1/libresource/ExynosMPPModule.h b/libhwc2.1/libresource/ExynosMPPModule.h index 0fd0f2d..94506f9 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.h +++ b/libhwc2.1/libresource/ExynosMPPModule.h @@ -30,6 +30,8 @@ class ExynosMPPModule : public gs101::ExynosMPPModule { ~ExynosMPPModule(); virtual int64_t isSupported(ExynosDisplay &display, struct exynos_image &src, struct exynos_image &dst); + virtual bool checkSpecificRestriction(const uint32_t __unused refreshRate, + const struct exynos_image &src); }; } // namespace gs201 |