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

Commit 4c695296 authored by Ian Elliott's avatar Ian Elliott Committed by Android (Google) Code Review
Browse files

Merge "Vulkan: only report refreshDuration, not {min|max}RefreshDuration"

parents e895863c be833a27
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -150,9 +150,7 @@ public:
            nsecs_t* outLastRefreshStartTime, nsecs_t* outGlCompositionDoneTime,
            nsecs_t* outDisplayPresentTime, nsecs_t* outDisplayRetireTime,
            nsecs_t* outDequeueReadyTime, nsecs_t* outReleaseTime);

    status_t getDisplayRefreshCyclePeriod(nsecs_t* outMinRefreshDuration,
            nsecs_t* outMaxRefreshDuration);
    status_t getDisplayRefreshCycleDuration(nsecs_t* outRefreshDuration);

    status_t getUniqueId(uint64_t* outId) const;

@@ -210,7 +208,7 @@ private:
    int dispatchSetAutoRefresh(va_list args);
    int dispatchEnableFrameTimestamps(va_list args);
    int dispatchGetFrameTimestamps(va_list args);
    int dispatchGetDisplayRefreshCyclePeriod(va_list args);
    int dispatchGetDisplayRefreshCycleDuration(va_list args);

protected:
    virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd);
+7 −11
Original line number Diff line number Diff line
@@ -262,15 +262,13 @@ status_t Surface::getFrameTimestamps(uint64_t frameNumber,

    return NO_ERROR;
}
status_t Surface::getDisplayRefreshCyclePeriod(nsecs_t* outMinRefreshDuration,
            nsecs_t* outMaxRefreshDuration) {
status_t Surface::getDisplayRefreshCycleDuration(nsecs_t* outRefreshDuration) {
    ATRACE_CALL();

    DisplayStatInfo stats;
    status_t err = composerService()->getDisplayStats(NULL, &stats);

    *outMinRefreshDuration = stats.vsyncPeriod;
    *outMaxRefreshDuration = stats.vsyncPeriod;
    *outRefreshDuration = stats.vsyncPeriod;

    return NO_ERROR;
}
@@ -841,8 +839,8 @@ int Surface::perform(int operation, va_list args)
    case NATIVE_WINDOW_GET_FRAME_TIMESTAMPS:
        res = dispatchGetFrameTimestamps(args);
        break;
    case NATIVE_WINDOW_GET_REFRESH_CYCLE_PERIOD:
        res = dispatchGetDisplayRefreshCyclePeriod(args);
    case NATIVE_WINDOW_GET_REFRESH_CYCLE_DURATION:
        res = dispatchGetDisplayRefreshCycleDuration(args);
        break;
    default:
        res = NAME_NOT_FOUND;
@@ -989,11 +987,9 @@ int Surface::dispatchGetFrameTimestamps(va_list args) {
            outDisplayRetireTime, outDequeueReadyTime, outReleaseTime);
}

int Surface::dispatchGetDisplayRefreshCyclePeriod(va_list args) {
    nsecs_t* outMinRefreshDuration = va_arg(args, int64_t*);
    nsecs_t* outMaxRefreshDuration = va_arg(args, int64_t*);
    return getDisplayRefreshCyclePeriod(outMinRefreshDuration,
            outMaxRefreshDuration);
int Surface::dispatchGetDisplayRefreshCycleDuration(va_list args) {
    nsecs_t* outRefreshDuration = va_arg(args, int64_t*);
    return getDisplayRefreshCycleDuration(outRefreshDuration);
}

int Surface::connect(int api) {
+1 −2
Original line number Diff line number Diff line
@@ -4146,8 +4146,7 @@ typedef struct VkDedicatedAllocationMemoryAllocateInfoNV {
#define VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME "VK_GOOGLE_display_timing"

typedef struct VkRefreshCycleDurationGOOGLE {
    uint64_t    minRefreshDuration;
    uint64_t    maxRefreshDuration;
    uint64_t    refreshDuration;
} VkRefreshCycleDurationGOOGLE;

typedef struct VkPastPresentationTimingGOOGLE {
+7 −12
Original line number Diff line number Diff line
@@ -197,21 +197,17 @@ struct Swapchain {
          frame_timestamps_enabled(false) {
        timing.clear();
        ANativeWindow* window = surface.window.get();
        int64_t min_rdur;
        int64_t max_rdur;
        native_window_get_refresh_cycle_period(
        int64_t rdur;
        native_window_get_refresh_cycle_duration(
            window,
            &min_rdur,
            &max_rdur);
        min_refresh_duration = static_cast<uint64_t>(min_rdur);
        max_refresh_duration = static_cast<uint64_t>(max_rdur);
            &rdur);
        refresh_duration = static_cast<uint64_t>(rdur);
    }

    Surface& surface;
    uint32_t num_images;
    bool frame_timestamps_enabled;
    uint64_t min_refresh_duration;
    uint64_t max_refresh_duration;
    uint64_t refresh_duration;

    struct Image {
        Image() : image(VK_NULL_HANDLE), dequeue_fence(-1), dequeued(false) {}
@@ -356,7 +352,7 @@ uint32_t get_num_ready_timings(Swapchain& swapchain) {
                                // timestamps to calculate the info that should
                                // be reported to the user:
                                //
                                ti->calculate(swapchain.min_refresh_duration);
                                ti->calculate(swapchain.refresh_duration);
                                num_ready++;
                            }
                            break;
@@ -1288,8 +1284,7 @@ VkResult GetRefreshCycleDurationGOOGLE(
    Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle);
    VkResult result = VK_SUCCESS;

    pDisplayTimingProperties->minRefreshDuration = swapchain.min_refresh_duration;
    pDisplayTimingProperties->maxRefreshDuration = swapchain.max_refresh_duration;
    pDisplayTimingProperties->refreshDuration = swapchain.refresh_duration;

    return result;
}