Merge "sdm: Revalidate layer stack on layer reconfig."

This commit is contained in:
Linux Build Service Account
2017-06-10 02:25:49 -07:00
committed by Gerrit - the friendly Code Review server
3 changed files with 18 additions and 7 deletions

View File

@@ -397,6 +397,7 @@ HWC2::Error HWCDisplay::CreateLayer(hwc2_layer_t *out_layer_id) {
HWCLayer *layer = *layer_set_.emplace(new HWCLayer(id_, buffer_allocator_)); HWCLayer *layer = *layer_set_.emplace(new HWCLayer(id_, buffer_allocator_));
layer_map_.emplace(std::make_pair(layer->GetId(), layer)); layer_map_.emplace(std::make_pair(layer->GetId(), layer));
*out_layer_id = layer->GetId(); *out_layer_id = layer->GetId();
validated_ = false;
geometry_changes_ |= GeometryChanges::kAdded; geometry_changes_ |= GeometryChanges::kAdded;
return HWC2::Error::None; return HWC2::Error::None;
} }
@@ -427,6 +428,7 @@ HWC2::Error HWCDisplay::DestroyLayer(hwc2_layer_t layer_id) {
break; break;
} }
} }
validated_ = false;
geometry_changes_ |= GeometryChanges::kRemoved; geometry_changes_ |= GeometryChanges::kRemoved;
return HWC2::Error::None; return HWC2::Error::None;
@@ -583,6 +585,7 @@ HWC2::Error HWCDisplay::SetLayerZOrder(hwc2_layer_t layer_id, uint32_t z) {
DLOGE("[%" PRIu64 "] updateLayerZ failed to find layer", id_); DLOGE("[%" PRIu64 "] updateLayerZ failed to find layer", id_);
return HWC2::Error::BadLayer; return HWC2::Error::BadLayer;
} }
validated_ = false;
const auto layer = map_layer->second; const auto layer = map_layer->second;
const auto z_range = layer_set_.equal_range(layer); const auto z_range = layer_set_.equal_range(layer);

View File

@@ -137,6 +137,18 @@ class HWCDisplay : public DisplayEventHandler {
virtual int GetDisplayConfigCount(uint32_t *count); virtual int GetDisplayConfigCount(uint32_t *count);
virtual int GetDisplayAttributesForConfig(int config, virtual int GetDisplayAttributesForConfig(int config,
DisplayConfigVariableInfo *display_attributes); DisplayConfigVariableInfo *display_attributes);
template <typename... Args>
int32_t CallLayerFunction(hwc2_layer_t layer, HWC2::Error (HWCLayer::*member)(Args... ),
Args... args) {
auto status = HWC2::Error::BadLayer;
validated_ = false;
auto hwc_layer = GetHWCLayer(layer);
if (hwc_layer != nullptr) {
status = (hwc_layer->*member)(std::forward<Args>(args)...);
}
return INT32(status);
}
int SetPanelBrightness(int level); int SetPanelBrightness(int level);
int GetPanelBrightness(int *level); int GetPanelBrightness(int *level);

View File

@@ -70,15 +70,11 @@ class HWCSession : hwc2_device_t, public qClient::BnQClient {
} }
HWCSession *hwc_session = static_cast<HWCSession *>(device); HWCSession *hwc_session = static_cast<HWCSession *>(device);
auto status = HWC2::Error::BadDisplay; int32_t status = INT32(HWC2::Error::BadDisplay);
if (hwc_session->hwc_display_[display]) { if (hwc_session->hwc_display_[display]) {
status = HWC2::Error::BadLayer; status = hwc_session->hwc_display_[display]->CallLayerFunction(layer, member, args...);
auto hwc_layer = hwc_session->hwc_display_[display]->GetHWCLayer(layer);
if (hwc_layer != nullptr) {
status = (hwc_layer->*member)(std::forward<Args>(args)...);
}
} }
return INT32(status); return status;
} }
// HWC2 Functions that require a concrete implementation in hwc session // HWC2 Functions that require a concrete implementation in hwc session