hwc2: Add support for Secure Display

- Support handling secure display in HWC
- Issue NULL commit on primary display when secure display session
  starts and ends.

Change-Id: I95a8caaf1366c1d9384843d382244e1555dd6ad2
This commit is contained in:
Ramakant Singh
2017-09-22 21:26:21 +05:30
committed by Gerrit - the friendly Code Review server
parent 82f1bc5e98
commit 46a1bee9ab

View File

@@ -462,6 +462,7 @@ void HWCDisplay::BuildLayerStack() {
display_rect_ = LayerRect();
metadata_refresh_rate_ = 0;
auto working_primaries = ColorPrimaries_BT709_5;
bool secure_display_active = false;
// Add one layer for fb target
// TODO(user): Add blit target layers
@@ -520,6 +521,10 @@ void HWCDisplay::BuildLayerStack() {
layer_stack_.flags.skip_present = true;
}
if (layer->input_buffer.flags.secure_display) {
secure_display_active = true;
}
if (hwc_layer->GetClientRequestedCompositionType() == HWC2::Composition::Cursor) {
// Currently we support only one HWCursor & only at top most z-order
if ((*layer_set_.rbegin())->GetId() == hwc_layer->GetId()) {
@@ -599,6 +604,8 @@ void HWCDisplay::BuildLayerStack() {
// Must fall back to client composition
MarkLayersForClientComposition();
}
// set secure display
SetSecureDisplay(secure_display_active);
}
void HWCDisplay::BuildSolidFillStack() {
@@ -1844,7 +1851,12 @@ int HWCDisplay::GetVisibleDisplayRect(hwc_rect_t *visible_rect) {
}
void HWCDisplay::SetSecureDisplay(bool secure_display_active) {
if (secure_display_active_ != secure_display_active) {
DLOGI("SecureDisplay state changed from %d to %d Needs Flush!!", secure_display_active_,
secure_display_active);
secure_display_active_ = secure_display_active;
skip_prepare_ = true;
}
return;
}