Monado OpenXR Runtime
u_pacing_compositor_fake.c File Reference

For generating a fake timing. More...

#include "os/os_time.h"
#include "util/u_var.h"
#include "util/u_time.h"
#include "util/u_misc.h"
#include "util/u_debug.h"
#include "util/u_pacing.h"
#include "util/u_metrics.h"
#include "util/u_logging.h"
#include "util/u_live_stats.h"
#include "util/u_trace_marker.h"
#include <stdio.h>
#include <assert.h>
Include dependency graph for u_pacing_compositor_fake.c:

Data Structures

struct  frame
 
struct  fake_timing
 A very simple pacer that tries it best to pace a compositor. More...
 

Macros

#define FRAME_COUNT   8
 

Functions

static struct fake_timingfake_timing (struct u_pacing_compositor *upc)
 
static struct frameget_frame_or_null (struct fake_timing *ft, int64_t frame_id)
 
static struct frameget_new_frame (struct fake_timing *ft)
 
static int64_t predict_next_frame_present_time (struct fake_timing *ft, int64_t now_ns)
 
static int64_t calc_display_time (struct fake_timing *ft, int64_t present_time_ns)
 
static int64_t get_percent_of_time (int64_t time_ns, uint32_t fraction_percent)
 
static void print_and_reset (struct fake_timing *ft)
 
static void calc_frame_stats (struct fake_timing *ft, struct frame *f)
 
static void calc_gpu_stats (struct fake_timing *ft, struct frame *f, int64_t gpu_start_ns, int64_t gpu_end_ns)
 
static void 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)
 
static void pc_mark_point (struct u_pacing_compositor *upc, enum u_timing_point point, int64_t frame_id, int64_t when_ns)
 
static void 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)
 
static void 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)
 
static void pc_update_vblank_from_display_control (struct u_pacing_compositor *upc, int64_t last_vblank_ns)
 
static void pc_update_present_offset (struct u_pacing_compositor *upc, int64_t frame_id, int64_t present_to_display_offset_ns)
 
static void pc_destroy (struct u_pacing_compositor *upc)
 
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. More...
 

Detailed Description

For generating a fake timing.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m