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

Commit 94ef994d authored by Ian Elliott's avatar Ian Elliott
Browse files

Vulkan: only report refresh duration (add new call for new way)

As part of discussions within Khronos, it was decided that
VK_GOOGLE_display_timing should only report one refresh duration for a display,
and assume that it's refresh rate is fixed (which is the case for our current
devices).

This commit adds the new macro/function that will be used long-term.  A future
commit will remove the old macro/function, once it is no longer used (since the
plumbing crosses repository boundaires.

Test: Manually tested with a modified cube demo, that reports the refresh
duration returned from this extension.

Change-Id: Icff385db120f3e49fec0b2b8b0f35a06a9db6ca4
parent 9a617138
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -355,7 +355,8 @@ enum {
    NATIVE_WINDOW_SET_AUTO_REFRESH          = 22,
    NATIVE_WINDOW_ENABLE_FRAME_TIMESTAMPS   = 23,
    NATIVE_WINDOW_GET_FRAME_TIMESTAMPS      = 24,
    NATIVE_WINDOW_GET_REFRESH_CYCLE_PERIOD  = 25,
    NATIVE_WINDOW_GET_REFRESH_CYCLE_DURATION= 25,
    NATIVE_WINDOW_GET_REFRESH_CYCLE_PERIOD  = 26,
};

/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
@@ -1040,6 +1041,14 @@ static inline int native_window_get_frame_timestamps(
            outDisplayRetireTime, outDequeueReadyTime, outReleaseTime);
}

static inline int native_window_get_refresh_cycle_duration(
        struct ANativeWindow* window,
        int64_t* outRefreshDuration)
{
    return window->perform(window, NATIVE_WINDOW_GET_REFRESH_CYCLE_DURATION,
            outRefreshDuration);
}

static inline int native_window_get_refresh_cycle_period(
        struct ANativeWindow* window,
        int64_t* outMinRefreshDuration, int64_t* outMaxRefreshDuration)