diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 95be7cc..880becf 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -92,7 +92,14 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) if(ctx->mExtDisplay->getExternalDisplay()) ovutils::setExtType(ctx->mExtDisplay->getExternalDisplay()); - + if (ctx->hdmi_pending == true) { + if ((qdutils::MDPVersion::getInstance().getMDPVersion() >= + qdutils::MDP_V4_2) || (ctx->mOverlay->getState() != + ovutils::OV_BYPASS_3_LAYER)) { + ctx->mExtDisplay->processUEventOnline((const char*)ctx->mHDMIEvent); + ctx->hdmi_pending = false; + } + } if (LIKELY(list)) { //reset for this draw round VideoOverlay::reset(); @@ -128,7 +135,6 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) qdutils::CBUtils::checkforGPULayer(list); } - return 0; } diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 191c099..6dc0a0f 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -353,7 +353,7 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list) { } //Disable MDPComp when ext display connected - if(ctx->mExtDisplay->getExternalDisplay()) { + if(ctx->mExtDisplay->getExternalDisplay()|| (ctx->hdmi_pending == true)) { ALOGD_IF(isDebug(), "%s: External display connected.", __FUNCTION__); return false; } diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp index 2ebc8f2..f9ac0f2 100644 --- a/libhwcomposer/hwc_uevents.cpp +++ b/libhwcomposer/hwc_uevents.cpp @@ -50,8 +50,17 @@ static void handle_uevent(hwc_context_t* ctx, const char* udata, int len) // for now just parsing onlin/offline info is enough str = udata; if(!(strncmp(str,"online@",strlen("online@")))) { - ctx->mExtDisplay->processUEventOnline(str); + strncpy(ctx->mHDMIEvent,str,strlen(str)); + ctx->hdmi_pending = true; + //Invalidate + hwc_procs* proc = (hwc_procs*)ctx->device.reserved_proc[0]; + if(!proc) { + ALOGE("%s: HWC proc not registered", __FUNCTION__); + } else { + proc->invalidate(proc); + } } else if(!(strncmp(str,"offline@",strlen("offline@")))) { + ctx->hdmi_pending = false; ctx->mExtDisplay->processUEventOffline(str); } } diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp index eaaf9d3..82b6ab5 100644 --- a/libhwcomposer/hwc_utils.cpp +++ b/libhwcomposer/hwc_utils.cpp @@ -70,6 +70,8 @@ void initContext(hwc_context_t *ctx) pthread_cond_init(&(ctx->vstate.cond), NULL); ctx->vstate.enable = false; + ctx->hdmi_pending = false; + ALOGI("Initializing Qualcomm Hardware Composer"); ALOGI("MDP version: %d", ctx->mMDP.version); ALOGI("DYN composition threshold : %f", ctx->dynThreshold); diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index b3a9600..683fc1b 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -180,6 +180,8 @@ struct hwc_context_t { // flag that indicate whether secure/desecure session in progress bool mSecureConfig; + bool hdmi_pending; + char mHDMIEvent[512]; }; #endif //HWC_UTILS_H