#include "dce_transform.h"
#include "reg_helper.h"
#include "opp.h"
#include "basics/conversion.h"
#include "dc.h"
#define REG(reg) …
#undef FN
#define FN(reg_name, field_name) …
#define CTX …
#define DC_LOGGER …
#define IDENTITY_RATIO(ratio) …
#define GAMUT_MATRIX_SIZE …
#define SCL_PHASES …
enum dcp_out_trunc_round_mode { … };
enum dcp_out_trunc_round_depth { … };
enum dcp_bit_depth_reduction_mode { … };
enum dcp_spatial_dither_mode { … };
enum dcp_spatial_dither_depth { … };
enum csc_color_mode { … };
enum grph_color_adjust_option { … };
static const struct out_csc_color_matrix global_color_matrix[] = …;
static bool setup_scaling_configuration(
struct dce_transform *xfm_dce,
const struct scaler_data *data)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static bool dce60_setup_scaling_configuration(
struct dce_transform *xfm_dce,
const struct scaler_data *data)
{ … }
#endif
static void program_overscan(
struct dce_transform *xfm_dce,
const struct scaler_data *data)
{ … }
static void program_multi_taps_filter(
struct dce_transform *xfm_dce,
int taps,
const uint16_t *coeffs,
enum ram_filter_type filter_type)
{ … }
static void program_viewport(
struct dce_transform *xfm_dce,
const struct rect *view_port)
{ … }
static void calculate_inits(
struct dce_transform *xfm_dce,
const struct scaler_data *data,
struct scl_ratios_inits *inits)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_calculate_inits(
struct dce_transform *xfm_dce,
const struct scaler_data *data,
struct sclh_ratios_inits *inits)
{ … }
#endif
static void program_scl_ratios_inits(
struct dce_transform *xfm_dce,
struct scl_ratios_inits *inits)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_program_scl_ratios_inits(
struct dce_transform *xfm_dce,
struct sclh_ratios_inits *inits)
{ … }
#endif
static const uint16_t *get_filter_coeffs_16p(int taps, struct fixed31_32 ratio)
{ … }
static void dce_transform_set_scaler(
struct transform *xfm,
const struct scaler_data *data)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_transform_set_scaler(
struct transform *xfm,
const struct scaler_data *data)
{ … }
#endif
static void set_clamp(
struct dce_transform *xfm_dce,
enum dc_color_depth depth)
{ … }
static void set_round(
struct dce_transform *xfm_dce,
enum dcp_out_trunc_round_mode mode,
enum dcp_out_trunc_round_depth depth)
{ … }
static void set_dither(
struct dce_transform *xfm_dce,
bool dither_enable,
enum dcp_spatial_dither_mode dither_mode,
enum dcp_spatial_dither_depth dither_depth,
bool frame_random_enable,
bool rgb_random_enable,
bool highpass_random_enable)
{ … }
static void program_bit_depth_reduction(
struct dce_transform *xfm_dce,
enum dc_color_depth depth,
const struct bit_depth_reduction_params *bit_depth_params)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_program_bit_depth_reduction(
struct dce_transform *xfm_dce,
enum dc_color_depth depth,
const struct bit_depth_reduction_params *bit_depth_params)
{ … }
#endif
static int dce_transform_get_max_num_of_supported_lines(
struct dce_transform *xfm_dce,
enum lb_pixel_depth depth,
int pixel_width)
{ … }
static void set_denormalization(
struct dce_transform *xfm_dce,
enum dc_color_depth depth)
{ … }
static void dce_transform_set_pixel_storage_depth(
struct transform *xfm,
enum lb_pixel_depth depth,
const struct bit_depth_reduction_params *bit_depth_params)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_transform_set_pixel_storage_depth(
struct transform *xfm,
enum lb_pixel_depth depth,
const struct bit_depth_reduction_params *bit_depth_params)
{ … }
#endif
static void program_gamut_remap(
struct dce_transform *xfm_dce,
const uint16_t *reg_val)
{ … }
static void dce_transform_set_gamut_remap(
struct transform *xfm,
const struct xfm_grph_csc_adjustment *adjust)
{ … }
static uint32_t decide_taps(struct fixed31_32 ratio, uint32_t in_taps, bool chroma)
{ … }
bool dce_transform_get_optimal_number_of_taps(
struct transform *xfm,
struct scaler_data *scl_data,
const struct scaling_taps *in_taps)
{ … }
static void dce_transform_reset(struct transform *xfm)
{ … }
static void program_color_matrix(
struct dce_transform *xfm_dce,
const struct out_csc_color_matrix *tbl_entry,
enum grph_color_adjust_option options)
{ … }
static bool configure_graphics_mode(
struct dce_transform *xfm_dce,
enum csc_color_mode config,
enum graphics_csc_adjust_type csc_adjust_type,
enum dc_color_space color_space)
{ … }
void dce110_opp_set_csc_adjustment(
struct transform *xfm,
const struct out_csc_color_matrix *tbl_entry)
{ … }
void dce110_opp_set_csc_default(
struct transform *xfm,
const struct default_adjustment *default_adjust)
{ … }
static void program_pwl(struct dce_transform *xfm_dce,
const struct pwl_params *params)
{ … }
static void regamma_config_regions_and_segments(struct dce_transform *xfm_dce,
const struct pwl_params *params)
{ … }
void dce110_opp_program_regamma_pwl(struct transform *xfm,
const struct pwl_params *params)
{ … }
void dce110_opp_power_on_regamma_lut(struct transform *xfm,
bool power_on)
{ … }
void dce110_opp_set_regamma_mode(struct transform *xfm,
enum opp_regamma mode)
{ … }
static const struct transform_funcs dce_transform_funcs = …;
#if defined(CONFIG_DRM_AMD_DC_SI)
static const struct transform_funcs dce60_transform_funcs = …;
#endif
void dce_transform_construct(
struct dce_transform *xfm_dce,
struct dc_context *ctx,
uint32_t inst,
const struct dce_transform_registers *regs,
const struct dce_transform_shift *xfm_shift,
const struct dce_transform_mask *xfm_mask)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
void dce60_transform_construct(
struct dce_transform *xfm_dce,
struct dc_context *ctx,
uint32_t inst,
const struct dce_transform_registers *regs,
const struct dce_transform_shift *xfm_shift,
const struct dce_transform_mask *xfm_mask)
{ … }
#endif