summaryrefslogtreecommitdiffstats
path: root/include/system
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-10-01 13:48:36 -0700
committerJesse Hall <jessehall@google.com>2012-10-01 14:02:45 -0700
commitbc930eda3985cf50bb568aeb098cd0585d0c0ce0 (patch)
tree71721c7adc080e9a67f69f120e75e78c78bf104f /include/system
parentd6d478058fc201bfc70f353019477e17c71a29d4 (diff)
downloadsystem_core-bc930eda3985cf50bb568aeb098cd0585d0c0ce0.zip
system_core-bc930eda3985cf50bb568aeb098cd0585d0c0ce0.tar.gz
system_core-bc930eda3985cf50bb568aeb098cd0585d0c0ce0.tar.bz2
Move dequeue-buffer-and-wait out-of-line
The dequeueBuffer_DEPRECATED function also waits for the buffer fence, so we can just call that. That way the wait call is compiled into our code (instead of driver code) and we can see/modify it for debugging. Bug: 7217641 Change-Id: Ie2ea85ed1543a4ff7986d0162aee773e93591309
Diffstat (limited to 'include/system')
-rw-r--r--include/system/window.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/include/system/window.h b/include/system/window.h
index 1c168db..4698fb3 100644
--- a/include/system/window.h
+++ b/include/system/window.h
@@ -18,6 +18,7 @@
#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
#include <cutils/native_handle.h>
+#include <errno.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -824,17 +825,7 @@ static inline int native_window_api_disconnect(
*/
static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw,
struct ANativeWindowBuffer** anb) {
- int fenceFd = -1;
- int err = anw->dequeueBuffer(anw, anb, &fenceFd);
- if (err == 0 && fenceFd != -1) {
- err = sync_wait(fenceFd, UINT_MAX);
- close(fenceFd);
- if (err != 0) {
- anw->cancelBuffer(anw, *anb, -1);
- *anb = NULL;
- }
- }
- return err;
+ return anw->dequeueBuffer_DEPRECATED(anw, anb);
}