diff options
author | Midas Chien <midaschieh@google.com> | 2023-02-23 15:42:33 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-02-23 15:42:33 +0000 |
commit | 82457c4692dd9c56c5890eec095daab343ea1c20 (patch) | |
tree | ee72b5adedfb6493ef3d49c99a85ef0405ff257b | |
parent | ccad0f33bbf2df165fecc57e18b3a016c34576ab (diff) | |
parent | 215c8c3f279064513333218a096aba55926a0bf4 (diff) | |
download | gs201-82457c4692dd9c56c5890eec095daab343ea1c20.tar.gz |
libhwc2.1: add restriction for handling vertical downscale RGB layer am: 5f300045ee am: 215c8c3f27
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/graphics/gs201/+/21439047
Change-Id: Id987dc734377c022ae023dec640a9507c8d53e6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.cpp | 21 | ||||
-rw-r--r-- | libhwc2.1/libresource/ExynosMPPModule.h | 3 |
2 files changed, 16 insertions, 8 deletions
diff --git a/libhwc2.1/libresource/ExynosMPPModule.cpp b/libhwc2.1/libresource/ExynosMPPModule.cpp index be2c834..d158f31 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.cpp +++ b/libhwc2.1/libresource/ExynosMPPModule.cpp @@ -34,17 +34,24 @@ ExynosMPPModule::~ExynosMPPModule() {} * it. Once a solution is ready, the restriction need to be removed. */ bool ExynosMPPModule::checkSpecificRestriction(const uint32_t refreshRate, - const struct exynos_image &src) { - // case: downscale 4k video layer as equal or higher than 90FPS - if (refreshRate >= 90) { + 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 >= 2000 && src.h >= 1600 && - isFormatYUV(gmeta.format)) { + + if (isFormatYUV(gmeta.format)) { + if (src.fullWidth == 3840 && src.w >= 3584 && src.fullHeight >= 2000 && src.h >= 1600) { + // downscale 4k YUV layer + return true; + } + } else if (src.w >= 1680 && src.h > dst.h && (dst.h * 100 / src.h) < 60) { + // vertical downscale RGB layer return true; } } - return ExynosMPP::checkSpecificRestriction(refreshRate, src); + return ExynosMPP::checkSpecificRestriction(refreshRate, src, dst); } int64_t ExynosMPPModule::isSupported(ExynosDisplay &display, @@ -53,7 +60,7 @@ int64_t ExynosMPPModule::isSupported(ExynosDisplay &display, if (mPhysicalType < MPP_DPP_NUM && src.bufferHandle != nullptr) { const uint32_t refreshRate = display.getBtsRefreshRate(); - if (checkSpecificRestriction(refreshRate, src)) { + if (checkSpecificRestriction(refreshRate, src, dst)) { return -eMPPSatisfiedRestriction; } } diff --git a/libhwc2.1/libresource/ExynosMPPModule.h b/libhwc2.1/libresource/ExynosMPPModule.h index 94506f9..662c2c4 100644 --- a/libhwc2.1/libresource/ExynosMPPModule.h +++ b/libhwc2.1/libresource/ExynosMPPModule.h @@ -31,7 +31,8 @@ class ExynosMPPModule : public gs101::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 &src, + const struct exynos_image &dst); }; } // namespace gs201 |