102 int64_t *out_wake_up_time_ns,
103 int64_t *out_desired_present_time_ns,
104 int64_t *out_present_slop_ns,
105 int64_t *out_predicted_display_time_ns,
106 int64_t *out_predicted_display_period_ns,
107 int64_t *out_min_display_period_ns);
153 int64_t desired_present_time_ns,
154 int64_t actual_present_time_ns,
155 int64_t earliest_present_time_ns,
156 int64_t present_margin_ns,
176 int64_t gpu_start_ns,
207 int64_t present_to_display_offset_ns);
241 int64_t *out_wake_up_time_ns,
242 int64_t *out_desired_present_time_ns,
243 int64_t *out_present_slop_ns,
244 int64_t *out_predicted_display_time_ns,
245 int64_t *out_predicted_display_period_ns,
246 int64_t *out_min_display_period_ns)
252 out_desired_present_time_ns,
254 out_predicted_display_time_ns,
255 out_predicted_display_period_ns,
256 out_min_display_period_ns);
270 upc->
mark_point(upc, point, frame_id, when_ns);
284 int64_t desired_present_time_ns,
285 int64_t actual_present_time_ns,
286 int64_t earliest_present_time_ns,
287 int64_t present_margin_ns,
290 upc->
info(upc, frame_id, desired_present_time_ns, actual_present_time_ns, earliest_present_time_ns,
291 present_margin_ns, when_ns);
305 struct u_pacing_compositor *upc, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns)
307 upc->
info_gpu(upc, frame_id, gpu_start_ns, gpu_end_ns, when_ns);
395 int64_t *out_frame_id,
396 int64_t *out_wake_up_time,
397 int64_t *out_predicted_display_time,
398 int64_t *out_predicted_display_period);
484 int64_t predicted_display_time_ns,
485 int64_t predicted_display_period_ns,
505 int64_t *out_frame_id,
506 int64_t *out_wake_up_time,
507 int64_t *out_predicted_display_time,
508 int64_t *out_predicted_display_period)
510 upa->
predict(upa, now_ns, out_frame_id, out_wake_up_time, out_predicted_display_time,
511 out_predicted_display_period);
525 upa->
mark_point(upa, frame_id, point, when_ns);
580 int64_t predicted_display_time_ns,
581 int64_t predicted_display_period_ns,
584 upa->
info(upa, predicted_display_time_ns, predicted_display_period_ns, extra_ns);
598 upa->
latched(upa, frame_id, when_ns, system_frame_id);
612 upa->
retired(upa, frame_id, when_ns);
674 upaf->
create(upaf, out_upa);
static void u_pc_predict_frame(struct u_pacing_compositor *upc, int64_t frame_id, int64_t now_ns, 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 timings for a frame previously allocated with allocate_frame.
Definition u_pacing.h:238
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:537
u_timing_point
For marking timepoints on a frame's lifetime, not a async event.
Definition u_pacing.h:36
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:523
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:783
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:304
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:824
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:610
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:268
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:503
static void u_pc_destroy(struct u_pacing_compositor **upc_ptr)
Destroy this u_pacing_compositor.
Definition u_pacing.h:348
static void u_pa_destroy(struct u_pacing_app **upa_ptr)
Destroy this u_pacing_app.
Definition u_pacing.h:625
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:551
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:579
static void u_paf_destroy(struct u_pacing_app_factory **upaf_ptr)
Destroy this u_pacing_app_factory.
Definition u_pacing.h:687
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:672
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:282
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:470
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:319
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:565
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:596
struct u_pc_display_timing_config u_pc_display_timing_get_default_config(void)
Gets the default configuration of the composition pacing helper.
Definition u_pacing_compositor.c:760
static void u_pc_allocate_frame(struct u_pacing_compositor *upc, int64_t *out_frame_id)
Allocate a new frame, this allocates a frame ID but does not make any predictions.
Definition u_pacing.h:224
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:333
@ U_TIMING_POINT_SUBMIT_END
Finished submitting work to the GPU, only used by the compositor.
Definition u_pacing.h:47
@ U_TIMING_POINT_SUBMIT_BEGIN
Began submitting work to the GPU, only used by the compositor.
Definition u_pacing.h:44
@ U_TIMING_POINT_BEGIN
Began CPU side work for GPU.
Definition u_pacing.h:41
@ U_TIMING_POINT_WAKE_UP
Woke up after sleeping in "wait frame".
Definition u_pacing.h:38
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:648
void(* destroy)(struct u_pacing_app_factory *upaf)
Destroy this u_pacing_app_factory.
Definition u_pacing.h:660
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:655
This application pacing helper is designed to schedule the rendering time of clients that submit fram...
Definition u_pacing.h:377
void(* destroy)(struct u_pacing_app *upa)
Destroy this u_pacing_app.
Definition u_pacing.h:491
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:419
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:483
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:430
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:452
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:463
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:410
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:439
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:393
Compositor pacing helper interface.
Definition u_pacing.h:69
void(* destroy)(struct u_pacing_compositor *upc)
Destroy this u_pacing_compositor.
Definition u_pacing.h:212
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:205
void(* predict_frame)(struct u_pacing_compositor *upc, int64_t frame_id, int64_t now_ns, 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 timings for a frame previously allocated with allocate_frame.
Definition u_pacing.h:99
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:191
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:151
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:122
void(* allocate_frame)(struct u_pacing_compositor *upc, int64_t *out_frame_id)
Allocate a new frame, this allocates a frame ID but does not make any predictions.
Definition u_pacing.h:81
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:174
Configuration for the "display-timing-aware" implementation of u_pacing_compositor.
Definition u_pacing.h:710
int64_t margin_ns
Extra margin that is added to compositor time, between end of draw and present.
Definition u_pacing.h:714
uint32_t comp_time_max_fraction
The maximum time we allow to the compositor.
Definition u_pacing.h:724
uint32_t adjust_missed_fraction
When missing a frame, back off in these increments.
Definition u_pacing.h:726
uint32_t adjust_non_miss_fraction
When not missing frames but adjusting app time at these increments.
Definition u_pacing.h:728
int64_t present_to_display_offset_ns
How long after "present" is the image actually displayed.
Definition u_pacing.h:712
uint32_t comp_time_fraction
The initial estimate of how much time the compositor needs.
Definition u_pacing.h:722
Header holding common defines.
Common defines and enums for XRT.