87 int64_t *out_frame_id,
88 int64_t *out_wake_up_time_ns,
89 int64_t *out_desired_present_time_ns,
90 int64_t *out_present_slop_ns,
91 int64_t *out_predicted_display_time_ns,
92 int64_t *out_predicted_display_period_ns,
93 int64_t *out_min_display_period_ns);
139 int64_t desired_present_time_ns,
140 int64_t actual_present_time_ns,
141 int64_t earliest_present_time_ns,
142 int64_t present_margin_ns,
162 int64_t gpu_start_ns,
192 int64_t present_to_display_offset_ns);
211 int64_t *out_frame_id,
212 int64_t *out_wake_up_time_ns,
213 int64_t *out_desired_present_time_ns,
214 int64_t *out_present_slop_ns,
215 int64_t *out_predicted_display_time_ns,
216 int64_t *out_predicted_display_period_ns,
217 int64_t *out_min_display_period_ns)
223 out_desired_present_time_ns,
225 out_predicted_display_time_ns,
226 out_predicted_display_period_ns,
227 out_min_display_period_ns);
241 upc->
mark_point(upc, point, frame_id, when_ns);
255 int64_t desired_present_time_ns,
256 int64_t actual_present_time_ns,
257 int64_t earliest_present_time_ns,
258 int64_t present_margin_ns,
261 upc->
info(upc, frame_id, desired_present_time_ns, actual_present_time_ns, earliest_present_time_ns,
262 present_margin_ns, when_ns);
276 struct u_pacing_compositor *upc, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns)
278 upc->
info_gpu(upc, frame_id, gpu_start_ns, gpu_end_ns, when_ns);
366 int64_t *out_frame_id,
367 int64_t *out_wake_up_time,
368 int64_t *out_predicted_display_time,
369 int64_t *out_predicted_display_period);
455 int64_t predicted_display_time_ns,
456 int64_t predicted_display_period_ns,
476 int64_t *out_frame_id,
477 int64_t *out_wake_up_time,
478 int64_t *out_predicted_display_time,
479 int64_t *out_predicted_display_period)
481 upa->
predict(upa, now_ns, out_frame_id, out_wake_up_time, out_predicted_display_time,
482 out_predicted_display_period);
496 upa->
mark_point(upa, frame_id, point, when_ns);
551 int64_t predicted_display_time_ns,
552 int64_t predicted_display_period_ns,
555 upa->
info(upa, predicted_display_time_ns, predicted_display_period_ns, extra_ns);
569 upa->
latched(upa, frame_id, when_ns, system_frame_id);
583 upa->
retired(upa, frame_id, when_ns);
645 upaf->
create(upaf, out_upa);
static void u_pa_mark_discarded(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
When a frame has been discarded.
Definition: u_pacing.h:508
u_timing_point
For marking timepoints on a frame's lifetime, not a async event.
Definition: u_pacing.h:35
static void u_pa_mark_point(struct u_pacing_app *upa, int64_t frame_id, enum u_timing_point point, int64_t when_ns)
Mark a point on the frame's lifetime.
Definition: u_pacing.h:494
xrt_result_t u_pc_display_timing_create(int64_t estimated_frame_period_ns, const struct u_pc_display_timing_config *config, struct u_pacing_compositor **out_upc)
Creates a new composition pacing helper that uses real display timing information.
Definition: u_pacing_compositor.c:753
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.
Definition: u_pacing.h:275
xrt_result_t u_pa_factory_create(struct u_pacing_app_factory **out_upaf)
Creates a new application pacing factory helper.
Definition: u_pacing_app.c:787
static void u_pa_retired(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
Mark a frame as completely retired, will never be latched (used by the native compositor again) as a ...
Definition: u_pacing.h:581
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.
Definition: u_pacing.h:239
static void u_pa_predict(struct u_pacing_app *upa, int64_t now_ns, int64_t *out_frame_id, int64_t *out_wake_up_time, int64_t *out_predicted_display_time, int64_t *out_predicted_display_period)
Predict when the client's next rendered frame will be displayed; when the client should be woken up f...
Definition: u_pacing.h:474
static void u_pc_destroy(struct u_pacing_compositor **upc_ptr)
Destroy this u_pacing_compositor.
Definition: u_pacing.h:319
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.
Definition: u_pacing.h:209
static void u_pa_destroy(struct u_pacing_app **upa_ptr)
Destroy this u_pacing_app.
Definition: u_pacing.h:596
static void u_pa_mark_delivered(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns, int64_t display_time_ns)
A frame has been delivered from the client, see xrEndFrame.
Definition: u_pacing.h:522
static void u_pa_info(struct u_pacing_app *upa, int64_t predicted_display_time_ns, int64_t predicted_display_period_ns, int64_t extra_ns)
Add a new sample point from the main render loop.
Definition: u_pacing.h:550
static void u_paf_destroy(struct u_pacing_app_factory **upaf_ptr)
Destroy this u_pacing_app_factory.
Definition: u_pacing.h:658
static void u_paf_create(struct u_pacing_app_factory *upaf, struct u_pacing_app **out_upa)
Create a u_pacing_app.
Definition: u_pacing.h:643
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.
Definition: u_pacing.h:253
xrt_result_t u_pc_fake_create(int64_t estimated_frame_period_ns, int64_t now_ns, struct u_pacing_compositor **out_upc)
Creates a new composition pacing helper that does not depend on display timing information.
Definition: u_pacing_compositor_fake.c:444
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.
Definition: u_pacing.h:290
static void u_pa_mark_gpu_done(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
A frame has been completed rendered by the GPU, this can happen after xrEndFrame has returned.
Definition: u_pacing.h:536
static void u_pa_latched(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns, int64_t system_frame_id)
Latch a frame for rendering for delivery to the native compositor, may be called multiple times for t...
Definition: u_pacing.h:567
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.
Definition: u_pacing.h:304
@ U_TIMING_POINT_SUBMIT_END
Finished submitting work to the GPU, only used by the compositor.
Definition: u_pacing.h:46
@ U_TIMING_POINT_SUBMIT_BEGIN
Began submitting work to the GPU, only used by the compositor.
Definition: u_pacing.h:43
@ U_TIMING_POINT_BEGIN
Began CPU side work for GPU.
Definition: u_pacing.h:40
@ U_TIMING_POINT_WAKE_UP
Woke up after sleeping in "wait frame".
Definition: u_pacing.h:37
enum xrt_result xrt_result_t
Result type used across Monado.
Small helper that creates a app pacers, allows timing information to be collected and controlled to a...
Definition: u_pacing.h:619
void(* destroy)(struct u_pacing_app_factory *upaf)
Destroy this u_pacing_app_factory.
Definition: u_pacing.h:631
xrt_result_t(* create)(struct u_pacing_app_factory *upaf, struct u_pacing_app **out_upa)
Create a u_pacing_app.
Definition: u_pacing.h:626
This application pacing helper is designed to schedule the rendering time of clients that submit fram...
Definition: u_pacing.h:348
void(* destroy)(struct u_pacing_app *upa)
Destroy this u_pacing_app.
Definition: u_pacing.h:462
void(* mark_discarded)(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
When a frame has been discarded.
Definition: u_pacing.h:390
void(* info)(struct u_pacing_app *upa, int64_t predicted_display_time_ns, int64_t predicted_display_period_ns, int64_t extra_ns)
Add a new sample point from the main render loop.
Definition: u_pacing.h:454
void(* mark_delivered)(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns, int64_t display_time_ns)
A frame has been delivered from the client, see xrEndFrame.
Definition: u_pacing.h:401
void(* latched)(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns, int64_t system_frame_id)
Latch a frame for rendering for delivery to the native compositor, may be called multiple times for t...
Definition: u_pacing.h:423
void(* retired)(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
Mark a frame as completely retired, will never be latched (used by the native compositor again) as a ...
Definition: u_pacing.h:434
void(* mark_point)(struct u_pacing_app *upa, int64_t frame_id, enum u_timing_point point, int64_t when_ns)
Mark a point on the frame's lifetime.
Definition: u_pacing.h:381
void(* mark_gpu_done)(struct u_pacing_app *upa, int64_t frame_id, int64_t when_ns)
A frame has been completed rendered by the GPU, this can happen after xrEndFrame has returned.
Definition: u_pacing.h:410
void(* predict)(struct u_pacing_app *upa, int64_t now_ns, int64_t *out_frame_id, int64_t *out_wake_up_time, int64_t *out_predicted_display_time, int64_t *out_predicted_display_period)
Predict when the client's next rendered frame will be displayed; when the client should be woken up f...
Definition: u_pacing.h:364
Compositor pacing helper interface.
Definition: u_pacing.h:68
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.
Definition: u_pacing.h:85
void(* destroy)(struct u_pacing_compositor *upc)
Destroy this u_pacing_compositor.
Definition: u_pacing.h:197
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.
Definition: u_pacing.h:190
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.
Definition: u_pacing.h:177
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.
Definition: u_pacing.h:137
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.
Definition: u_pacing.h:108
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.
Definition: u_pacing.h:160
Configuration for the "display-timing-aware" implementation of u_pacing_compositor.
Definition: u_pacing.h:681
int64_t margin_ns
Extra margin that is added to compositor time, between end of draw and present.
Definition: u_pacing.h:685
uint32_t comp_time_max_fraction
The maximum time we allow to the compositor.
Definition: u_pacing.h:695
uint32_t adjust_missed_fraction
When missing a frame, back off in these increments.
Definition: u_pacing.h:697
uint32_t adjust_non_miss_fraction
When not missing frames but adjusting app time at these increments.
Definition: u_pacing.h:699
int64_t present_to_display_offset_ns
How long after "present" is the image actually displayed.
Definition: u_pacing.h:683
uint32_t comp_time_fraction
The initial estimate of how much time the compositor needs.
Definition: u_pacing.h:693
const struct u_pc_display_timing_config U_PC_DISPLAY_TIMING_CONFIG_DEFAULT
Default configuration values for display-timing-aware compositor pacing.
Definition: u_pacing_compositor.c:740
Header holding common defines.
Common defines and enums for XRT.