u/ft: Rename frame timing functions

This commit is contained in:
Jakob Bornecrantz 2021-04-02 19:18:31 +01:00
parent 5dbcca65c5
commit 971f88f34f
6 changed files with 49 additions and 49 deletions

View file

@ -119,14 +119,14 @@ struct u_frame_timing
* @ingroup aux_timing
*/
static inline void
u_frame_timing_predict(struct u_frame_timing *uft,
int64_t *out_frame_id,
uint64_t *out_wake_up_time_ns,
uint64_t *out_desired_present_time_ns,
uint64_t *out_present_slop_ns,
uint64_t *out_predicted_display_time_ns,
uint64_t *out_predicted_display_period_ns,
uint64_t *out_min_display_period_ns)
u_ft_predict(struct u_frame_timing *uft,
int64_t *out_frame_id,
uint64_t *out_wake_up_time_ns,
uint64_t *out_desired_present_time_ns,
uint64_t *out_present_slop_ns,
uint64_t *out_predicted_display_time_ns,
uint64_t *out_predicted_display_period_ns,
uint64_t *out_min_display_period_ns)
{
uft->predict(uft, //
out_frame_id, //
@ -147,7 +147,7 @@ u_frame_timing_predict(struct u_frame_timing *uft,
* @ingroup aux_timing
*/
static inline void
u_frame_timing_mark_point(struct u_frame_timing *uft, enum u_timing_point point, int64_t frame_id, uint64_t when_ns)
u_ft_mark_point(struct u_frame_timing *uft, enum u_timing_point point, int64_t frame_id, uint64_t when_ns)
{
uft->mark_point(uft, point, frame_id, when_ns);
}
@ -161,12 +161,12 @@ u_frame_timing_mark_point(struct u_frame_timing *uft, enum u_timing_point point,
* @ingroup aux_timing
*/
static inline void
u_frame_timing_info(struct u_frame_timing *uft,
int64_t frame_id,
uint64_t desired_present_time_ns,
uint64_t actual_present_time_ns,
uint64_t earliest_present_time_ns,
uint64_t present_margin_ns)
u_ft_info(struct u_frame_timing *uft,
int64_t frame_id,
uint64_t desired_present_time_ns,
uint64_t actual_present_time_ns,
uint64_t earliest_present_time_ns,
uint64_t present_margin_ns)
{
uft->info(uft, frame_id, desired_present_time_ns, actual_present_time_ns, earliest_present_time_ns,
present_margin_ns);
@ -182,7 +182,7 @@ u_frame_timing_info(struct u_frame_timing *uft,
* @ingroup aux_timing
*/
static inline void
u_frame_timing_destroy(struct u_frame_timing **uft_ptr)
u_ft_destroy(struct u_frame_timing **uft_ptr)
{
struct u_frame_timing *uft = *uft_ptr;
if (uft == NULL) {
@ -206,7 +206,7 @@ u_frame_timing_destroy(struct u_frame_timing **uft_ptr)
* @ingroup aux_timing
*/
xrt_result_t
u_frame_timing_display_timing_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft);
u_ft_display_timing_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft);
/*!
* When you can not get display timing information use this.
@ -214,7 +214,7 @@ u_frame_timing_display_timing_create(uint64_t estimated_frame_period_ns, struct
* @ingroup aux_timing
*/
xrt_result_t
u_frame_timing_fake_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft);
u_ft_fake_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft);
#ifdef __cplusplus

View file

@ -166,7 +166,7 @@ ft_destroy(struct u_frame_timing *uft)
*/
xrt_result_t
u_frame_timing_fake_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft)
u_ft_fake_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft)
{
struct fake_timing *ft = U_TYPED_CALLOC(struct fake_timing);
ft->base.predict = ft_predict;

View file

@ -329,9 +329,9 @@ adjust_app_time(struct display_timing *dt, struct frame *f)
}
// We want the GPU work to stop at min_margin_ns.
if (is_within_of_each_other( //
f->present_margin_ns, //
dt->min_margin_ns, //
if (is_within_of_each_other( //
f->present_margin_ns, //
dt->min_margin_ns, //
dt->adjust_non_miss_ns)) {
// Nothing to do, the GPU ended it's work +-adjust_non_miss_ns
// of min_margin_ns before the present started.
@ -480,7 +480,7 @@ dt_destroy(struct u_frame_timing *uft)
}
xrt_result_t
u_frame_timing_display_timing_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft)
u_ft_display_timing_create(uint64_t estimated_frame_period_ns, struct u_frame_timing **out_uft)
{
struct display_timing *dt = U_TYPED_CALLOC(struct display_timing);
dt->base.predict = dt_predict;
@ -680,13 +680,13 @@ trace_frame(FILE *file, struct frame *f)
}
void
u_timing_frame_write_json(FILE *file, void *data)
u_ft_write_json(FILE *file, void *data)
{
trace_frame(file, (struct frame *)data);
}
void
u_timing_frame_write_json_metadata(FILE *file)
u_ft_write_json_metadata(FILE *file)
{
fprintf(file,
",\n"

View file

@ -54,10 +54,10 @@ extern int u_trace_comp_fd;
*/
void
u_timing_frame_write_json(FILE *file, void *data);
u_ft_write_json(FILE *file, void *data);
void
u_timing_frame_write_json_metadata(FILE *file);
u_ft_write_json_metadata(FILE *file);
/*

View file

@ -98,9 +98,9 @@ comp_target_swapchain_create_images(struct comp_target *ct,
// Some platforms really don't like the display_timing code.
bool use_display_timing_if_available = cts->timing_usage == COMP_TARGET_USE_DISPLAY_IF_AVAILABLE;
if (cts->uft == NULL && use_display_timing_if_available && vk->has_GOOGLE_display_timing) {
u_frame_timing_display_timing_create(ct->c->settings.nominal_frame_interval_ns, &cts->uft);
u_ft_display_timing_create(ct->c->settings.nominal_frame_interval_ns, &cts->uft);
} else if (cts->uft == NULL) {
u_frame_timing_fake_create(ct->c->settings.nominal_frame_interval_ns, &cts->uft);
u_ft_fake_create(ct->c->settings.nominal_frame_interval_ns, &cts->uft);
}
// Free old image views.
@ -523,14 +523,14 @@ comp_target_swapchain_calc_frame_timings(struct comp_target *ct,
uint64_t predicted_display_period_ns = 0;
uint64_t min_display_period_ns = 0;
u_frame_timing_predict(cts->uft, //
&frame_id, //
&wake_up_time_ns, //
&desired_present_time_ns, //
&present_slop_ns, //
&predicted_display_time_ns, //
&predicted_display_period_ns, //
&min_display_period_ns); //
u_ft_predict(cts->uft, //
&frame_id, //
&wake_up_time_ns, //
&desired_present_time_ns, //
&present_slop_ns, //
&predicted_display_time_ns, //
&predicted_display_period_ns, //
&min_display_period_ns); //
cts->current_frame_id = frame_id;
@ -552,13 +552,13 @@ comp_target_swapchain_mark_timing_point(struct comp_target *ct,
switch (point) {
case COMP_TARGET_TIMING_POINT_WAKE_UP:
u_frame_timing_mark_point(cts->uft, U_TIMING_POINT_WAKE_UP, cts->current_frame_id, when_ns);
u_ft_mark_point(cts->uft, U_TIMING_POINT_WAKE_UP, cts->current_frame_id, when_ns);
break;
case COMP_TARGET_TIMING_POINT_BEGIN:
u_frame_timing_mark_point(cts->uft, U_TIMING_POINT_BEGIN, cts->current_frame_id, when_ns);
u_ft_mark_point(cts->uft, U_TIMING_POINT_BEGIN, cts->current_frame_id, when_ns);
break;
case COMP_TARGET_TIMING_POINT_SUBMIT:
u_frame_timing_mark_point(cts->uft, U_TIMING_POINT_SUBMIT, cts->current_frame_id, when_ns);
u_ft_mark_point(cts->uft, U_TIMING_POINT_SUBMIT, cts->current_frame_id, when_ns);
break;
default: assert(false);
}
@ -597,12 +597,12 @@ comp_target_swapchain_update_timings(struct comp_target *ct)
timings); //
for (uint32_t i = 0; i < count; i++) {
u_frame_timing_info(cts->uft, //
timings[i].presentID, //
timings[i].desiredPresentTime, //
timings[i].actualPresentTime, //
timings[i].earliestPresentTime, //
timings[i].presentMargin); //
u_ft_info(cts->uft, //
timings[i].presentID, //
timings[i].desiredPresentTime, //
timings[i].actualPresentTime, //
timings[i].earliestPresentTime, //
timings[i].presentMargin); //
}
free(timings);
return VK_SUCCESS;
@ -638,7 +638,7 @@ comp_target_swapchain_cleanup(struct comp_target_swapchain *cts)
cts->swapchain.handle = VK_NULL_HANDLE;
}
u_frame_timing_destroy(&cts->uft);
u_ft_destroy(&cts->uft);
}
void

View file

@ -140,7 +140,7 @@ handle_data(const char *rest_of_line, size_t len)
}
switch (type) {
case U_TRACE_DATA_TYPE_TIMING_FRAME: u_timing_frame_write_json(t.file, (void *)data); break;
case U_TRACE_DATA_TYPE_TIMING_FRAME: u_ft_write_json(t.file, (void *)data); break;
default: fprintf(stderr, "%.*s\n", (int)len, rest_of_line); break;
}
}
@ -268,7 +268,7 @@ trace_pipe(int argc, const char **argv)
json_w_header();
u_timing_frame_write_json_metadata(t.file);
u_ft_write_json_metadata(t.file);
P(" :: Looping\n");