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

Commit e5254d1f authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "[ANativeWindow] Add stub for ANativeWindow_setDequeueTimeout"

parents f6d07ae9 04fdb60d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1084,6 +1084,9 @@ int Surface::perform(int operation, va_list args)
    case NATIVE_WINDOW_GET_LAST_DEQUEUE_START:
        res = dispatchGetLastDequeueStartTime(args);
        break;
    case NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT:
        res = dispatchSetDequeueTimeout(args);
        break;
    default:
        res = NAME_NOT_FOUND;
        break;
@@ -1295,6 +1298,11 @@ int Surface::dispatchGetLastDequeueStartTime(va_list args) {
    return NO_ERROR;
}

int Surface::dispatchSetDequeueTimeout(va_list args) {
    nsecs_t timeout = va_arg(args, int64_t);
    return setDequeueTimeout(timeout);
}

bool Surface::transformToDisplayInverse() {
    return (mTransform & NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY) ==
            NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY;
+1 −0
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ private:
    int dispatchGetConsumerUsage64(va_list args);
    int dispatchSetAutoPrerotation(va_list args);
    int dispatchGetLastDequeueStartTime(va_list args);
    int dispatchSetDequeueTimeout(va_list args);
    bool transformToDisplayInverse();

protected:
+4 −0
Original line number Diff line number Diff line
@@ -284,3 +284,7 @@ int64_t ANativeWindow_getLastDequeueStartTime(ANativeWindow* window) {
    int success = window->perform(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_START, &time);
    return success < 0 ? success : time;
}

int ANativeWindow_setDequeueTimeout(ANativeWindow* window, int64_t timeout) {
    return window->perform(window, NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT, timeout);
}
+9 −0
Original line number Diff line number Diff line
@@ -48,4 +48,13 @@ int ANativeWindow_getLastQueueDuration(ANativeWindow* window);
 */
int64_t ANativeWindow_getLastDequeueStartTime(ANativeWindow* window);

/**
 * Sets a timeout in nanoseconds for dequeue calls. All subsequent dequeue calls
 * made by the window will return -ETIMEDOUT after the timeout if the dequeue
 * takes too long.
 *
 * \return NO_ERROR on succes, -errno on error.
 */
int ANativeWindow_setDequeueTimeout(ANativeWindow* window, int64_t timeout);

__END_DECLS
+1 −0
Original line number Diff line number Diff line
@@ -240,6 +240,7 @@ enum {
    NATIVE_WINDOW_SET_BUFFERS_HDR10_PLUS_METADATA = 34,
    NATIVE_WINDOW_SET_AUTO_PREROTATION            = 35,
    NATIVE_WINDOW_GET_LAST_DEQUEUE_START          = 36,    /* private */
    NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT             = 37,    /* private */
    // clang-format on
};

Loading