summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andy McFadden <fadden@android.com> 2012-10-19 16:14:34 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2012-10-19 16:14:34 -0700
commit44c985ef7d0b6d94fa9df3fd5ea718eca0ecdbd1 (patch)
tree382c0ee6f4f4714288b59d0d0fb33eb25b97b527
parentf58475b5ae4ccb3a31c05c79da8b2914c62a3510 (diff)
parent620685c2e684082c82657732d1e35cefd0c79006 (diff)
am 620685c2: Fix emulator vsync
* commit '620685c2e684082c82657732d1e35cefd0c79006': Fix emulator vsync
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index d9bda11fce..31d731eae3 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -128,6 +128,11 @@ HWComposer::HWComposer(
abort();
}
+ // these display IDs are always reserved
+ for (size_t i=0 ; i<HWC_NUM_DISPLAY_TYPES ; i++) {
+ mAllocatedDisplayIDs.markBit(i);
+ }
+
if (mHwc) {
ALOGI("Using %s version %u.%u", HWC_HARDWARE_COMPOSER,
(hwcApiVersion(mHwc) >> 24) & 0xff,
@@ -149,11 +154,6 @@ HWComposer::HWComposer(
// always turn vsync off when we start
eventControl(HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, 0);
- // these IDs are always reserved
- for (size_t i=0 ; i<HWC_NUM_DISPLAY_TYPES ; i++) {
- mAllocatedDisplayIDs.markBit(i);
- }
-
// the number of displays we actually have depends on the
// hw composer version
if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_2)) {
@@ -445,6 +445,13 @@ bool HWComposer::isConnected(int disp) const {
void HWComposer::eventControl(int disp, int event, int enabled) {
if (uint32_t(disp)>31 || !mAllocatedDisplayIDs.hasBit(disp)) {
+ ALOGD("eventControl ignoring event %d on unallocated disp %d (en=%d)",
+ event, disp, enabled);
+ return;
+ }
+ if (event != EVENT_VSYNC) {
+ ALOGW("eventControl got unexpected event %d (disp=%d en=%d)",
+ event, disp, enabled);
return;
}
status_t err = NO_ERROR;