#include <linux/device.h>
#include "ipu3-css.h"
#include "ipu3-css-fw.h"
#include "ipu3-tables.h"
#include "ipu3-css-params.h"
#define DIV_ROUND_CLOSEST_DOWN(a, b) …
#define roundclosest_down(a, b) …
#define IPU3_UAPI_ANR_MAX_RESET …
#define IPU3_UAPI_ANR_MIN_RESET …
struct imgu_css_scaler_info { … };
static unsigned int imgu_css_scaler_get_exp(unsigned int counter,
unsigned int divider)
{ … }
static void
imgu_css_scaler_setup_lut(unsigned int taps, unsigned int input_width,
unsigned int output_width, int phase_step_correction,
const int *coeffs, unsigned int coeffs_size,
s8 coeff_lut[], struct imgu_css_scaler_info *info)
{ … }
static unsigned int
imgu_css_scaler_calc_scaled_output(unsigned int input,
struct imgu_css_scaler_info *info)
{ … }
static void
imgu_css_scaler_calc(u32 input_width, u32 input_height, u32 target_width,
u32 target_height, struct imgu_abi_osys_config *cfg,
struct imgu_css_scaler_info *info_luma,
struct imgu_css_scaler_info *info_chroma,
unsigned int *output_width, unsigned int *output_height,
unsigned int *procmode)
{ … }
static void imgu_css_osys_set_format(enum imgu_abi_frame_format host_format,
unsigned int *osys_format,
unsigned int *osys_tiling)
{ … }
static int imgu_css_osys_calc_stripe_offset(int stripe_offset_out,
int fir_phases, int phase_init,
int phase_step, int pad_left)
{ … }
static int imgu_css_osys_calc_stripe_phase_init(int stripe_offset_out,
int fir_phases, int phase_init,
int phase_step, int pad_left)
{ … }
static int imgu_css_osys_calc_inp_stripe_width(int stripe_width_out,
int fir_phases, int phase_init,
int phase_step, int fir_taps,
int pad_left, int pad_right)
{ … }
static int imgu_css_osys_out_stripe_width(int stripe_width_inp, int fir_phases,
int phase_init, int phase_step,
int fir_taps, int pad_left,
int pad_right, int column_offset)
{ … }
struct imgu_css_reso { … };
struct imgu_css_frame_params { … };
struct imgu_css_stripe_params { … };
static int imgu_css_osys_calc_frame_and_stripe_params(
struct imgu_css *css, unsigned int stripes,
struct imgu_abi_osys_config *osys,
struct imgu_css_scaler_info *scaler_luma,
struct imgu_css_scaler_info *scaler_chroma,
struct imgu_css_frame_params frame_params[],
struct imgu_css_stripe_params stripe_params[],
unsigned int pipe)
{ … }
static int imgu_css_osys_calc(struct imgu_css *css, unsigned int pipe,
unsigned int stripes,
struct imgu_abi_osys_config *osys,
struct imgu_css_scaler_info *scaler_luma,
struct imgu_css_scaler_info *scaler_chroma,
struct imgu_abi_stripes block_stripes[])
{ … }
static int
imgu_css_shd_ops_calc(struct imgu_abi_shd_intra_frame_operations_data *ops,
const struct ipu3_uapi_shd_grid_config *grid,
unsigned int image_height)
{ … }
struct process_lines { … };
static int
imgu_css_acc_process_lines(const struct process_lines *pl,
struct imgu_abi_acc_operation *p_op,
struct imgu_abi_acc_process_lines_cmd_data *p_pl,
struct imgu_abi_acc_transfer_op_data *p_tr)
{ … }
static int imgu_css_af_ops_calc(struct imgu_css *css, unsigned int pipe,
struct imgu_abi_af_config *af_config)
{ … }
static int
imgu_css_awb_fr_ops_calc(struct imgu_css *css, unsigned int pipe,
struct imgu_abi_awb_fr_config *awb_fr_config)
{ … }
static int imgu_css_awb_ops_calc(struct imgu_css *css, unsigned int pipe,
struct imgu_abi_awb_config *awb_config)
{ … }
static u16 imgu_css_grid_end(u16 start, u8 width, u8 block_width_log2)
{ … }
static void imgu_css_grid_end_calc(struct ipu3_uapi_grid_config *grid_cfg)
{ … }
static int imgu_css_cfg_acc_stripe(struct imgu_css *css, unsigned int pipe,
struct imgu_abi_acc_param *acc)
{ … }
static void imgu_css_cfg_acc_dvs(struct imgu_css *css,
struct imgu_abi_acc_param *acc,
unsigned int pipe)
{ … }
static void acc_bds_per_stripe_data(struct imgu_css *css,
struct imgu_abi_acc_param *acc,
const int i, unsigned int pipe)
{ … }
int imgu_css_cfg_acc(struct imgu_css *css, unsigned int pipe,
struct ipu3_uapi_flags *use,
struct imgu_abi_acc_param *acc,
struct imgu_abi_acc_param *acc_old,
struct ipu3_uapi_acc_param *acc_user)
{ … }
static void *imgu_css_cfg_copy(struct imgu_css *css,
unsigned int pipe, bool use_user,
void *user_setting, void *old_binary_params,
void *new_binary_params,
enum imgu_abi_memories m,
struct imgu_fw_isp_parameter *par,
size_t par_size)
{ … }
int imgu_css_cfg_vmem0(struct imgu_css *css, unsigned int pipe,
struct ipu3_uapi_flags *use,
void *vmem0, void *vmem0_old,
struct ipu3_uapi_params *user)
{ … }
int imgu_css_cfg_dmem0(struct imgu_css *css, unsigned int pipe,
struct ipu3_uapi_flags *use,
void *dmem0, void *dmem0_old,
struct ipu3_uapi_params *user)
{ … }
void imgu_css_cfg_gdc_table(struct imgu_abi_gdc_warp_param *gdc,
int frame_in_x, int frame_in_y,
int frame_out_x, int frame_out_y,
int env_w, int env_h)
{ … }