linux/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c

// SPDX-License-Identifier: MIT
//
// Copyright 2024 Advanced Micro Devices, Inc.

#include "dc_spl.h"
#include "dc_spl_scl_filters.h"
#include "dc_spl_isharp_filters.h"

#define IDENTITY_RATIO(ratio)
#define MIN_VIEWPORT_SIZE

static struct spl_rect intersect_rec(const struct spl_rect *r0, const struct spl_rect *r1)
{}

static struct spl_rect shift_rec(const struct spl_rect *rec_in, int x, int y)
{}

static struct spl_rect calculate_plane_rec_in_timing_active(
		struct spl_in *spl_in,
		const struct spl_rect *rec_in)
{}

static struct spl_rect calculate_mpc_slice_in_timing_active(
		struct spl_in *spl_in,
		struct spl_rect *plane_clip_rec)
{}

static struct spl_rect calculate_odm_slice_in_timing_active(struct spl_in *spl_in)
{}

static void spl_calculate_recout(struct spl_in *spl_in, struct spl_out *spl_out)
{}
/* Calculate scaling ratios */
static void spl_calculate_scaling_ratios(struct spl_in *spl_in, struct spl_out *spl_out)
{}
/* Calculate Viewport size */
static void spl_calculate_viewport_size(struct spl_in *spl_in, struct spl_out *spl_out)
{}
static void spl_get_vp_scan_direction(enum spl_rotation_angle rotation,
			   bool horizontal_mirror,
			   bool *orthogonal_rotation,
			   bool *flip_vert_scan_dir,
			   bool *flip_horz_scan_dir)
{}
/*
 * We completely calculate vp offset, size and inits here based entirely on scaling
 * ratios and recout for pixel perfect pipe combine.
 */
static void spl_calculate_init_and_vp(bool flip_scan_dir,
				int recout_offset_within_recout_full,
				int recout_size,
				int src_size,
				int taps,
				struct fixed31_32 ratio,
				struct fixed31_32 init_adj,
				struct fixed31_32 *init,
				int *vp_offset,
				int *vp_size)
{}

static bool spl_is_yuv420(enum spl_pixel_format format)
{}

/*Calculate inits and viewport */
static void spl_calculate_inits_and_viewports(struct spl_in *spl_in, struct spl_out *spl_out)
{}
static void spl_handle_3d_recout(struct spl_in *spl_in, struct spl_rect *recout)
{}

static void spl_clamp_viewport(struct spl_rect *viewport)
{}
static bool spl_dscl_is_420_format(enum spl_pixel_format format)
{}
static bool spl_dscl_is_video_format(enum spl_pixel_format format)
{}
static enum scl_mode spl_get_dscl_mode(const struct spl_in *spl_in,
				const struct spl_scaler_data *data)
{}
/* Calculate optimal number of taps */
static bool spl_get_optimal_number_of_taps(
	  int max_downscale_src_width, struct spl_in *spl_in, struct spl_out *spl_out,
	  const struct spl_taps *in_taps)
{}
static void spl_set_black_color_data(enum spl_pixel_format format,
			struct scl_black_color *scl_black_color)
{}

static void spl_set_manual_ratio_init_data(struct dscl_prog_data *dscl_prog_data,
		const struct spl_scaler_data *scl_data)
{}

static void spl_set_taps_data(struct dscl_prog_data *dscl_prog_data,
		const struct spl_scaler_data *scl_data)
{}
static const uint16_t *spl_dscl_get_filter_coeffs_64p(int taps, struct fixed31_32 ratio)
{}
static void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data,
		const struct spl_scaler_data *data)
{}

static const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps)
{}
static void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data,
		const struct spl_scaler_data *data)
{}

/* Populate dscl prog data structure from scaler data calculated by SPL */
static void spl_set_dscl_prog_data(struct spl_in *spl_in, struct spl_out *spl_out)
{}
/* Enable EASF ?*/
static bool enable_easf(int scale_ratio, int taps,
		enum linear_light_scaling lls_pref, bool prefer_easf)
{}
/* Set EASF data */
static void spl_set_easf_data(struct dscl_prog_data *dscl_prog_data,
	bool enable_easf_v, bool enable_easf_h, enum linear_light_scaling lls_pref,
	enum spl_pixel_format format)
{}
/*Set isharp noise detection */
static void spl_set_isharp_noise_det_mode(struct dscl_prog_data *dscl_prog_data)
{
	// ISHARP_NOISEDET_MODE
	// 0: 3x5 as VxH
	// 1: 4x5 as VxH
	// 2:
	// 3: 5x5 as VxH
	if (dscl_prog_data->taps.v_taps == 6)
		dscl_prog_data->isharp_noise_det.mode = 3;	// ISHARP_NOISEDET_MODE
	else if (dscl_prog_data->taps.h_taps == 4)
		dscl_prog_data->isharp_noise_det.mode = 1;	// ISHARP_NOISEDET_MODE
	else if (dscl_prog_data->taps.h_taps == 3)
		dscl_prog_data->isharp_noise_det.mode = 0;	// ISHARP_NOISEDET_MODE
};
/* Set Sharpener data */
static void spl_set_isharp_data(struct dscl_prog_data *dscl_prog_data,
		struct adaptive_sharpness adp_sharpness, bool enable_isharp,
		enum linear_light_scaling lls_pref, enum spl_pixel_format format,
		const struct spl_scaler_data *data)
{}
static bool spl_get_isharp_en(struct adaptive_sharpness adp_sharpness,
		int vscale_ratio, int hscale_ratio, struct spl_taps taps,
		enum spl_pixel_format format)
{}

static bool spl_choose_lls_policy(enum spl_pixel_format format,
	enum spl_transfer_func_type tf_type,
	enum spl_transfer_func_predefined tf_predefined_type,
	enum linear_light_scaling *lls_pref)
{}

/* Calculate scaler parameters */
bool spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out)
{}