#ifndef MOD_FREESYNC_H_
#define MOD_FREESYNC_H_
#include "mod_shared.h"
struct mod_freesync { … };
struct mod_freesync_caps { … };
enum mod_vrr_state { … };
struct mod_freesync_config { … };
struct mod_vrr_params_btr { … };
struct mod_vrr_params_fixed_refresh { … };
struct mod_vrr_params_flip_interval { … };
struct mod_vrr_params { … };
struct mod_freesync *mod_freesync_create(struct dc *dc);
void mod_freesync_destroy(struct mod_freesync *mod_freesync);
bool mod_freesync_get_vmin_vmax(struct mod_freesync *mod_freesync,
const struct dc_stream_state *stream,
unsigned int *vmin,
unsigned int *vmax);
bool mod_freesync_get_v_position(struct mod_freesync *mod_freesync,
struct dc_stream_state *stream,
unsigned int *nom_v_pos,
unsigned int *v_pos);
void mod_freesync_get_settings(struct mod_freesync *mod_freesync,
const struct mod_vrr_params *vrr,
unsigned int *v_total_min, unsigned int *v_total_max,
unsigned int *event_triggers,
unsigned int *window_min, unsigned int *window_max,
unsigned int *lfc_mid_point_in_us,
unsigned int *inserted_frames,
unsigned int *inserted_duration_in_us);
void mod_freesync_build_vrr_infopacket(struct mod_freesync *mod_freesync,
const struct dc_stream_state *stream,
const struct mod_vrr_params *vrr,
enum vrr_packet_type packet_type,
enum color_transfer_func app_tf,
struct dc_info_packet *infopacket,
bool pack_sdp_v1_3);
void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
const struct dc_stream_state *stream,
struct mod_freesync_config *in_config,
struct mod_vrr_params *in_out_vrr);
void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
const struct dc_plane_state *plane,
const struct dc_stream_state *stream,
unsigned int curr_time_stamp_in_us,
struct mod_vrr_params *in_out_vrr);
void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
const struct dc_stream_state *stream,
struct mod_vrr_params *in_out_vrr);
unsigned long long mod_freesync_calc_nominal_field_rate(
const struct dc_stream_state *stream);
unsigned long long mod_freesync_calc_field_rate_from_timing(
unsigned int vtotal, unsigned int htotal, unsigned int pix_clk);
bool mod_freesync_is_valid_range(uint32_t min_refresh_cap_in_uhz,
uint32_t max_refresh_cap_in_uhz,
uint32_t nominal_field_rate_in_uhz);
unsigned int mod_freesync_calc_v_total_from_refresh(
const struct dc_stream_state *stream,
unsigned int refresh_in_uhz);
bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr);
#endif