Monado OpenXR Runtime
|
Compositor pacing helper interface. More...
#include <util/u_pacing.h>
Static Public Member Functions | |
static void | u_pc_predict (struct u_pacing_compositor *upc, int64_t now_ns, int64_t *out_frame_id, int64_t *out_wake_up_time_ns, int64_t *out_desired_present_time_ns, int64_t *out_present_slop_ns, int64_t *out_predicted_display_time_ns, int64_t *out_predicted_display_period_ns, int64_t *out_min_display_period_ns) |
Predict the next frame. More... | |
static void | u_pc_mark_point (struct u_pacing_compositor *upc, enum u_timing_point point, int64_t frame_id, int64_t when_ns) |
Mark a point on the frame's lifetime. More... | |
static void | u_pc_info (struct u_pacing_compositor *upc, int64_t frame_id, int64_t desired_present_time_ns, int64_t actual_present_time_ns, int64_t earliest_present_time_ns, int64_t present_margin_ns, int64_t when_ns) |
Provide frame timing information about a delivered frame. More... | |
static void | u_pc_info_gpu (struct u_pacing_compositor *upc, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns) |
Provide frame timing information about GPU start and stop time. More... | |
static void | u_pc_update_vblank_from_display_control (struct u_pacing_compositor *upc, int64_t last_vblank_ns) |
Provide a vblank timing information, derived from the VK_EXT_display_control extension. More... | |
static void | u_pc_update_present_offset (struct u_pacing_compositor *upc, int64_t frame_id, int64_t present_to_display_offset_ns) |
Provide an updated estimate of the present offset. More... | |
static void | u_pc_destroy (struct u_pacing_compositor **upc_ptr) |
Destroy this u_pacing_compositor. More... | |
Data Fields | |
void(* | predict )(struct u_pacing_compositor *upc, int64_t now_ns, int64_t *out_frame_id, int64_t *out_wake_up_time_ns, int64_t *out_desired_present_time_ns, int64_t *out_present_slop_ns, int64_t *out_predicted_display_time_ns, int64_t *out_predicted_display_period_ns, int64_t *out_min_display_period_ns) |
Predict the next frame. More... | |
void(* | mark_point )(struct u_pacing_compositor *upc, enum u_timing_point point, int64_t frame_id, int64_t when_ns) |
Mark a point on the frame's lifetime. More... | |
void(* | info )(struct u_pacing_compositor *upc, int64_t frame_id, int64_t desired_present_time_ns, int64_t actual_present_time_ns, int64_t earliest_present_time_ns, int64_t present_margin_ns, int64_t when_ns) |
Provide frame timing information about a delivered frame. More... | |
void(* | info_gpu )(struct u_pacing_compositor *upc, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns) |
Provide frame timing information about GPU start and stop time. More... | |
void(* | update_vblank_from_display_control )(struct u_pacing_compositor *upc, int64_t last_vblank_ns) |
Provide a vblank timing information, derived from the VK_EXT_display_control extension. More... | |
void(* | update_present_offset )(struct u_pacing_compositor *upc, int64_t frame_id, int64_t present_to_display_offset_ns) |
Provide an updated estimate of the present offset. More... | |
void(* | destroy )(struct u_pacing_compositor *upc) |
Destroy this u_pacing_compositor. More... | |
Compositor pacing helper interface.
This is used for the compositor's own frame timing/pacing. It is not responsible for getting the timing data from the graphics API, etc: instead it consumes timing data from the graphics API (if available) and from "markers" in the compositor's CPU code, and produces predictions that are used to guide the compositor.
Pacing of the underlying app/client is handled by u_pacing_app
void(* u_pacing_compositor::destroy) (struct u_pacing_compositor *upc) |
Destroy this u_pacing_compositor.
Referenced by u_pc_destroy().
void(* u_pacing_compositor::info) (struct u_pacing_compositor *upc, int64_t frame_id, int64_t desired_present_time_ns, int64_t actual_present_time_ns, int64_t earliest_present_time_ns, int64_t present_margin_ns, int64_t when_ns) |
Provide frame timing information about a delivered frame.
This is usually provided after-the-fact by the display system. These arguments currently matches 1-to-1 what VK_GOOGLE_display_timing provides, see https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPastPresentationTimingGOOGLE.html
Depend on when the information is delivered this can be called at any point of the following frames.
[in] | upc | The compositor pacing helper. |
[in] | frame_id | The frame ID to record for. |
[in] | desired_present_time_ns | The time that we indicated the GPU should start scanning out at, or zero if we didn't provide such a time. |
[in] | actual_present_time_ns | The time that the GPU actually started scanning out. |
[in] | earliest_present_time_ns | The earliest the GPU could have presented - might be before actual_present_time_ns if a desired_present_time_ns was passed. |
[in] | present_margin_ns | How "early" present happened compared to when it needed to happen in order to finish at earliestPresentTime . |
[in] | when_ns | The time when we got the info, nominally from os_monotonic_get_ns |
Referenced by u_pc_info().
void(* u_pacing_compositor::info_gpu) (struct u_pacing_compositor *upc, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns) |
Provide frame timing information about GPU start and stop time.
Depend on when the information is delivered this can be called at any point of the following frames.
[in] | upc | The compositor pacing helper. |
[in] | frame_id | The frame ID to record for. |
[in] | gpu_start_ns | When the GPU work startred. |
[in] | gpu_end_ns | When the GPU work stopped. |
[in] | when_ns | When the informatioon collected, nominally from os_monotonic_get_ns. |
Referenced by u_pc_info_gpu().
void(* u_pacing_compositor::mark_point) (struct u_pacing_compositor *upc, enum u_timing_point point, int64_t frame_id, int64_t when_ns) |
Mark a point on the frame's lifetime.
This is usually provided "when it happens" because the points to mark are steps in the CPU workload of the compositor.
[in] | upc | The compositor pacing helper. |
[in] | point | The point to record for a frame. |
[in] | frame_id | The frame ID to record for. |
[in] | when_ns | The timestamp of the event. |
Referenced by u_pc_mark_point().
void(* u_pacing_compositor::predict) (struct u_pacing_compositor *upc, int64_t now_ns, int64_t *out_frame_id, int64_t *out_wake_up_time_ns, int64_t *out_desired_present_time_ns, int64_t *out_present_slop_ns, int64_t *out_predicted_display_time_ns, int64_t *out_predicted_display_period_ns, int64_t *out_min_display_period_ns) |
Predict the next frame.
[in] | upc | The compositor pacing helper. |
[in] | now_ns | The current timestamp in nanoseconds, nominally from os_monotonic_get_ns |
[out] | out_frame_id | Id used to refer to this frame again. |
[out] | out_wake_up_time_ns | When should the compositor wake up. |
[out] | out_desired_present_time_ns | The GPU should start scanning out at this time. |
[out] | out_present_slop_ns | Any looseness to the desired present timing. |
[out] | out_predicted_display_time_ns | At what time have we predicted that pixels turns to photons. |
[out] | out_predicted_display_period_ns | Display period that we are running on. |
[out] | out_min_display_period_ns | The fastest theoretical display period. |
Referenced by u_pc_display_timing_create(), u_pc_fake_create(), and u_pc_predict().
void(* u_pacing_compositor::update_present_offset) (struct u_pacing_compositor *upc, int64_t frame_id, int64_t present_to_display_offset_ns) |
Provide an updated estimate of the present offset.
This is usually used only for more complicated display systems.
[in] | upc | The compositor pacing helper. |
[in] | frame_id | The frame ID to record for. |
[in] | present_to_display_offset_ns | The improved estimate of the time between "present" and photons. |
Referenced by u_pc_update_present_offset().
void(* u_pacing_compositor::update_vblank_from_display_control) (struct u_pacing_compositor *upc, int64_t last_vblank_ns) |
Provide a vblank timing information, derived from the VK_EXT_display_control extension.
Since the extension only says when a vblank happened (somewhat inaccurate as well) but not if a specific present happened at that time no frame_id is given.
[in] | upc | The compositor pacing helper. |
[in] | last_vblank_ns | The last time that the GPU started scanning out. |
Referenced by u_pc_update_vblank_from_display_control().