summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2023-10-17 10:08:42 -0700
committerXin Li <delphij@google.com>2023-10-17 10:08:42 -0700
commitb6d892dbcb71aac3eaeace76c9a9da62a8752d1f (patch)
tree54e0796e7d03b2ac986d58a965fa93a72a39790f
parent0c894b39caf3df07621c0f8a8bb8ba151f360475 (diff)
parentfe4d155acd7c8e1461ca6171d3861d65903ceb02 (diff)
downloadgs101-tmp_amf_315507370.tar.gz
Merge 10952656tmp_amf_315507370
Merged-In: Id36c3055e6cb0e2083a975455a549e05dbb80165 Change-Id: Ib50ebc1d72bf309c0821170c20363a537d07f01a
-rw-r--r--.clang-format4
-rw-r--r--libcap/acrylic_capability.h1
-rw-r--r--libhwc2.1/Android.mk1
-rw-r--r--libhwc2.1/ExynosHWCModule.h10
-rw-r--r--libhwc2.1/ExynosResourceRestriction.h52
-rw-r--r--libhwc2.1/libdevice/ExynosDeviceModule.cpp8
-rw-r--r--libhwc2.1/libdevice/HistogramController.cpp21
-rw-r--r--libhwc2.1/libdevice/HistogramController.h23
-rw-r--r--libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp14
-rw-r--r--libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp86
-rw-r--r--libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h4
11 files changed, 159 insertions, 65 deletions
diff --git a/.clang-format b/.clang-format
index 03af56d..f63f670 100644
--- a/.clang-format
+++ b/.clang-format
@@ -11,3 +11,7 @@ ContinuationIndentWidth: 8
IndentWidth: 4
PenaltyBreakBeforeFirstCallParameter: 100000
SpacesBeforeTrailingComments: 1
+IncludeBlocks: Preserve
+
+DerivePointerAlignment: false
+PointerAlignment: Left
diff --git a/libcap/acrylic_capability.h b/libcap/acrylic_capability.h
index 3cc1715..d914703 100644
--- a/libcap/acrylic_capability.h
+++ b/libcap/acrylic_capability.h
@@ -46,6 +46,7 @@ static uint32_t all_fimg2d_gs101_formats[] = {
MALI_GRALLOC_FORMAT_INTERNAL_YUV420_10BIT_I,
HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN,
HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M,
+ MALI_GRALLOC_FORMAT_INTERNAL_P010,
HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_SBWC,
HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_SBWC,
HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_10B_SBWC,
diff --git a/libhwc2.1/Android.mk b/libhwc2.1/Android.mk
index de43986..a04375b 100644
--- a/libhwc2.1/Android.mk
+++ b/libhwc2.1/Android.mk
@@ -15,6 +15,7 @@
LOCAL_SRC_FILES += \
../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libcolormanager/DisplayColorModule.cpp \
../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libdevice/ExynosDeviceModule.cpp \
+ ../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libdevice/HistogramController.cpp \
../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp \
../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libresource/ExynosMPPModule.cpp \
../../$(TARGET_BOARD_PLATFORM)/libhwc2.1/libresource/ExynosResourceManagerModule.cpp \
diff --git a/libhwc2.1/ExynosHWCModule.h b/libhwc2.1/ExynosHWCModule.h
index a20c398..170f66f 100644
--- a/libhwc2.1/ExynosHWCModule.h
+++ b/libhwc2.1/ExynosHWCModule.h
@@ -125,6 +125,11 @@ static const exynos_mpp_t available_otf_mpp_units[] = {
{MPP_DPP_VGRFS, MPP_LOGICAL_DPP_VGRFS, "DPP_VGRFS2", 2, 0, HWC_DISPLAY_PRIMARY_BIT, 0, 0}
};
+static const std::array<exynos_display_t, 2> AVAILABLE_DISPLAY_UNITS = {{
+ {HWC_DISPLAY_PRIMARY, 0, "PrimaryDisplay", "/dev/dri/card0", ""},
+ {HWC_DISPLAY_PRIMARY, 1, "SecondaryDisplay", "/dev/dri/card0", ""}
+}};
+
} // namespace gs101
@@ -139,9 +144,4 @@ const exynos_mpp_t AVAILABLE_M2M_MPP_UNITS[] = {
#endif
};
-const std::array<exynos_display_t, 2> AVAILABLE_DISPLAY_UNITS = {{
- {HWC_DISPLAY_PRIMARY, 0, "PrimaryDisplay", "/dev/dri/card0", ""},
- {HWC_DISPLAY_PRIMARY, 1, "SecondaryDisplay", "/dev/dri/card0", ""}
-}};
-
#endif
diff --git a/libhwc2.1/ExynosResourceRestriction.h b/libhwc2.1/ExynosResourceRestriction.h
index de896d9..076a890 100644
--- a/libhwc2.1/ExynosResourceRestriction.h
+++ b/libhwc2.1/ExynosResourceRestriction.h
@@ -158,6 +158,7 @@ static const restriction_key_t restriction_format_table[] = {
{MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
{MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN, 0},
{MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_YCBCR_P010, 0},
+ {MPP_DPP_VGRFS, NODE_NONE, MALI_GRALLOC_FORMAT_INTERNAL_P010, 0},
{MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
{MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
@@ -176,12 +177,38 @@ static const restriction_key_t restriction_format_table[] = {
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_SPN, 0},
+ {MPP_G2D, NODE_NONE, MALI_GRALLOC_FORMAT_INTERNAL_P010, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_YCrCb_420_SP, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_TILED, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
};
+static ppc_table ppc_table_map = {
+ /* G2D support only 2 plane YUV, so all YUV format should use YUV2P PPC table */
+ /* In case of Scale-Up, G2D should use same PPC table */
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT_NO), {3.2, 2.1, 2.6, 3.3, 3.6, 3.8, 3.8}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT), {3.6, 2.1, 2.7, 3.3, 3.8, 3.5, 3.5}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT_NO), {2.6, 1.4, 0.9, 1.0, 1.0, 3.6, 3.6}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT), {2.6, 1.4, 0.9, 1.0, 1.0, 2.6, 2.6}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT_NO), {3.4, 0.3, 0.5, 0.8, 0.7, 1.6, 1.6}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT), {3.6, 0.3, 0.8, 0.9, 0.9, 1.4, 1.4}},
+
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT_NO), {2.0, 0.8, 0.3, 0.3, 0.4, 2.9, 2.9}},
+ {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT), {2.0, 0.8, 0.3, 0.3, 0.4, 2.6, 2.6}},
+};
+
} // namespace gs101
const restriction_size_element restriction_size_table_rgb[] =
@@ -258,29 +285,4 @@ const dpu_attr_map_t dpu_attr_map_table [] =
{DPP_ATTR_WCG, MPP_ATTR_WCG},
};
-static ppc_table ppc_table_map = {
- /* G2D support only 2 plane YUV, so all YUV format should use YUV2P PPC table */
- /* In case of Scale-Up, G2D should use same PPC table */
- {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT_NO), {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT), {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT_NO), {3.2, 2.1, 2.6, 3.3, 3.6, 3.8, 3.8}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT), {3.6, 2.1, 2.7, 3.3, 3.8, 3.5, 3.5}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT_NO), {2.6, 1.4, 0.9, 1.0, 1.0, 3.6, 3.6}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT), {2.6, 1.4, 0.9, 1.0, 1.0, 2.6, 2.6}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT_NO), {3.4, 0.3, 0.5, 0.8, 0.7, 1.6, 1.6}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT), {3.6, 0.3, 0.8, 0.9, 0.9, 1.4, 1.4}},
-
- {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT_NO), {2.0, 0.8, 0.3, 0.3, 0.4, 2.9, 2.9}},
- {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT), {2.0, 0.8, 0.3, 0.3, 0.4, 2.6, 2.6}},
-};
-
#endif
diff --git a/libhwc2.1/libdevice/ExynosDeviceModule.cpp b/libhwc2.1/libdevice/ExynosDeviceModule.cpp
index 2e01693..be259aa 100644
--- a/libhwc2.1/libdevice/ExynosDeviceModule.cpp
+++ b/libhwc2.1/libdevice/ExynosDeviceModule.cpp
@@ -17,6 +17,7 @@
#include "ExynosDeviceModule.h"
#include "ExynosDisplayDrmInterfaceModule.h"
+#include "ExynosPrimaryDisplayModule.h"
extern struct exynos_hwc_control exynosHWCControl;
@@ -36,6 +37,13 @@ ExynosDeviceModule::ExynosDeviceModule() : ExynosDevice(), mDisplayColorLoader(D
}
}
initDisplayColor(display_info);
+ for (uint32_t i = 0; i < mDisplays.size(); i++) {
+ ExynosDisplay* display = mDisplays[i];
+ if (display->mType == HWC_DISPLAY_PRIMARY) {
+ ExynosPrimaryDisplayModule* modulePrimaryDisplay = (ExynosPrimaryDisplayModule*)display;
+ modulePrimaryDisplay->updateBrightnessTable();
+ }
+ }
}
ExynosDeviceModule::~ExynosDeviceModule() {
diff --git a/libhwc2.1/libdevice/HistogramController.cpp b/libhwc2.1/libdevice/HistogramController.cpp
new file mode 100644
index 0000000..137fd61
--- /dev/null
+++ b/libhwc2.1/libdevice/HistogramController.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HistogramController.h"
+
+void HistogramController::initSupportSamplePosList() {
+ mHistogramCapability.supportSamplePosList.push_back(HistogramSamplePos::POST_POSTPROC);
+}
diff --git a/libhwc2.1/libdevice/HistogramController.h b/libhwc2.1/libdevice/HistogramController.h
new file mode 100644
index 0000000..988e6e3
--- /dev/null
+++ b/libhwc2.1/libdevice/HistogramController.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HistogramDevice.h"
+
+class HistogramController : public HistogramDevice {
+public:
+ HistogramController(ExynosDisplay *display) : HistogramDevice(display, 1, {}) {}
+ virtual void initSupportSamplePosList() override;
+};
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
index e2b751a..9d5f1c1 100644
--- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
+++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterfaceModule.cpp
@@ -441,19 +441,9 @@ uint32_t ExynosDisplayDrmInterfaceModule::SaveBlob::getBlob(uint32_t type)
void ExynosDisplayDrmInterfaceModule::getDisplayInfo(
std::vector<displaycolor::DisplayInfo> &display_info) {
displaycolor::DisplayInfo primary_display;
- auto &tb = primary_display.brightness_table;
- auto *brightnessTable = mExynosDisplay->mBrightnessController->getBrightnessTable();
-
- tb.nbm_nits_min = brightnessTable[toUnderlying(BrightnessRange::NORMAL)].mNitsStart;
- tb.nbm_nits_max = brightnessTable[toUnderlying(BrightnessRange::NORMAL)].mNitsEnd;
- tb.nbm_dbv_min = brightnessTable[toUnderlying(BrightnessRange::NORMAL)].mBklStart;
- tb.nbm_dbv_max = brightnessTable[toUnderlying(BrightnessRange::NORMAL)].mBklEnd;
-
- tb.hbm_nits_min = brightnessTable[toUnderlying(BrightnessRange::HBM)].mNitsStart;
- tb.hbm_nits_max = brightnessTable[toUnderlying(BrightnessRange::HBM)].mNitsEnd;
- tb.hbm_dbv_min = brightnessTable[toUnderlying(BrightnessRange::HBM)].mBklStart;
- tb.hbm_dbv_max = brightnessTable[toUnderlying(BrightnessRange::HBM)].mBklEnd;
+ primary_display.brightness_ranges =
+ mExynosDisplay->mBrightnessController->getBrightnessRanges();
primary_display.panel_name = GetPanelName();
primary_display.panel_serial = GetPanelSerial();
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp
index 2607bb2..e21999c 100644
--- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp
+++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp
@@ -248,6 +248,8 @@ int32_t ExynosPrimaryDisplayModule::setColorModeWithRenderIntent(int32_t mode,
}
mColorMode = (android_color_mode_t)mode;
+ mBrightnessController->updateColorRenderIntent(intent);
+
return HWC2_ERROR_NONE;
}
@@ -298,6 +300,26 @@ int32_t ExynosPrimaryDisplayModule::getClientTargetProperty(
return ExynosDisplay::getClientTargetProperty(outClientTargetProperty);
}
+int32_t ExynosPrimaryDisplayModule::updateBrightnessTable() {
+ const IBrightnessTable* table = nullptr;
+ auto displayColorInterface = getDisplayColorInterface();
+ if (displayColorInterface == nullptr) {
+ ALOGE("%s displaycolor interface not available!", __func__);
+ return HWC2_ERROR_NO_RESOURCES;
+ }
+
+ auto displayType = getBuiltInDisplayType();
+ auto ret = displayColorInterface->GetBrightnessTable(displayType, table);
+ if (ret != android::OK) {
+ ALOGE("%s brightness table not available!", __func__);
+ return HWC2_ERROR_NO_RESOURCES;
+ }
+ // BrightnessController is not ready until this step
+ mBrightnessController->updateBrightnessTable(table);
+
+ return HWC2_ERROR_NONE;
+}
+
int32_t ExynosPrimaryDisplayModule::setLayersColorData()
{
int32_t ret = 0;
@@ -305,12 +327,34 @@ int32_t ExynosPrimaryDisplayModule::setLayersColorData()
// TODO: b/212616164 remove dimSdrRatio
float dimSdrRatio = mBrightnessController->getSdrDimRatioForInstantHbm();
+
+ // for client target
+ {
+ LayerColorData& layerColorData = mDisplaySceneInfo.getLayerColorDataInstance(layerNum);
+
+ /* set layer data mapping info */
+ if ((ret = mDisplaySceneInfo.setLayerDataMappingInfo(&mClientCompositionInfo, layerNum)) !=
+ NO_ERROR) {
+ DISPLAY_LOGE("%s: setLayerDataMappingInfo fail for client composition", __func__);
+ return ret;
+ }
+
+ if ((ret = mDisplaySceneInfo.setClientCompositionColorData(mClientCompositionInfo,
+ layerColorData, dimSdrRatio)) !=
+ NO_ERROR) {
+ DISPLAY_LOGE("%s: setClientCompositionColorData fail", __func__);
+ return ret;
+ }
+
+ layerColorData.is_client_target = true;
+ layerNum++;
+ }
+
for (uint32_t i = 0; i < mLayers.size(); i++)
{
ExynosLayer* layer = mLayers[i];
- if (layer->mValidateCompositionType == HWC2_COMPOSITION_CLIENT)
- continue;
+ if (layer->mCompositionType == HWC2_COMPOSITION_CLIENT) continue;
LayerColorData& layerColorData =
mDisplaySceneInfo.getLayerColorDataInstance(layerNum);
@@ -331,26 +375,7 @@ int32_t ExynosPrimaryDisplayModule::setLayersColorData()
return ret;
}
- layerNum++;
- }
-
- if (mClientCompositionInfo.mHasCompositionLayer) {
- LayerColorData& layerColorData =
- mDisplaySceneInfo.getLayerColorDataInstance(layerNum);
-
- /* set layer data mapping info */
- if ((ret = mDisplaySceneInfo.setLayerDataMappingInfo(&mClientCompositionInfo,
- layerNum)) != NO_ERROR) {
- DISPLAY_LOGE("%s: setLayerDataMappingInfo fail for client composition", __func__);
- return ret;
- }
-
- if ((ret = mDisplaySceneInfo.setClientCompositionColorData(
- mClientCompositionInfo, layerColorData, dimSdrRatio)) != NO_ERROR) {
- DISPLAY_LOGE("%s: setClientCompositionColorData fail", __func__);
- return ret;
- }
-
+ layerColorData.is_client_target = false;
layerNum++;
}
@@ -454,7 +479,7 @@ int32_t ExynosPrimaryDisplayModule::DisplaySceneInfo::setLayerDataMappingInfo(
uint32_t oldPlaneId = prev_layerDataMappingInfo.count(layer) != 0 &&
prev_layerDataMappingInfo[layer].dppIdx == index
? prev_layerDataMappingInfo[layer].planeId
- : UINT_MAX;
+ : LayerMappingInfo::kPlaneIdNone;
layerDataMappingInfo.insert(std::make_pair(layer, LayerMappingInfo{ index, oldPlaneId }));
return NO_ERROR;
@@ -683,6 +708,7 @@ int32_t ExynosPrimaryDisplayModule::updateColorConversionInfo()
return ret;
}
+ updateBrightnessState();
/* clear flag and layer mapping info before setting */
mDisplaySceneInfo.reset();
@@ -710,6 +736,16 @@ int32_t ExynosPrimaryDisplayModule::updateColorConversionInfo()
return ret;
}
+int32_t ExynosPrimaryDisplayModule::resetColorMappingInfo(ExynosMPPSource* mppSrc) {
+ if (mDisplaySceneInfo.layerDataMappingInfo.count(mppSrc) == 0) {
+ return -EINVAL;
+ }
+
+ mDisplaySceneInfo.layerDataMappingInfo[mppSrc].planeId =
+ DisplaySceneInfo::LayerMappingInfo::kPlaneIdNone;
+
+ return NO_ERROR;
+}
int32_t ExynosPrimaryDisplayModule::updatePresentColorConversionInfo()
{
int ret = NO_ERROR;
@@ -724,6 +760,10 @@ int32_t ExynosPrimaryDisplayModule::updatePresentColorConversionInfo()
if (refresh_rate > 0) {
mDisplaySceneInfo.displayScene.refresh_rate = refresh_rate;
}
+ auto operation_rate = moduleDisplayInterface->getOperationRate();
+ if (operation_rate > 0) {
+ mDisplaySceneInfo.displayScene.operation_rate = static_cast<uint32_t>(operation_rate);
+ }
mDisplaySceneInfo.displayScene.lhbm_on = mBrightnessController->isLhbmOn();
mDisplaySceneInfo.displayScene.dbv = mBrightnessController->getBrightnessLevel();
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h
index c60bcfd..1b1cade 100644
--- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h
+++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h
@@ -116,6 +116,7 @@ class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay {
HwcDimmingStage *outDimmingStage = nullptr) override;
virtual int deliverWinConfigData();
virtual int32_t updateColorConversionInfo();
+ virtual int32_t resetColorMappingInfo(ExynosMPPSource* mppSrc);
virtual int32_t updatePresentColorConversionInfo();
virtual bool checkRrCompensationEnabled() {
const DisplayType display = getDisplayTypeFromIndex(mIndex);
@@ -148,6 +149,7 @@ class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay {
uint32_t dppIdx;
// assigned drm plane id in last color setting update
uint32_t planeId;
+ static constexpr uint32_t kPlaneIdNone = std::numeric_limits<uint32_t>::max();
};
bool colorSettingChanged = false;
bool displaySettingDelivered = false;
@@ -262,6 +264,8 @@ class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay {
// primary or secondary
DisplayType getBuiltInDisplayType() { return getDisplayTypeFromIndex(mIndex); }
+ int32_t updateBrightnessTable();
+
private:
int32_t setLayersColorData();
DisplaySceneInfo mDisplaySceneInfo;