diff options
| author | dianlujitao <dianlujitao@lineageos.org> | 2018-04-27 15:59:31 +0800 |
|---|---|---|
| committer | dianlujitao <dianlujitao@lineageos.org> | 2018-04-29 16:48:10 +0800 |
| commit | 0d4047986344baf520cc9d5ea3ab5c4c2cff622b (patch) | |
| tree | 3ac4b5b7b67fb6cc1a9b238e26d361ef22e66f99 | |
| parent | 95096b06d433ea908e114c602258b13288d29307 (diff) | |
| download | android_hardware_lineage_interfaces-0d4047986344baf520cc9d5ea3ab5c4c2cff622b.tar.gz android_hardware_lineage_interfaces-0d4047986344baf520cc9d5ea3ab5c4c2cff622b.tar.bz2 android_hardware_lineage_interfaces-0d4047986344baf520cc9d5ea3ab5c4c2cff622b.zip | |
livedisplay: SDM: Don't advertise color balance support
* Currently color balance is used for adjusting color temperature if
it's supported, but QDCM color balance and display mode override each
other. Obviously we should take good care of display modes.
* Disable color balance so color temperature will pick color calibration
as backend, which doesn't conflict with display modes.
Change-Id: I19b0863fe2273d12763b0359687128709b1b608c
| -rw-r--r-- | livedisplay/1.0/default/impl/SDM.cpp | 39 | ||||
| -rw-r--r-- | livedisplay/1.0/default/include/impl/SDM.h | 12 |
2 files changed, 11 insertions, 40 deletions
diff --git a/livedisplay/1.0/default/impl/SDM.cpp b/livedisplay/1.0/default/impl/SDM.cpp index 61c8a31..ab50c90 100644 --- a/livedisplay/1.0/default/impl/SDM.cpp +++ b/livedisplay/1.0/default/impl/SDM.cpp @@ -27,7 +27,6 @@ #define DPPS_BUF_SIZE 64 #define FEATURE_VER_SW_PA_API 0x00000001 -#define FEATURE_VER_SW_COLORBAL_API 0x00000003 #define FEATURE_VER_SW_SAVEMODES_API 0x00000004 #define FOSS_ON "foss:on" @@ -286,9 +285,6 @@ bool SDM::hasFeature(Feature feature) { case Feature::DISPLAY_MODES: id = FEATURE_VER_SW_SAVEMODES_API; break; - case Feature::COLOR_BALANCE: - id = FEATURE_VER_SW_COLORBAL_API; - break; case Feature::PICTURE_ADJUSTMENT: id = FEATURE_VER_SW_PA_API; break; @@ -309,19 +305,8 @@ bool SDM::hasFeature(Feature feature) { return false; } - // Color balance depends on calibration data in SDM - if (feature == Feature::DISPLAY_MODES || feature == Feature::COLOR_BALANCE) { - if (getNumDisplayModes() > 0) { - // make sure the range isn't zero - if (feature == Feature::COLOR_BALANCE) { - Range r; - if (getColorBalanceRange(r) == OK && isNonZero(r)) { - return true; - } - return false; - } - return true; - } + if (feature == Feature::DISPLAY_MODES) { + return getNumDisplayModes() > 0; } else if (feature == Feature::PICTURE_ADJUSTMENT) { HSICRanges r; if (getPictureAdjustmentRanges(r) == OK && r.isValid()) { @@ -346,13 +331,6 @@ status_t SDM::saveInitialDisplayMode() { return OK; } -status_t SDM::getColorBalanceRange(Range& range) { - status_t rc = SDMController::getInstance().get_global_color_balance_range(mHandle, 0, &range); - LOG(VERBOSE) << "getColorBalanceRange: min=" << range.min << " max=" << range.max - << " step=" << range.step; - return rc; -} - status_t SDM::getPictureAdjustment(HSIC& hsic) { uint32_t enable = 0; hsic_config config; @@ -453,19 +431,6 @@ bool SDM::isAdaptiveBacklightEnabled() { return mCachedFOSSStatus; } -int32_t SDM::getColorBalance() { - int32_t value = -1; - uint32_t flags = 0; - if (SDMController::getInstance().get_global_color_balance(mHandle, 0, &value, &flags) != 0) { - value = 0; - } - return value; -} - -status_t SDM::setColorBalance(int32_t balance) { - return SDMController::getInstance().set_global_color_balance(mHandle, 0, balance, 0); -} - status_t SDM::setPictureAdjustment(const HSIC& hsic) { hsic_config config; memset(&config, 0, sizeof(struct hsic_config)); diff --git a/livedisplay/1.0/default/include/impl/SDM.h b/livedisplay/1.0/default/include/impl/SDM.h index cb419e2..469aab3 100644 --- a/livedisplay/1.0/default/include/impl/SDM.h +++ b/livedisplay/1.0/default/include/impl/SDM.h @@ -75,9 +75,15 @@ class SDM : public ColorBackend { return false; } - virtual status_t getColorBalanceRange(Range& range) override; - virtual int32_t getColorBalance() override; - virtual status_t setColorBalance(int32_t balance) override; + virtual status_t getColorBalanceRange(Range& /* range */) override { + return NO_INIT; + } + virtual int32_t getColorBalance() override { + return 0; + } + virtual status_t setColorBalance(int32_t /* balance */) override { + return NO_INIT; + } virtual status_t getPictureAdjustmentRanges(HSICRanges& ranges) override; virtual status_t setPictureAdjustment(const HSIC& hsic) override; |
