summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-06-06 07:22:38 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-06 07:22:38 +0000
commiteab0364c085db01ce4b3c28539ef876a48fd17b0 (patch)
tree1e458006da3a66ad44ceceb4fed69443dfbca360
parent2b92b2b5bebdfadf3116481c8eda01c845cf1b3e (diff)
parent308d390720d0627de06a82e590b9e0359fea2b0a (diff)
downloadplatform_hardware_interfaces-eab0364c085db01ce4b3c28539ef876a48fd17b0.tar.gz
platform_hardware_interfaces-eab0364c085db01ce4b3c28539ef876a48fd17b0.tar.bz2
platform_hardware_interfaces-eab0364c085db01ce4b3c28539ef876a48fd17b0.zip
Snap for 4824048 from 308d390720d0627de06a82e590b9e0359fea2b0a to pi-release
Change-Id: I284781eb8db90eb26af8cc663d8a6b3e07b77651
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h36
-rw-r--r--graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp24
2 files changed, 28 insertions, 32 deletions
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 4ae94c0011..eb9d6605cf 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -32,6 +32,8 @@ namespace impl {
constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE;
constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ;
constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT;
+constexpr int DOOR_1_LEFT = (int)VehicleAreaDoor::ROW_1_LEFT;
+constexpr int DOOR_1_RIGHT = (int)VehicleAreaDoor::ROW_1_RIGHT;
constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME;
constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME;
constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO;
@@ -440,13 +442,13 @@ const ConfigDeclaration kVehicleProperties[]{
},
},
- {.config =
- {
- .prop = toInt(VehicleProperty::DOOR_LOCK),
- .access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- },
- .initialValue = {.int32Values = {1}}},
+ {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT},
+ VehicleAreaConfig{.areaId = DOOR_1_RIGHT}}},
+ .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}},
+ {DOOR_1_RIGHT, {.int32Values = {1}}}}},
{.config =
{
@@ -459,23 +461,15 @@ const ConfigDeclaration kVehicleProperties[]{
},
.initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}},
- {
- .config =
- {
- .prop = ABS_ACTIVE,
+ {.config = {.prop = ABS_ACTIVE,
.access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- },
- },
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
+ .initialValue = {.int32Values = {0}}},
- {
- .config =
- {
- .prop = TRACTION_CONTROL_ACTIVE,
+ {.config = {.prop = TRACTION_CONTROL_ACTIVE,
.access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- },
- },
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE},
+ .initialValue = {.int32Values = {0}}},
{.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ),
.access = VehiclePropertyAccess::READ,
diff --git a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
index 77f06bbbe7..6551a99a40 100644
--- a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
+++ b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp
@@ -858,18 +858,20 @@ Error HWC2On1Adapter::Display::setColorMode(android_color_mode_t mode) {
return Error::Unsupported;
}
- uint32_t hwc1Config = 0;
- auto error = mActiveConfig->getHwc1IdForColorMode(mode, &hwc1Config);
- if (error != Error::None) {
- return error;
- }
+ if (mDevice.mHwc1MinorVersion >= 4) {
+ uint32_t hwc1Config = 0;
+ auto error = mActiveConfig->getHwc1IdForColorMode(mode, &hwc1Config);
+ if (error != Error::None) {
+ return error;
+ }
- ALOGV("[%" PRIu64 "] Setting HWC1 config %u", mId, hwc1Config);
- int intError = mDevice.mHwc1Device->setActiveConfig(mDevice.mHwc1Device,
- mHwc1Id, hwc1Config);
- if (intError != 0) {
- ALOGE("[%" PRIu64 "] Failed to set HWC1 config (%d)", mId, intError);
- return Error::Unsupported;
+ ALOGV("[%" PRIu64 "] Setting HWC1 config %u", mId, hwc1Config);
+ int intError =
+ mDevice.mHwc1Device->setActiveConfig(mDevice.mHwc1Device, mHwc1Id, hwc1Config);
+ if (intError != 0) {
+ ALOGE("[%" PRIu64 "] Failed to set HWC1 config (%d)", mId, intError);
+ return Error::Unsupported;
+ }
}
mActiveColorMode = mode;