From 5f300045ee6dba29f2dea673c8b8f7ec35de5441 Mon Sep 17 00:00:00 2001 From: Midas Chien Date: Wed, 15 Feb 2023 08:30:26 +0000 Subject: libhwc2.1: add restriction for handling vertical downscale RGB layer One underrun issue happens when DPU handles RGB layer with specific vertical downscale ratio. To avoid underrun, HWC fallbacks to client composition first. Then, we continue to investigate the DPU constraints. Bug: 266609442 Test: Dialer, Meet, Chrome, Camera, YT Change-Id: I51722e41a08353d687c3c8268fb41fc7b79568cb --- libhwc2.1/libresource/ExynosMPPModule.cpp | 21 ++++++++++++++------- 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 -- cgit v1.2.3