diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-20 22:39:01 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-20 22:39:01 +0000 |
commit | 0ed6962e33b058d4a6c3ae47974e2a00e3837e39 (patch) | |
tree | 137756a980a1977c44801904d3ffcb0b9507a6ae | |
parent | d00cb41b4fa1644aec7adbd44887383c544000b5 (diff) | |
parent | 0b0f55b1ccea9a8eda0f1b31e37465717839ef2f (diff) | |
download | gs201-0ed6962e33b058d4a6c3ae47974e2a00e3837e39.tar.gz |
Snap for 10448490 from 0b0f55b1ccea9a8eda0f1b31e37465717839ef2f to simpleperf-release
Change-Id: I94dddef7013895345d18c10253f1a51b7a2469ff
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.cpp | 40 | ||||
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.h | 3 |
2 files changed, 29 insertions, 14 deletions
diff --git a/libhwc2.1/libresource/ExynosMPPModule.cpp b/libhwc2.1/libresource/ExynosMPPModule.cpp index 3d9e4af..c532117 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.cpp +++ b/libhwc2.1/libresource/ExynosMPPModule.cpp @@ -33,29 +33,41 @@ 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; - } - - // case: downscale 4k video layer as equal or higher than 90FPS - const uint32_t refresh_rate = display.getBtsRefreshRate(); - if (refresh_rate >= 90) { +bool ExynosMPPModule::checkSpecificRestriction(const uint32_t refreshRate, + const struct exynos_image &src, + const struct exynos_image &dst) { + /* additional restriction for composer in high refresh rate */ + if (mPhysicalType < MPP_DPP_NUM && refreshRate >= 90) { VendorGraphicBufferMeta gmeta(src.bufferHandle); - if (src.fullWidth == 3840 && src.w >= 3584 && src.fullHeight >= 2160 && src.h >= 1600 && - isFormatYUV(gmeta.format)) { + + if (isFormatYUV(gmeta.format)) { + // 16:9 4k or large YUV layer + if (src.w >= 3584 && src.h >= 1600) { + return true; + } + // 9:16 4k or large YUV layer + if (src.h >= 2600 && src.w >= 1450 && src.h > dst.h && (dst.h * 100 / src.h) < 67) { + return true; + } + } else if (src.w >= 1680 && src.h > dst.h && (dst.h * 100 / src.h) < 60) { + // vertical downscale RGB layer return true; } } - return false; + + return ExynosMPP::checkSpecificRestriction(refreshRate, src, dst); } 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, dst)) { + return -eMPPSatisfiedRestriction; + } } + return ExynosMPP::isSupported(display, src, dst); } diff --git a/libhwc2.1/libresource/ExynosMPPModule.h b/libhwc2.1/libresource/ExynosMPPModule.h index 0fd0f2d..662c2c4 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.h +++ b/libhwc2.1/libresource/ExynosMPPModule.h @@ -30,6 +30,9 @@ 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, + const struct exynos_image &dst); }; } // namespace gs201 |