hwc2: Update secure display layer on active built in display
1. Add support to handle secure display layer on secondary display
2. Update secure display layer on active builtin display.
3. Add display config API to get the display attributes of the active
builtin display.
Change-Id: Ia70dff316265c9364b060fe4fae591a9599e16e9
CRs-Fixed: 2375587
diff --git a/sdm/libs/hwc2/hwc_display_builtin.cpp b/sdm/libs/hwc2/hwc_display_builtin.cpp
index 4007754..7a8f262 100644
--- a/sdm/libs/hwc2/hwc_display_builtin.cpp
+++ b/sdm/libs/hwc2/hwc_display_builtin.cpp
@@ -287,7 +287,7 @@
DLOGE("failed for mode = %d intent = %d", mode, intent);
return status;
}
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
validated_ = false;
return status;
}
@@ -299,7 +299,7 @@
return status;
}
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
validated_ = false;
return status;
@@ -331,7 +331,7 @@
return status;
}
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
return status;
}
@@ -349,7 +349,7 @@
return status;
}
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
color_tranform_failed_ = false;
validated_ = false;
@@ -459,7 +459,7 @@
if (error)
return HWC2::Error::BadConfig;
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
return HWC2::Error::None;
}
@@ -560,6 +560,10 @@
return -EINVAL;
}
+ if (current_power_mode_ != HWC2::PowerMode::On) {
+ return 0;
+ }
+
if (active_secure_sessions_[kSecureDisplay] != secure_sessions[kSecureDisplay]) {
SecureEvent secure_event =
secure_sessions.test(kSecureDisplay) ? kSecureDisplayStart : kSecureDisplayEnd;
@@ -587,7 +591,7 @@
force_refresh_rate_ = refresh_rate;
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
return;
}
@@ -605,7 +609,7 @@
DisplayError HWCDisplayBuiltIn::Refresh() {
DisplayError error = kErrorNone;
- callbacks_->Refresh(HWC_DISPLAY_PRIMARY);
+ callbacks_->Refresh(id_);
return error;
}