Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc930eda authored by Jesse Hall's avatar Jesse Hall
Browse files

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
parent d6d47805
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -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);
}