summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-05-27 07:26:23 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-05-27 07:26:23 +0000
commit4fb1ecd92358d7ad34cd2f1a60058b04e257e4f0 (patch)
treeb1257828f63c55e17481853c036d96e92f0c7f90
parentd41b688be0a716965692e767849be828680fc830 (diff)
parent029637199175c85b6c75ffd63d145efe0f202974 (diff)
downloadplatform_hardware_qcom_display-security-pi-release.tar.gz
platform_hardware_qcom_display-security-pi-release.tar.bz2
platform_hardware_qcom_display-security-pi-release.zip
Change-Id: I76f343253581eadb11aeea9a37228358e98be8bf
-rw-r--r--msm8996/sdm/libs/hwc2/hwc_display.cpp9
-rw-r--r--msm8996/sdm/libs/hwc2/hwc_display.h5
2 files changed, 9 insertions, 5 deletions
diff --git a/msm8996/sdm/libs/hwc2/hwc_display.cpp b/msm8996/sdm/libs/hwc2/hwc_display.cpp
index 507eff5e..97652d16 100644
--- a/msm8996/sdm/libs/hwc2/hwc_display.cpp
+++ b/msm8996/sdm/libs/hwc2/hwc_display.cpp
@@ -135,7 +135,8 @@ HWC2::Error HWCColorMode::HandleColorModeTransform(android_color_mode_t mode,
// if the mode count is 1, then only native mode is supported, so just apply matrix w/o
// setting mode
- if (color_mode_transform_map_.size() > 1U) {
+ if ((color_mode_transform_map_.size() > 1U && current_color_mode_ != mode) ||
+ (current_color_transform_ != hint)) {
color_mode_transform = color_mode_transform_map_[mode][transform_hint];
DisplayError error = display_intf_->SetColorMode(color_mode_transform);
if (error != kErrorNone) {
@@ -143,7 +144,10 @@ HWC2::Error HWCColorMode::HandleColorModeTransform(android_color_mode_t mode,
// failure to force client composition
return HWC2::Error::Unsupported;
}
+ DLOGI("Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
}
+ current_color_mode_ = mode;
+ current_color_transform_ = hint;
if (use_matrix) {
DisplayError error = display_intf_->SetColorTransform(kColorTransformMatrixCount, matrix);
@@ -154,10 +158,7 @@ HWC2::Error HWCColorMode::HandleColorModeTransform(android_color_mode_t mode,
}
}
- current_color_mode_ = mode;
- current_color_transform_ = hint;
CopyColorTransformMatrix(matrix, color_matrix_);
- DLOGV_IF(kTagQDCM, "Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
return HWC2::Error::None;
}
diff --git a/msm8996/sdm/libs/hwc2/hwc_display.h b/msm8996/sdm/libs/hwc2/hwc_display.h
index 9343209b..b8fef4fe 100644
--- a/msm8996/sdm/libs/hwc2/hwc_display.h
+++ b/msm8996/sdm/libs/hwc2/hwc_display.h
@@ -79,7 +79,10 @@ class HWCColorMode {
android_color_transform_t current_color_transform_ = HAL_COLOR_TRANSFORM_IDENTITY;
typedef std::map<android_color_transform_t, std::string> TransformMap;
std::map<android_color_mode_t, TransformMap> color_mode_transform_map_ = {};
- double color_matrix_[kColorTransformMatrixCount] = {0};
+ double color_matrix_[kColorTransformMatrixCount] = { 1.0, 0.0, 0.0, 0.0, \
+ 0.0, 1.0, 0.0, 0.0, \
+ 0.0, 0.0, 1.0, 0.0, \
+ 0.0, 0.0, 0.0, 1.0 };
};
class HWCDisplay : public DisplayEventHandler {