libqservice: Defer enabling partial update PP turns off
When client prefer to enable PU(partial update) over PP(post
processing), delay enabling PU until PP turns off its
features completely. This change introduces hand shaking flags
between PP and HWC through binder calls. When requested to turn
on PU, we notify PP through the sys_fs node. When PP is done
shutting off it features, it acknowledges back to HWC to actually
turn on PU.
Change-Id: I72008f2313b93497f55c0435367ef62cd772c2c4
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 2d6497e..b130193 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -3012,7 +3012,6 @@
return -1;
}
close(fd);
- sIsPartialUpdateActive = enable;
return 0;
}
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index a83f51f..7752384 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -58,6 +58,8 @@
static void setMaxPipesPerMixer(const uint32_t value);
static int setPartialUpdatePref(hwc_context_t *ctx, bool enable);
static bool getPartialUpdatePref(hwc_context_t *ctx);
+ static void enablePartialUpdate(bool enable)
+ { sIsPartialUpdateActive = enable; };
void setDynRefreshRate(hwc_context_t *ctx, hwc_display_contents_1_t* list);
protected:
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 487ec77..1e55715 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -313,11 +313,25 @@
}
}
-static status_t setPartialUpdatePref(hwc_context_t *ctx, uint32_t enable) {
- ALOGD("%s: enable: %d", __FUNCTION__, enable);
- if(qhwc::MDPComp::setPartialUpdatePref(ctx, (bool)enable) < 0)
- return NO_INIT;
- return NO_ERROR;
+static status_t setPartialUpdateState(hwc_context_t *ctx, uint32_t state) {
+ ALOGD("%s: state: %d", __FUNCTION__, state);
+ switch(state) {
+ case IQService::PREF_PARTIAL_UPDATE:
+ if(qhwc::MDPComp::setPartialUpdatePref(ctx, true) < 0)
+ return NO_INIT;
+ return NO_ERROR;
+ case IQService::PREF_POST_PROCESSING:
+ if(qhwc::MDPComp::setPartialUpdatePref(ctx, false) < 0)
+ return NO_INIT;
+ qhwc::MDPComp::enablePartialUpdate(false);
+ return NO_ERROR;
+ case IQService::ENABLE_PARTIAL_UPDATE:
+ qhwc::MDPComp::enablePartialUpdate(true);
+ return NO_ERROR;
+ default:
+ ALOGE("%s: Invalid state", __FUNCTION__);
+ return NO_ERROR;
+ };
}
static void toggleScreenUpdate(hwc_context_t* ctx, uint32_t on) {
@@ -404,7 +418,7 @@
setMaxPipesPerMixer(mHwcContext, inParcel);
break;
case IQService::SET_PARTIAL_UPDATE:
- ret = setPartialUpdatePref(mHwcContext, inParcel->readInt32());
+ ret = setPartialUpdateState(mHwcContext, inParcel->readInt32());
break;
case IQService::TOGGLE_BWC:
toggleBWC(mHwcContext, inParcel);
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 78cbd2a..c77f5f5 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -82,6 +82,12 @@
};
enum {
+ PREF_PARTIAL_UPDATE,
+ PREF_POST_PROCESSING,
+ ENABLE_PARTIAL_UPDATE,
+ };
+
+ enum {
DUMP_PRIMARY_DISPLAY,
DUMP_HDMI_DISPLAY,
DUMP_VIRTUAL_DISPLAY,