linux/drivers/gpu/drm/amd/display/dc/resource/dcn303/dcn303_resource.c

// SPDX-License-Identifier: MIT
/*
 * Copyright (C) 2021 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: AMD
 */

#include "dcn303/dcn303_init.h"
#include "dcn303_resource.h"
#include "dcn303/dcn303_dccg.h"
#include "irq/dcn303/irq_service_dcn303.h"

#include "dcn30/dcn30_dio_link_encoder.h"
#include "dcn30/dcn30_dio_stream_encoder.h"
#include "dcn30/dcn30_dpp.h"
#include "dcn30/dcn30_dwb.h"
#include "dcn30/dcn30_hubbub.h"
#include "dcn30/dcn30_hubp.h"
#include "dcn30/dcn30_mmhubbub.h"
#include "dcn30/dcn30_mpc.h"
#include "dcn30/dcn30_opp.h"
#include "dcn30/dcn30_optc.h"
#include "dcn30/dcn30_resource.h"

#include "dcn20/dcn20_dsc.h"
#include "dcn20/dcn20_resource.h"

#include "dml/dcn30/dcn30_fpu.h"

#include "dcn10/dcn10_resource.h"

#include "link.h"

#include "dce/dce_abm.h"
#include "dce/dce_audio.h"
#include "dce/dce_aux.h"
#include "dce/dce_clock_source.h"
#include "dce/dce_hwseq.h"
#include "dce/dce_i2c_hw.h"
#include "dce/dce_panel_cntl.h"
#include "dce/dmub_abm.h"
#include "dce/dmub_psr.h"
#include "clk_mgr.h"

#include "hw_sequencer_private.h"
#include "reg_helper.h"
#include "resource.h"
#include "vm_helper.h"

#include "sienna_cichlid_ip_offset.h"
#include "dcn/dcn_3_0_3_offset.h"
#include "dcn/dcn_3_0_3_sh_mask.h"
#include "dpcs/dpcs_3_0_3_offset.h"
#include "dpcs/dpcs_3_0_3_sh_mask.h"
#include "nbio/nbio_2_3_offset.h"

#include "dml/dcn303/dcn303_fpu.h"

#define DC_LOGGER
#define DC_LOGGER_INIT(logger)


static const struct dc_debug_options debug_defaults_drv =;

static const struct dc_panel_config panel_config_defaults =;

enum dcn303_clk_src_array_id {};

static const struct resource_caps res_cap_dcn303 =;

static const struct dc_plane_cap plane_cap =;

/* NBIO */
#define NBIO_BASE_INNER(seg)

#define NBIO_BASE(seg)

#define NBIO_SR(reg_name)

/* DCN */
#define BASE_INNER(seg)

#define BASE(seg)

#define SR(reg_name)

#define SF(reg_name, field_name, post_fix)

#define SRI(reg_name, block, id)

#define SRI2(reg_name, block, id)

#define SRII(reg_name, block, id)

#define DCCG_SRII(reg_name, block, id)

#define VUPDATE_SRII(reg_name, block, id)

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

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

#define SRII_MPC_RMU(reg_name, block, id)

static const struct dcn_hubbub_registers hubbub_reg =;

static const struct dcn_hubbub_shift hubbub_shift =;

static const struct dcn_hubbub_mask hubbub_mask =;

#define vmid_regs(id)

static const struct dcn_vmid_registers vmid_regs[] =;

static const struct dcn20_vmid_shift vmid_shifts =;

static const struct dcn20_vmid_mask vmid_masks =;

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

#define vpg_regs(id)

static const struct dcn30_vpg_registers vpg_regs[] =;

static const struct dcn30_vpg_shift vpg_shift =;

static const struct dcn30_vpg_mask vpg_mask =;

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

#define afmt_regs(id)

static const struct dcn30_afmt_registers afmt_regs[] =;

static const struct dcn30_afmt_shift afmt_shift =;

static const struct dcn30_afmt_mask afmt_mask =;

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

#define audio_regs(id)

static const struct dce_audio_registers audio_regs[] =;

#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 =;

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

#define stream_enc_regs(id)

static const struct dcn10_stream_enc_registers stream_enc_regs[] =;

static const struct dcn10_stream_encoder_shift se_shift =;

static const struct dcn10_stream_encoder_mask se_mask =;

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

#define clk_src_regs(index, pllid)

static const struct dce110_clk_src_regs clk_src_regs[] =;

static const struct dce110_clk_src_shift cs_shift =;

static const struct dce110_clk_src_mask cs_mask =;

static struct clock_source *dcn303_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 const struct dce_hwseq_registers hwseq_reg =;

static const struct dce_hwseq_shift hwseq_shift =;

static const struct dce_hwseq_mask hwseq_mask =;

static struct dce_hwseq *dcn303_hwseq_create(struct dc_context *ctx)
{}

#define hubp_regs(id)

static const struct dcn_hubp2_registers hubp_regs[] =;

static const struct dcn_hubp2_shift hubp_shift =;

static const struct dcn_hubp2_mask hubp_mask =;

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

#define dpp_regs(id)

static const struct dcn3_dpp_registers dpp_regs[] =;

static const struct dcn3_dpp_shift tf_shift =;

static const struct dcn3_dpp_mask tf_mask =;

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

#define opp_regs(id)

static const struct dcn20_opp_registers opp_regs[] =;

static const struct dcn20_opp_shift opp_shift =;

static const struct dcn20_opp_mask opp_mask =;

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

#define optc_regs(id)

static const struct dcn_optc_registers optc_regs[] =;

static const struct dcn_optc_shift optc_shift =;

static const struct dcn_optc_mask optc_mask =;

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

static const struct dcn30_mpc_registers mpc_regs =;

static const struct dcn30_mpc_shift mpc_shift =;

static const struct dcn30_mpc_mask mpc_mask =;

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

#define dsc_regsDCN20(id)

static const struct dcn20_dsc_registers dsc_regs[] =;

static const struct dcn20_dsc_shift dsc_shift =;

static const struct dcn20_dsc_mask dsc_mask =;

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

#define dwbc_regs_dcn3(id)

static const struct dcn30_dwbc_registers dwbc30_regs[] =;

static const struct dcn30_dwbc_shift dwbc30_shift =;

static const struct dcn30_dwbc_mask dwbc30_mask =;

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

#define mcif_wb_regs_dcn3(id)

static const struct dcn30_mmhubbub_registers mcif_wb30_regs[] =;

static const struct dcn30_mmhubbub_shift mcif_wb30_shift =;

static const struct dcn30_mmhubbub_mask mcif_wb30_mask =;

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

#define aux_engine_regs(id)

static const struct dce110_aux_registers aux_engine_regs[] =;

static const struct dce110_aux_registers_shift aux_shift =;

static const struct dce110_aux_registers_mask aux_mask =;

static struct dce_aux *dcn303_aux_engine_create(struct dc_context *ctx, uint32_t inst)
{}

#define i2c_inst_regs(id)

static const struct dce_i2c_registers i2c_hw_regs[] =;

static const struct dce_i2c_shift i2c_shifts =;

static const struct dce_i2c_mask i2c_masks =;

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

static const struct encoder_feature_support link_enc_feature =;

#define link_regs(id, phyid)

static const struct dcn10_link_enc_registers link_enc_regs[] =;

static const struct dcn10_link_enc_shift le_shift =;

static const struct dcn10_link_enc_mask le_mask =;

#define aux_regs(id)

static const struct dcn10_link_enc_aux_registers link_enc_aux_regs[] =;

#define hpd_regs(id)

static const struct dcn10_link_enc_hpd_registers link_enc_hpd_regs[] =;

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

static const struct dce_panel_cntl_registers panel_cntl_regs[] =;

static const struct dce_panel_cntl_shift panel_cntl_shift =;

static const struct dce_panel_cntl_mask panel_cntl_mask =;

static struct panel_cntl *dcn303_panel_cntl_create(const struct panel_cntl_init_data *init_data)
{}

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

static const struct resource_create_funcs res_create_funcs =;

static bool is_soc_bounding_box_valid(struct dc *dc)
{}

static bool init_soc_bounding_box(struct dc *dc,  struct resource_pool *pool)
{}

static void dcn303_resource_destruct(struct resource_pool *pool)
{}

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

static void dcn303_get_panel_config_defaults(struct dc_panel_config *panel_config)
{}

void dcn303_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
{}

static struct resource_funcs dcn303_res_pool_funcs =;

static struct dc_cap_funcs cap_funcs =;

static const struct bios_registers bios_regs =;

static const struct dccg_registers dccg_regs =;

static const struct dccg_shift dccg_shift =;

static const struct dccg_mask dccg_mask =;

#define abm_regs(id)

static const struct dce_abm_registers abm_regs[] =;

static const struct dce_abm_shift abm_shift =;

static const struct dce_abm_mask abm_mask =;

static bool dcn303_resource_construct(
		uint8_t num_virtual_links,
		struct dc *dc,
		struct resource_pool *pool)
{}

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