summaryrefslogtreecommitdiff
path: root/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
diff options
context:
space:
mode:
authorYichi Chen <yichichen@google.com>2020-12-14 22:16:03 +0800
committerYichi Chen <yichichen@google.com>2020-12-22 20:06:34 +0800
commit47420b087aad797af0ae568133fe16266f8e24eb (patch)
treea04549347ffc98de4e4b747e7f413f336f6a6741 /libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
parent7596282af72f0b8580d00153c728563d96d8f1b9 (diff)
libhwc2.1: Support the property control for DPP downscale
Before we can safely enable 1/4 DPP downscale, it is necessary to have a dynamic control to switch between 1/2 and 1/4 downscale limitation for DPP. If not specify, the downscale limitation will follow the DPP configurations in the device tree. Bug: 170821166 Test: Configure DPP downscale to 0, 1, 2 and check in HWC dump. Change-Id: I8282a6b54ad5c97f507a01e1cd8f62ff6719ba69
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp')
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
index 2755eb5..2901fab 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
@@ -15,13 +15,17 @@
*/
#include "ExynosDeviceInterface.h"
-#include "ExynosHWCDebug.h"
+
+#include <cutils/properties.h>
+
+#include <unordered_map>
+#include <unordered_set>
+
#include "ExynosDevice.h"
-#include "ExynosResourceManager.h"
+#include "ExynosHWCDebug.h"
#include "ExynosMPP.h"
+#include "ExynosResourceManager.h"
#include "ExynosResourceRestriction.h"
-#include <unordered_set>
-#include <unordered_map>
#ifndef USE_MODULE_ATTR
extern feature_support_t feature_table[];
@@ -125,6 +129,14 @@ int32_t ExynosDeviceInterface::makeDPURestrictions() {
rSize.cropHeightAlign = r.blk_y_align;
mpp_phycal_type_t hwType = resourceManager->getPhysicalType(i);
+ if (hwType <= MPP_DPP_NUM) {
+ auto newMaxDownscale =
+ static_cast<unsigned int>(property_get_int32("vendor.hwc.dpp.downscale", 0));
+ if (newMaxDownscale != 0) {
+ rSize.maxDownScale = min(rSize.maxDownScale, newMaxDownscale);
+ ALOGI("%s:: Apply DPP downscale restriction on 1/%d", __func__, rSize.maxDownScale);
+ }
+ }
resourceManager->makeSizeRestrictions(hwType, rSize, RESTRICTION_RGB);
/* YUV size restrictions */