summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunKyung Kim <hk310.kim@samsung.com>2019-10-01 20:12:10 +0900
committerHyunKyung Kim <hk310.kim@samsung.com>2020-06-10 20:14:35 +0900
commitbb990ffe21173f914f1d914c2cc3d1dd7e37a5be (patch)
tree5609ff8c9f79972a4763ed17c2c14c1d291a49e3
parent2eda2972d9e315c9d5058644a74386333e9168fc (diff)
libhwc2.1: Update MPP attribute with module setting
Previous code update MPP atributes using feature_table[]. feature_table is updated and read from different file. feature_table is static global variable so updated value can't be read even if it was updated in other file. This patch fixes this issue. This patch saves updated attribute in ExynosResourceManager::mMPPAttrs and read attribute from this ExynosResourceManager::mMPPAttrs. Change-Id: Ib1f28871d33e13346c79b7b7d8a8532a72b7dec5 Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp3
-rw-r--r--libhwc2.1/libresource/ExynosMPP.cpp12
-rw-r--r--libhwc2.1/libresource/ExynosResourceManager.h3
3 files changed, 13 insertions, 5 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
index 04ac17e..aff8b45 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDeviceInterface.cpp
@@ -20,6 +20,7 @@
#include "ExynosResourceManager.h"
#include "ExynosMPP.h"
#include <unordered_set>
+#include <unordered_map>
extern feature_support_t feature_table[];
@@ -180,6 +181,8 @@ int32_t ExynosDeviceInterface::updateFeatureTable() {
HDEBUGLOGD(eDebugAttrSetting, "type : %d, feature : 0x%lx",
feature_table[j].hwType,
(unsigned long)feature_table[j].attr);
+ mExynosDevice->mResourceManager->mMPPAttrs.insert(std::make_pair((uint32_t)feature_table[j].hwType,
+ (uint64_t)feature_table[j].attr));
}
return 0;
}
diff --git a/libhwc2.1/libresource/ExynosMPP.cpp b/libhwc2.1/libresource/ExynosMPP.cpp
index 1974f25..7b7f764 100644
--- a/libhwc2.1/libresource/ExynosMPP.cpp
+++ b/libhwc2.1/libresource/ExynosMPP.cpp
@@ -2766,11 +2766,13 @@ void ExynosMPP::updateAttr()
{
MPP_LOGD(eDebugAttrSetting, "updateAttr::mPhysicalType(%d), mAttr(0x%" PRIx64 ")",
mPhysicalType, mAttr);
- for (int i = 0; i < MPP_P_TYPE_MAX; i++) {
- if (feature_table[i].hwType == mPhysicalType) {
- mAttr = feature_table[i].attr;
- MPP_LOGD(eDebugAttrSetting, "After mAttr(0x%" PRIx64 ")", mAttr);
- }
+
+ if (mResourceManager == NULL) return;
+
+ auto iter = mResourceManager->mMPPAttrs.find(mPhysicalType);
+ if (iter != mResourceManager->mMPPAttrs.end()) {
+ mAttr = iter->second;
+ MPP_LOGD(eDebugAttrSetting, "After mAttr(0x%" PRIx64 ")", mAttr);
}
}
diff --git a/libhwc2.1/libresource/ExynosResourceManager.h b/libhwc2.1/libresource/ExynosResourceManager.h
index eca6f5f..e0ea18b 100644
--- a/libhwc2.1/libresource/ExynosResourceManager.h
+++ b/libhwc2.1/libresource/ExynosResourceManager.h
@@ -21,6 +21,7 @@
#ifndef _EXYNOSRESOURCEMANAGER_H
#define _EXYNOSRESOURCEMANAGER_H
+#include <unordered_map>
#include "ExynosDevice.h"
#include "ExynosDisplay.h"
#include "ExynosHWCHelper.h"
@@ -83,6 +84,8 @@ class ExynosResourceManager {
restriction_key_t mFormatRestrictions[RESTRICTION_CNT_MAX];
restriction_size_element_t mSizeRestrictions[RESTRICTION_MAX][RESTRICTION_CNT_MAX];
+ std::unordered_map<uint32_t /* physical type */, uint64_t /* attribute */> mMPPAttrs;
+
ExynosResourceManager(ExynosDevice *device);
virtual ~ExynosResourceManager();
void reloadResourceForHWFC();