sdm: Fix refresh seqeunce for QDCM solid fill color

Calibration tool issues binder call to display solid fill color onto
screen for calibration. Acquire scope lock to ensure that there is no
race condition between binder thread and display thread w.r.t solid fill
color. Block the solid fill binder call with a delay to ensure that
solid fill color is displayed.

Change-Id: Ic0ee320e24dc662213531362b124ff7bbfdf4309
This commit is contained in:
Gopikrishnaiah Anandan
2018-01-16 15:37:15 -08:00
committed by Gerrit - the friendly Code Review server
parent 58d0e0f083
commit 12ecb0dc80

View File

@@ -72,6 +72,7 @@ namespace sdm {
static HWCUEvent g_hwc_uevent_;
Locker HWCSession::locker_[HWC_NUM_DISPLAY_TYPES];
static const int kSolidFillDelay = 100 * 1000;
void HWCUEvent::UEventThread(HWCUEvent *hwc_uevent) {
const char *uevent_thread_name = "HWC_UeventThread";
@@ -1530,14 +1531,22 @@ android::status_t HWCSession::QdcmCMDHandler(const android::Parcel *input_parcel
ret = color_mgr_->EnableQDCMMode(false, hwc_display_[HWC_DISPLAY_PRIMARY]);
break;
case kApplySolidFill:
ret = color_mgr_->SetSolidFill(pending_action.params,
{
SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);
ret = color_mgr_->SetSolidFill(pending_action.params,
true, hwc_display_[HWC_DISPLAY_PRIMARY]);
}
Refresh(HWC_DISPLAY_PRIMARY);
usleep(kSolidFillDelay);
break;
case kDisableSolidFill:
ret = color_mgr_->SetSolidFill(pending_action.params,
{
SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);
ret = color_mgr_->SetSolidFill(pending_action.params,
false, hwc_display_[HWC_DISPLAY_PRIMARY]);
}
Refresh(HWC_DISPLAY_PRIMARY);
usleep(kSolidFillDelay);
break;
case kSetPanelBrightness:
brightness_value = reinterpret_cast<int32_t *>(resp_payload.payload);