linux/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c

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

#include "dm_services.h"
#include "dc.h"

#include "dcn32/dcn32_init.h"
#include "dcn401/dcn401_init.h"

#include "resource.h"
#include "include/irq_service_interface.h"
#include "dcn401_resource.h"

#include "dcn20/dcn20_resource.h"
#include "dcn30/dcn30_resource.h"
#include "dcn32/dcn32_resource.h"
#include "dcn321/dcn321_resource.h"

#include "dcn10/dcn10_ipp.h"
#include "dcn401/dcn401_hubbub.h"
#include "dcn401/dcn401_mpc.h"
#include "dcn401/dcn401_hubp.h"
#include "irq/dcn401/irq_service_dcn401.h"
#include "dcn401/dcn401_dpp.h"
#include "dcn401/dcn401_optc.h"
#include "dcn20/dcn20_hwseq.h"
#include "dcn30/dcn30_hwseq.h"
#include "dce110/dce110_hwseq.h"
#include "dcn20/dcn20_opp.h"
#include "dcn401/dcn401_dsc.h"
#include "dcn30/dcn30_vpg.h"
#include "dcn31/dcn31_vpg.h"
#include "dcn30/dcn30_afmt.h"
#include "dcn30/dcn30_dio_stream_encoder.h"
#include "dcn401/dcn401_dio_stream_encoder.h"
#include "dcn31/dcn31_hpo_dp_stream_encoder.h"
#include "dcn31/dcn31_hpo_dp_link_encoder.h"
#include "dcn32/dcn32_hpo_dp_link_encoder.h"
#include "dcn31/dcn31_apg.h"
#include "dcn31/dcn31_dio_link_encoder.h"
#include "dcn401/dcn401_dio_link_encoder.h"
#include "dcn10/dcn10_link_encoder.h"
#include "dcn321/dcn321_dio_link_encoder.h"
#include "dce/dce_clock_source.h"
#include "dce/dce_audio.h"
#include "dce/dce_hwseq.h"
#include "clk_mgr.h"
#include "virtual/virtual_stream_encoder.h"
#include "dml/display_mode_vba.h"
#include "dcn401/dcn401_dccg.h"
#include "dcn10/dcn10_resource.h"
#include "link.h"
#include "link_enc_cfg.h"
#include "dcn31/dcn31_panel_cntl.h"

#include "dcn30/dcn30_dwb.h"
#include "dcn32/dcn32_mmhubbub.h"

#include "dcn/dcn_4_1_0_offset.h"
#include "dcn/dcn_4_1_0_sh_mask.h"
#include "nbif/nbif_6_3_1_offset.h"

#include "reg_helper.h"
#include "dce/dmub_abm.h"
#include "dce/dmub_psr.h"
#include "dce/dce_aux.h"
#include "dce/dce_i2c.h"

#include "dml/dcn30/display_mode_vba_30.h"
#include "vm_helper.h"
#include "dcn20/dcn20_vmid.h"
#include "dml/dcn401/dcn401_fpu.h"

#include "dc_state_priv.h"

#include "dml2/dml2_wrapper.h"

#define DC_LOGGER_INIT(logger)

enum dcn401_clk_src_array_id {};

/* begin *********************
 * macros to expend register list macro defined in HW object header file
 */

/* DCN */
#define BASE_INNER(seg)

#define BASE(seg)

#define SR(reg_name)
#define SR_ARR(reg_name, id)
#define SR_ARR_INIT(reg_name, id, value)

#define SRI(reg_name, block, id)

#define SRI_ARR(reg_name, block, id)

/*
 * Used when a reg_name would otherwise begin with an integer
 */
#define SRI_ARR_US(reg_name, block, id)
#define SR_ARR_I2C(reg_name, id)

#define SRI_ARR_I2C(reg_name, block, id)

#define SRI_ARR_ALPHABET(reg_name, block, index, id)

#define SRI2(reg_name, block, id)
#define SRI2_ARR(reg_name, block, id)

#define SRIR(var_name, reg_name, block, id)

#define SRII(reg_name, block, id)

#define SRII_ARR_2(reg_name, block, id, inst)

#define SRII_MPC_RMU(reg_name, block, id)

#define SRII_DWB(reg_name, temp_name, block, id)

#define DCCG_SRII(reg_name, block, id)

#define SF_DWB2(reg_name, block, id, field_name, post_fix)

#define VUPDATE_SRII(reg_name, block, id)

/* NBIO */
#define NBIO_BASE_INNER(seg)

#define NBIO_BASE(seg)

#define NBIO_SR(reg_name)
#define NBIO_SR_ARR(reg_name, id)

#define CTX
#define REG(reg_name)

static struct bios_registers bios_regs;

#define bios_regs_init()

#define clk_src_regs_init(index, pllid)

static struct dce110_clk_src_regs clk_src_regs[5];

static const struct dce110_clk_src_shift cs_shift =;

static const struct dce110_clk_src_mask cs_mask =;

#define abm_regs_init(id)

static struct dce_abm_registers abm_regs[4];

static const struct dce_abm_shift abm_shift =;

static const struct dce_abm_mask abm_mask =;

#define audio_regs_init(id)

static struct dce_audio_registers audio_regs[5];

#define DCE120_AUD_COMMON_MASK_SH_LIST(mask_sh)

static const struct dce_audio_shift audio_shift =;

static const struct dce_audio_mask audio_mask =;

#define vpg_regs_init(id)

static struct dcn31_vpg_registers vpg_regs[9];

static const struct dcn31_vpg_shift vpg_shift =;

static const struct dcn31_vpg_mask vpg_mask =;

#define afmt_regs_init(id)

static struct dcn30_afmt_registers afmt_regs[5];

static const struct dcn30_afmt_shift afmt_shift =;

static const struct dcn30_afmt_mask afmt_mask =;

#define apg_regs_init(id)

static struct dcn31_apg_registers apg_regs[4];

static const struct dcn31_apg_shift apg_shift =;

static const struct dcn31_apg_mask apg_mask =;

#define stream_enc_regs_init(id)

static struct dcn10_stream_enc_registers stream_enc_regs[4];

static const struct dcn10_stream_encoder_shift se_shift =;

static const struct dcn10_stream_encoder_mask se_mask =;

#define aux_regs_init(id)

static struct dcn10_link_enc_aux_registers link_enc_aux_regs[5];

#define hpd_regs_init(id)

static struct dcn10_link_enc_hpd_registers link_enc_hpd_regs[5];

#define link_regs_init(id, phyid)

static struct dcn10_link_enc_registers link_enc_regs[4];


static const struct dcn10_link_enc_shift le_shift =;


static const struct dcn10_link_enc_mask le_mask =;


#define hpo_dp_stream_encoder_reg_init(id)

static struct dcn31_hpo_dp_stream_encoder_registers hpo_dp_stream_enc_regs[4];

static const struct dcn31_hpo_dp_stream_encoder_shift hpo_dp_se_shift =;

static const struct dcn31_hpo_dp_stream_encoder_mask hpo_dp_se_mask =;


#define hpo_dp_link_encoder_reg_init(id)
	/*DCN3_1_RDPCSTX_REG_LIST(0),*/
	/*DCN3_1_RDPCSTX_REG_LIST(1),*/
	/*DCN3_1_RDPCSTX_REG_LIST(2),*/
	/*DCN3_1_RDPCSTX_REG_LIST(3),*/

static struct dcn31_hpo_dp_link_encoder_registers hpo_dp_link_enc_regs[4];

static const struct dcn31_hpo_dp_link_encoder_shift hpo_dp_le_shift =;

static const struct dcn31_hpo_dp_link_encoder_mask hpo_dp_le_mask =;

#define dpp_regs_init(id)

static struct dcn401_dpp_registers dpp_regs[4];

static const struct dcn401_dpp_shift tf_shift =;

static const struct dcn401_dpp_mask tf_mask =;

#define opp_regs_init(id)

static struct dcn20_opp_registers opp_regs[4];

static const struct dcn20_opp_shift opp_shift =;

static const struct dcn20_opp_mask opp_mask =;

#define aux_engine_regs_init(id)

static struct dce110_aux_registers aux_engine_regs[5];

static const struct dce110_aux_registers_shift aux_shift =;

static const struct dce110_aux_registers_mask aux_mask =;

#define dwbc_regs_dcn401_init(id)

static struct dcn30_dwbc_registers dwbc401_regs[1];

static const struct dcn30_dwbc_shift dwbc401_shift =;

static const struct dcn30_dwbc_mask dwbc401_mask =;


#define mcif_wb_regs_dcn3_init(id)

static struct dcn30_mmhubbub_registers mcif_wb30_regs[1];

static const struct dcn30_mmhubbub_shift mcif_wb30_shift =;

static const struct dcn30_mmhubbub_mask mcif_wb30_mask =;

#define dsc_regs_init(id)

static struct dcn401_dsc_registers dsc_regs[4];

static const struct dcn401_dsc_shift dsc_shift =;

static const struct dcn401_dsc_mask dsc_mask =;

static struct dcn401_mpc_registers mpc_regs;

#define dcn_mpc_regs_init()

static const struct dcn401_mpc_shift mpc_shift =;

static const struct dcn401_mpc_mask mpc_mask =;

#define optc_regs_init(id)

static struct dcn_optc_registers optc_regs[4];

static const struct dcn_optc_shift optc_shift =;

static const struct dcn_optc_mask optc_mask =;

#define hubp_regs_init(id)

static struct dcn_hubp2_registers hubp_regs[4];

static const struct dcn_hubp2_shift hubp_shift =;

static const struct dcn_hubp2_mask hubp_mask =;

static struct dcn_hubbub_registers hubbub_reg;
#define hubbub_reg_init()

static const struct dcn_hubbub_shift hubbub_shift =;

static const struct dcn_hubbub_mask hubbub_mask =;

static struct dccg_registers dccg_regs;

#define dccg_regs_init()

static const struct dccg_shift dccg_shift =;

static const struct dccg_mask dccg_mask =;

#define SRII2(reg_name_pre, reg_name_post, id)


#define HWSEQ_DCN401_REG_LIST()

static struct dce_hwseq_registers hwseq_reg;

#define hwseq_reg_init()

#define HWSEQ_DCN401_MASK_SH_LIST(mask_sh)

static const struct dce_hwseq_shift hwseq_shift =;

static const struct dce_hwseq_mask hwseq_mask =;

#define vmid_regs_init(id)

static struct dcn_vmid_registers vmid_regs[16];

static const struct dcn20_vmid_shift vmid_shifts =;

static const struct dcn20_vmid_mask vmid_masks =;

static const struct resource_caps res_cap_dcn4_01 =;

static const struct dc_plane_cap plane_cap =;

static const struct dc_debug_options debug_defaults_drv =;

static struct dce_aux *dcn401_aux_engine_create(
	struct dc_context *ctx,
	uint32_t inst)
{}
#define i2c_inst_regs_init(id)

static struct dce_i2c_registers i2c_hw_regs[5];

static const struct dce_i2c_shift i2c_shifts =;

static const struct dce_i2c_mask i2c_masks =;

static struct dce_i2c_hw *dcn401_i2c_hw_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static struct clock_source *dcn401_clock_source_create(
		struct dc_context *ctx,
		struct dc_bios *bios,
		enum clock_source_id id,
		const struct dce110_clk_src_regs *regs,
		bool dp_clk_src)
{}

static struct hubbub *dcn401_hubbub_create(struct dc_context *ctx)
{}

static struct hubp *dcn401_hubp_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static void dcn401_dpp_destroy(struct dpp **dpp)
{}

static struct dpp *dcn401_dpp_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static struct mpc *dcn401_mpc_create(
		struct dc_context *ctx,
		int num_mpcc,
		int num_rmu)
{}

static struct output_pixel_processor *dcn401_opp_create(
	struct dc_context *ctx, uint32_t inst)
{}


static struct timing_generator *dcn401_timing_generator_create(
		struct dc_context *ctx,
		uint32_t instance)
{}

static const struct encoder_feature_support link_enc_feature =;

static struct link_encoder *dcn401_link_encoder_create(
	struct dc_context *ctx,
	const struct encoder_init_data *enc_init_data)
{}

static void read_dce_straps(
	struct dc_context *ctx,
	struct resource_straps *straps)
{}

static struct audio *dcn401_create_audio(
		struct dc_context *ctx, unsigned int inst)
{}

static struct vpg *dcn401_vpg_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static struct afmt *dcn401_afmt_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static struct apg *dcn401_apg_create(
	struct dc_context *ctx,
	uint32_t inst)
{}

static struct stream_encoder *dcn401_stream_encoder_create(
	enum engine_id eng_id,
	struct dc_context *ctx)
{}

static struct hpo_dp_stream_encoder *dcn401_hpo_dp_stream_encoder_create(
	enum engine_id eng_id,
	struct dc_context *ctx)
{}

static struct hpo_dp_link_encoder *dcn401_hpo_dp_link_encoder_create(
	uint8_t inst,
	struct dc_context *ctx)
{}

static struct dce_hwseq *dcn401_hwseq_create(
	struct dc_context *ctx)
{}
static const struct resource_create_funcs res_create_funcs =;

static void dcn401_dsc_destroy(struct display_stream_compressor **dsc)
{}

static void dcn401_resource_destruct(struct dcn401_resource_pool *pool)
{}


static bool dcn401_dwbc_create(struct dc_context *ctx, struct resource_pool *pool)
{}

static bool dcn401_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool)
{}

static struct display_stream_compressor *dcn401_dsc_create(
	struct dc_context *ctx, uint32_t inst)
{}

static void dcn401_destroy_resource_pool(struct resource_pool **pool)
{}

static struct dc_cap_funcs cap_funcs =;

static void dcn401_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
{}

enum dc_status dcn401_patch_unknown_plane_state(struct dc_plane_state *plane_state)
{}

bool dcn401_validate_bandwidth(struct dc *dc,
		struct dc_state *context,
		bool fast_validate)
{}

void dcn401_prepare_mcache_programming(struct dc *dc,
		struct dc_state *context)
{}

static void dcn401_build_pipe_pix_clk_params(struct pipe_ctx *pipe_ctx)
{}

static struct resource_funcs dcn401_res_pool_funcs =;

static uint32_t read_pipe_fuses(struct dc_context *ctx)
{}


static bool dcn401_resource_construct(
	uint8_t num_virtual_links,
	struct dc *dc,
	struct dcn401_resource_pool *pool)
{}

struct resource_pool *dcn401_create_resource_pool(
		const struct dc_init_data *init_data,
		struct dc *dc)
{}