summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_layers.cpp
diff options
context:
space:
mode:
authorBaldev Sahu <bsahu@codeaurora.org>2019-12-20 16:49:48 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-03-25 23:39:56 -0700
commit936422390ec6d7583a61436fc16742919bee6249 (patch)
tree66b30bf1a1477f4c0a5f7afdbfbd8b93be86b88a /sdm/libs/hwc2/hwc_layers.cpp
parent36739aa28d1a55ea73f66ad32895436dcf1e4c75 (diff)
hwc2: Initialize ColorMetadata transfer as sRGB
- SetCSC function does not assign transfer value, "transfer=0" is used as the default initialization which leads to incorrect UI layer color conversion. So initialize ColorMetadata transfer as sRGB. Change-Id: I2476a36cba00a50c394b275c40242eee0cc0bcac CRs-Fixed: 2574361
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index aed84b18..b160d90e 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -39,6 +39,7 @@ DisplayError SetCSC(const private_handle_t *pvt_handle, ColorMetaData *color_met
if (csc == ITU_R_601_FR || csc == ITU_R_2020_FR) {
color_metadata->range = Range_Full;
}
+ color_metadata->transfer = Transfer_sRGB;
switch (csc) {
case ITU_R_601:
@@ -966,7 +967,7 @@ void HWCLayer::ValidateAndSetCSC(const private_handle_t *handle) {
// Since client has set PerFrameMetadatablobs its dataspace and hdr10+ data will be updated
// so we can skip reading from ColorMetaData.
if (use_color_metadata && !per_frame_hdr_metadata_blob_) {
- ColorMetaData new_metadata = {};
+ ColorMetaData new_metadata = layer_buffer->color_metadata;
if (sdm::SetCSC(handle, &new_metadata) == kErrorNone) {
// If dataspace is KNOWN, overwrite the gralloc metadata CSC using the previously derived CSC
// from dataspace.