Skip to content

Commit

Permalink
hwc2: Fix deadlock during bootup
Browse files Browse the repository at this point in the history
Deadlock may occur between callbacks_lock_ 
and locker_ while setting camera status.
Limit the scope of callback_lock_.

CRs-Fixed: 2233896
Change-Id: I8932a6a3614b3daf591389a06eca7b2dd91d38b5
  • Loading branch information
Ramakant Singh authored and Gerrit - the friendly Code Review server committed Jun 12, 2018
1 parent acdd208 commit 4e413e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdm/libs/hwc2/hwc_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,14 @@ int32_t HWCSession::RegisterCallback(hwc2_device_t *device, int32_t descriptor,
SCOPE_LOCK(hwc_session->callbacks_lock_);
auto desc = static_cast<HWC2::Callback>(descriptor);
auto error = hwc_session->callbacks_.Register(desc, callback_data, pointer);
hwc_session->callbacks_lock_.Broadcast();
DLOGD("Registering callback: %s", to_string(desc).c_str());
if (descriptor == HWC2_CALLBACK_HOTPLUG) {
if (hwc_session->hwc_display_[HWC_DISPLAY_PRIMARY]) {
hwc_session->callbacks_.Hotplug(HWC_DISPLAY_PRIMARY, HWC2::Connection::Connected);
}
}
hwc_session->need_invalidate_ = false;
hwc_session->callbacks_lock_.Broadcast();
return INT32(error);
}

Expand Down

0 comments on commit 4e413e7

Please sign in to comment.