diff options
author | Xin Li <delphij@google.com> | 2023-06-21 15:16:02 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2023-06-21 15:16:02 -0700 |
commit | 0b0f55b1ccea9a8eda0f1b31e37465717839ef2f (patch) | |
tree | 137756a980a1977c44801904d3ffcb0b9507a6ae | |
parent | e8899fdabe670c820c0d7d7f2a09cd25ea96b63f (diff) | |
parent | 83517d3bba414a80ea7dc32680584f693ed81c30 (diff) | |
download | gs201-0b0f55b1ccea9a8eda0f1b31e37465717839ef2f.tar.gz |
Merge Android 13 QPR3
Bug: 275386652
Merged-In: Ie56845709dae3673ef7bd9b19659e99ad39eb0e8
Change-Id: I7de4680c43fea1488bf235e0124c524604ff4e39
-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 |