linux/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c

/*
 * Copyright 2020 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 "dccg.h"
#include "clk_mgr_internal.h"

// For dce12_get_dp_ref_freq_khz
#include "dce100/dce_clk_mgr.h"

// For dcn20_update_clocks_update_dpp_dto
#include "dcn20/dcn20_clk_mgr.h"

// For DML FPU code
#include "dml/dcn20/dcn20_fpu.h"

#include "vg_clk_mgr.h"
#include "dcn301_smu.h"
#include "reg_helper.h"
#include "core_types.h"
#include "dm_helpers.h"

#include "atomfirmware.h"
#include "vangogh_ip_offset.h"
#include "clk/clk_11_5_0_offset.h"
#include "clk/clk_11_5_0_sh_mask.h"

/* Constants */

#define LPDDR_MEM_RETRAIN_LATENCY

/* Macros */

#define TO_CLK_MGR_VGH(clk_mgr)

#define REG(reg_name)

/* TODO: evaluate how to lower or disable all dcn clocks in screen off case */
static int vg_get_active_display_cnt_wa(
		struct dc *dc,
		struct dc_state *context)
{}

static void vg_update_clocks(struct clk_mgr *clk_mgr_base,
			     struct dc_state *context,
			     bool safe_to_lower)
{}


static int get_vco_frequency_from_reg(struct clk_mgr_internal *clk_mgr)
{}

static void vg_dump_clk_registers_internal(struct dcn301_clk_internal *internal, struct clk_mgr *clk_mgr_base)
{}

/* This function collect raw clk register values */
static void vg_dump_clk_registers(struct clk_state_registers_and_bypass *regs_and_bypass,
		struct clk_mgr *clk_mgr_base, struct clk_log_info *log_info)
{}

static void vg_enable_pme_wa(struct clk_mgr *clk_mgr_base)
{}

static void vg_init_clocks(struct clk_mgr *clk_mgr)
{}

static void vg_build_watermark_ranges(struct clk_bw_params *bw_params, struct watermarks *table)
{}


static void vg_notify_wm_ranges(struct clk_mgr *clk_mgr_base)
{}

static bool vg_are_clock_states_equal(struct dc_clocks *a,
		struct dc_clocks *b)
{}


static struct clk_mgr_funcs vg_funcs =;

static struct clk_bw_params vg_bw_params =;

static uint32_t find_max_clk_value(const uint32_t clocks[], uint32_t num_clocks)
{}

static unsigned int find_dcfclk_for_voltage(const struct vg_dpm_clocks *clock_table,
		unsigned int voltage)
{}

static void vg_clk_mgr_helper_populate_bw_params(
		struct clk_mgr_internal *clk_mgr,
		struct integrated_info *bios_info,
		const struct vg_dpm_clocks *clock_table)
{}

/* Temporary Place holder until we can get them from fuse */
static struct vg_dpm_clocks dummy_clocks =;

static struct watermarks dummy_wms =;

static void vg_get_dpm_table_from_smu(struct clk_mgr_internal *clk_mgr,
		struct smu_dpm_clks *smu_dpm_clks)
{}

void vg_clk_mgr_construct(
		struct dc_context *ctx,
		struct clk_mgr_vgh *clk_mgr,
		struct pp_smu_funcs *pp_smu,
		struct dccg *dccg)
{}

void vg_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr_int)
{}