summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-12-16 01:42:58 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-12-16 01:42:58 -0800
commit69574c0ce85635860c1529f397bff20c13fb77cb (patch)
tree9edef64f56a7a32191b6dbc21b3fdd6af655b7d2
parentdc2bcc776b532e16827c949cf99fae3c02e0142d (diff)
parent78951b2ae6dd312f6770fe28f2e15c6b858198c0 (diff)
downloaddisplay-69574c0ce85635860c1529f397bff20c13fb77cb.tar.gz
Merge "hwc: Add binder API to disable screen updates"
-rw-r--r--libhwcomposer/hwc.cpp6
-rw-r--r--libhwcomposer/hwc_qclient.cpp20
-rw-r--r--libhwcomposer/hwc_utils.h2
-rw-r--r--libqservice/IQService.h1
-rw-r--r--libqservice/QServiceUtils.h4
5 files changed, 30 insertions, 3 deletions
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 22b576ee..2bf421fc 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -257,7 +257,8 @@ static int hwc_prepare_primary(hwc_composer_device_1 *dev,
bool fbComp = false;
if (LIKELY(list && list->numHwLayers > 1) &&
(ctx->dpyAttr[dpy].isActive ||
- ctx->mHDMIDisplay->isHDMIPrimaryDisplay())) {
+ ctx->mHDMIDisplay->isHDMIPrimaryDisplay())
+ && !ctx->dpyAttr[dpy].isPause) {
// When HDMI is primary we should rely on the first valid
// draw call in order to activate the display
@@ -586,7 +587,8 @@ static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
ATRACE_CALL();
int ret = 0;
const int dpy = HWC_DISPLAY_PRIMARY;
- if (LIKELY(list) && ctx->dpyAttr[dpy].isActive) {
+ if (LIKELY(list) && ctx->dpyAttr[dpy].isActive
+ && !ctx->dpyAttr[dpy].isPause) {
size_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
int fd = -1; //FenceFD from the Copybit(valid in async mode)
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index add5dc83..1a29b894 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -313,6 +313,23 @@ static status_t setPartialUpdatePref(hwc_context_t *ctx, uint32_t enable) {
return NO_ERROR;
}
+static void toggleScreenUpdate(hwc_context_t* ctx, uint32_t on) {
+ ALOGD("%s: toggle update: %d", __FUNCTION__, on);
+ Locker::Autolock _sl(ctx->mDrawLock);
+ if (on == 0) {
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isPause = true;
+ ctx->mOverlay->configBegin();
+ ctx->mOverlay->configDone();
+ ctx->mRotMgr->clear();
+ if(!Overlay::displayCommit(ctx->dpyAttr[0].fd)) {
+ ALOGE("%s: Display commit failed", __FUNCTION__);
+ }
+ } else {
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isPause = false;
+ ctx->proc->invalidate(ctx->proc);
+ }
+}
+
status_t QClient::notifyCallback(uint32_t command, const Parcel* inParcel,
Parcel* outParcel) {
status_t ret = NO_ERROR;
@@ -369,6 +386,9 @@ status_t QClient::notifyCallback(uint32_t command, const Parcel* inParcel,
case IQService::CONFIGURE_DYN_REFRESH_RATE:
configureDynRefreshRate(mHwcContext, inParcel);
break;
+ case IQService::TOGGLE_SCREEN_UPDATE:
+ toggleScreenUpdate(mHwcContext, inParcel->readInt32());
+ break;
default:
ret = NO_ERROR;
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 29c0cc92..18de0827 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -96,7 +96,7 @@ struct DisplayAttributes {
//It should be active also. (UNBLANKED)
bool isActive;
// In pause state, composition is bypassed
- // used for WFD displays only
+ // used for WFD displays and in QDCM calibration mode
bool isPause;
// To trigger padding round to clean up mdp
// pipes
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index f28293db..ef47475d 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -58,6 +58,7 @@ public:
/* Enable/Disable/Set refresh rate dynamically */
CONFIGURE_DYN_REFRESH_RATE = 18,
SET_PARTIAL_UPDATE = 19, // Preference on partial update feature
+ TOGGLE_SCREEN_UPDATE = 20, // Provides ability to disable screen updates
COMMAND_LIST_END = 400,
};
diff --git a/libqservice/QServiceUtils.h b/libqservice/QServiceUtils.h
index 5b61c8e2..71277e8b 100644
--- a/libqservice/QServiceUtils.h
+++ b/libqservice/QServiceUtils.h
@@ -74,6 +74,10 @@ inline android::status_t screenRefresh() {
return sendSingleParam(qService::IQService::SCREEN_REFRESH, 1);
}
+inline android::status_t toggleScreenUpdate(uint32_t on) {
+ return sendSingleParam(qService::IQService::TOGGLE_SCREEN_UPDATE, on);
+}
+
inline android::status_t setPartialUpdate(uint32_t enable) {
return sendSingleParam(qService::IQService::SET_PARTIAL_UPDATE, enable);
}