summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_session.cpp
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-11-27 23:19:35 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-11-27 23:19:34 -0800
commit6224abf6c25da8d39516f66b95c9cd70640c656f (patch)
treeba10970091ef72993ea95619000c53a6660974c4 /sdm/libs/hwc2/hwc_session.cpp
parent7dfb43146279dbdfd305318d4f002595eae13be3 (diff)
parentf2c4e4d505ce2682e2a4bef595aa8af83a232502 (diff)
Merge "sdm: hwc2 : Correcting the display Index handling"
Diffstat (limited to 'sdm/libs/hwc2/hwc_session.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_session.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 5286873d..790e7eb0 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -2398,8 +2398,8 @@ void HWCSession::UEventHandler(const char *uevent_data, int length) {
DLOGI("Uevent = %s, status = %s, MST_HOTPLUG = %s, bpp = %d, pattern = %d", uevent_data,
str_status ? str_status : "NULL", str_mst ? str_mst : "NULL", hpd_bpp_, hpd_pattern_);
- hwc2_display_t virtual_display_index =
- (hwc2_display_t)GetDisplayIndex(qdutils::DISPLAY_VIRTUAL);
+ int virtual_display_index =
+ GetDisplayIndex(qdutils::DISPLAY_VIRTUAL);
std::bitset<kSecureMax> secure_sessions = 0;
hwc2_display_t active_builtin_disp_id = GetActiveBuiltinDisplay();
@@ -2407,7 +2407,8 @@ void HWCSession::UEventHandler(const char *uevent_data, int length) {
Locker::ScopeLock lock_a(locker_[active_builtin_disp_id]);
hwc_display_[active_builtin_disp_id]->GetActiveSecureSession(&secure_sessions);
}
- if (secure_sessions[kSecureDisplay] || hwc_display_[virtual_display_index]) {
+ if (secure_sessions[kSecureDisplay] ||
+ ((virtual_display_index != -1) && (hwc_display_[virtual_display_index]))) {
// Defer hotplug handling.
SCOPE_LOCK(pluggable_handler_lock_);
DLOGI("Marking hotplug pending...");
@@ -3144,8 +3145,9 @@ void HWCSession::HandleHotplugPending(hwc2_display_t disp_id, int retire_fence)
}
}
// Handle connect/disconnect hotplugs if secure session is not present.
- hwc2_display_t virtual_display_idx = (hwc2_display_t)GetDisplayIndex(qdutils::DISPLAY_VIRTUAL);
- if (!hwc_display_[virtual_display_idx] && kHotPlugEvent == hotplug_pending_event_) {
+ int virtual_display_idx = GetDisplayIndex(qdutils::DISPLAY_VIRTUAL);
+ if (!(virtual_display_idx != -1 && hwc_display_[virtual_display_idx]) &&
+ kHotPlugEvent == hotplug_pending_event_) {
// Handle deferred hotplug event.
int32_t err = pluggable_handler_lock_.TryLock();
if (!err) {