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

Commit 5c59c452 authored by Brian C. Anderson's avatar Brian C. Anderson Committed by Android (Google) Code Review
Browse files

Merge "Rename posted to requestedPresent for getFrameTimestamps"

parents 552ef6fa dbd0ea80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ namespace android {
struct FrameTimestamps : public LightFlattenablePod<FrameTimestamps> {
    FrameTimestamps() :
        frameNumber(0),
        postedTime(0),
        requestedPresentTime(0),
        acquireTime(0),
        refreshStartTime(0),
        glCompositionDoneTime(0),
@@ -33,7 +33,7 @@ struct FrameTimestamps : public LightFlattenablePod<FrameTimestamps> {
        releaseTime(0) {}

    uint64_t frameNumber;
    nsecs_t postedTime;
    nsecs_t requestedPresentTime;
    nsecs_t acquireTime;
    nsecs_t refreshStartTime;
    nsecs_t glCompositionDoneTime;
+4 −4
Original line number Diff line number Diff line
@@ -135,10 +135,10 @@ public:
            sp<Fence>* outFence, float outTransformMatrix[16]);

    // See IGraphicBufferProducer::getFrameTimestamps
    bool getFrameTimestamps(uint64_t frameNumber, nsecs_t* outPostedTime,
            nsecs_t* outAcquireTime, nsecs_t* outRefreshStartTime,
            nsecs_t* outGlCompositionDoneTime, nsecs_t* outDisplayRetireTime,
            nsecs_t* outReleaseTime);
    bool getFrameTimestamps(uint64_t frameNumber,
            nsecs_t* outRequestedPresentTime, nsecs_t* outAcquireTime,
            nsecs_t* outRefreshStartTime, nsecs_t* outGlCompositionDoneTime,
            nsecs_t* outDisplayRetireTime, nsecs_t* outReleaseTime);

    status_t getUniqueId(uint64_t* outId) const;

+8 −8
Original line number Diff line number Diff line
@@ -135,18 +135,18 @@ status_t Surface::getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer,
            outTransformMatrix);
}

bool Surface::getFrameTimestamps(uint64_t frameNumber, nsecs_t* outPostedTime,
        nsecs_t* outAcquireTime, nsecs_t* outRefreshStartTime,
        nsecs_t* outGlCompositionDoneTime, nsecs_t* outDisplayRetireTime,
        nsecs_t* outReleaseTime) {
bool Surface::getFrameTimestamps(uint64_t frameNumber,
        nsecs_t* outRequestedPresentTime, nsecs_t* outAcquireTime,
        nsecs_t* outRefreshStartTime, nsecs_t* outGlCompositionDoneTime,
        nsecs_t* outDisplayRetireTime, nsecs_t* outReleaseTime) {
    ATRACE_CALL();

    FrameTimestamps timestamps;
    bool found = mGraphicBufferProducer->getFrameTimestamps(frameNumber,
            &timestamps);
    if (found) {
        if (outPostedTime) {
            *outPostedTime = timestamps.postedTime;
        if (outRequestedPresentTime) {
            *outRequestedPresentTime = timestamps.requestedPresentTime;
        }
        if (outAcquireTime) {
            *outAcquireTime = timestamps.acquireTime;
@@ -795,14 +795,14 @@ int Surface::dispatchSetAutoRefresh(va_list args) {

int Surface::dispatchGetFrameTimestamps(va_list args) {
    uint32_t framesAgo = va_arg(args, uint32_t);
    nsecs_t* outPostedTime = va_arg(args, int64_t*);
    nsecs_t* outRequestedPresentTime = va_arg(args, int64_t*);
    nsecs_t* outAcquireTime = va_arg(args, int64_t*);
    nsecs_t* outRefreshStartTime = va_arg(args, int64_t*);
    nsecs_t* outGlCompositionDoneTime = va_arg(args, int64_t*);
    nsecs_t* outDisplayRetireTime = va_arg(args, int64_t*);
    nsecs_t* outReleaseTime = va_arg(args, int64_t*);
    bool ret = getFrameTimestamps(getNextFrameNumber() - 1 - framesAgo,
            outPostedTime, outAcquireTime, outRefreshStartTime,
            outRequestedPresentTime, outAcquireTime, outRefreshStartTime,
            outGlCompositionDoneTime, outDisplayRetireTime, outReleaseTime);
    return ret ? NO_ERROR : BAD_VALUE;
}
+1 −1
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLCREATENATIVECLIENTBUFFERANDROID) (co
#ifndef EGL_ANDROID_get_frame_timestamps
#define EGL_ANDROID_get_frame_timestamps 1
#define EGL_TIMESTAMPS_ANDROID 0x314D
#define EGL_QUEUE_TIME_ANDROID 0x314E
#define EGL_REQUESTED_PRESENT_TIME_ANDROID 0x314E
#define EGL_RENDERING_COMPLETE_TIME_ANDROID 0x314F
#define EGL_COMPOSITION_START_TIME_ANDROID 0x3430
#define EGL_COMPOSITION_FINISHED_TIME_ANDROID 0x3431
+6 −6
Original line number Diff line number Diff line
@@ -2038,7 +2038,7 @@ EGLBoolean eglGetFrameTimestampsANDROID(EGLDisplay dpy, EGLSurface surface,
        return EGL_FALSE;
    }

    nsecs_t* postedTime = nullptr;
    nsecs_t* requestedPresentTime = nullptr;
    nsecs_t* acquireTime = nullptr;
    nsecs_t* refreshStartTime = nullptr;
    nsecs_t* GLCompositionDoneTime = nullptr;
@@ -2047,8 +2047,8 @@ EGLBoolean eglGetFrameTimestampsANDROID(EGLDisplay dpy, EGLSurface surface,

    for (int i = 0; i < numTimestamps; i++) {
        switch (timestamps[i]) {
            case EGL_QUEUE_TIME_ANDROID:
                postedTime = &values[i];
            case EGL_REQUESTED_PRESENT_TIME_ANDROID:
                requestedPresentTime = &values[i];
                break;
            case EGL_RENDERING_COMPLETE_TIME_ANDROID:
                acquireTime = &values[i];
@@ -2072,8 +2072,8 @@ EGLBoolean eglGetFrameTimestampsANDROID(EGLDisplay dpy, EGLSurface surface,
    }

    status_t ret = native_window_get_frame_timestamps(s->win.get(), framesAgo,
            postedTime, acquireTime, refreshStartTime, GLCompositionDoneTime,
            displayRetireTime, releaseTime);
            requestedPresentTime, acquireTime, refreshStartTime,
            GLCompositionDoneTime, displayRetireTime, releaseTime);

    if (ret != NO_ERROR) {
        setError(EGL_BAD_ACCESS, EGL_FALSE);
@@ -2102,7 +2102,7 @@ EGLBoolean eglQueryTimestampSupportedANDROID(EGLDisplay dpy, EGLSurface surface,

    switch (timestamp) {
#if ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS
        case EGL_QUEUE_TIME_ANDROID:
        case EGL_REQUESTED_PRESENT_TIME_ANDROID:
        case EGL_RENDERING_COMPLETE_TIME_ANDROID:
        case EGL_COMPOSITION_START_TIME_ANDROID:
        case EGL_COMPOSITION_FINISHED_TIME_ANDROID:
Loading