#include <linux/firmware.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <drm/drm_edid.h>
#include <drm/drm_vblank.h>
#include <drm/radeon_drm.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include "atom.h"
#include "avivod.h"
#include "cik.h"
#include "ni.h"
#include "rv770.h"
#include "evergreen.h"
#include "evergreen_blit_shaders.h"
#include "evergreen_reg.h"
#include "evergreend.h"
#include "radeon.h"
#include "radeon_asic.h"
#include "radeon_audio.h"
#include "radeon_ucode.h"
#include "si.h"
#define DC_HPDx_CONTROL(x) …
#define DC_HPDx_INT_CONTROL(x) …
#define DC_HPDx_INT_STATUS_REG(x) …
u32 eg_cg_rreg(struct radeon_device *rdev, u32 reg)
{ … }
void eg_cg_wreg(struct radeon_device *rdev, u32 reg, u32 v)
{ … }
u32 eg_pif_phy0_rreg(struct radeon_device *rdev, u32 reg)
{ … }
void eg_pif_phy0_wreg(struct radeon_device *rdev, u32 reg, u32 v)
{ … }
u32 eg_pif_phy1_rreg(struct radeon_device *rdev, u32 reg)
{ … }
void eg_pif_phy1_wreg(struct radeon_device *rdev, u32 reg, u32 v)
{ … }
static const u32 crtc_offsets[6] = …;
#include "clearstate_evergreen.h"
static const u32 sumo_rlc_save_restore_register_list[] = …;
static void evergreen_gpu_init(struct radeon_device *rdev);
void evergreen_fini(struct radeon_device *rdev);
void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
void evergreen_program_aspm(struct radeon_device *rdev);
static const u32 evergreen_golden_registers[] = …;
static const u32 evergreen_golden_registers2[] = …;
static const u32 cypress_mgcg_init[] = …;
static const u32 redwood_mgcg_init[] = …;
static const u32 cedar_golden_registers[] = …;
static const u32 cedar_mgcg_init[] = …;
static const u32 juniper_mgcg_init[] = …;
static const u32 supersumo_golden_registers[] = …;
static const u32 sumo_golden_registers[] = …;
static const u32 wrestler_golden_registers[] = …;
static const u32 barts_golden_registers[] = …;
static const u32 turks_golden_registers[] = …;
static const u32 caicos_golden_registers[] = …;
static void evergreen_init_golden_registers(struct radeon_device *rdev)
{ … }
int evergreen_get_allowed_info_register(struct radeon_device *rdev,
u32 reg, u32 *val)
{ … }
void evergreen_tiling_fields(unsigned tiling_flags, unsigned *bankw,
unsigned *bankh, unsigned *mtaspect,
unsigned *tile_split)
{ … }
static int sumo_set_uvd_clock(struct radeon_device *rdev, u32 clock,
u32 cntl_reg, u32 status_reg)
{ … }
int sumo_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk)
{ … }
int evergreen_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk)
{ … }
void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)
{ … }
void dce4_program_fmt(struct drm_encoder *encoder)
{ … }
static bool dce4_is_in_vblank(struct radeon_device *rdev, int crtc)
{ … }
static bool dce4_is_counter_moving(struct radeon_device *rdev, int crtc)
{ … }
void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc)
{ … }
void evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base,
bool async)
{ … }
bool evergreen_page_flip_pending(struct radeon_device *rdev, int crtc_id)
{ … }
int evergreen_get_temp(struct radeon_device *rdev)
{ … }
int sumo_get_temp(struct radeon_device *rdev)
{ … }
void sumo_pm_init_profile(struct radeon_device *rdev)
{ … }
void btc_pm_init_profile(struct radeon_device *rdev)
{ … }
void evergreen_pm_misc(struct radeon_device *rdev)
{ … }
void evergreen_pm_prepare(struct radeon_device *rdev)
{ … }
void evergreen_pm_finish(struct radeon_device *rdev)
{ … }
bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
{ … }
void evergreen_hpd_set_polarity(struct radeon_device *rdev,
enum radeon_hpd_id hpd)
{ … }
void evergreen_hpd_init(struct radeon_device *rdev)
{ … }
void evergreen_hpd_fini(struct radeon_device *rdev)
{ … }
static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev,
struct radeon_crtc *radeon_crtc,
struct drm_display_mode *mode,
struct drm_display_mode *other_mode)
{ … }
u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev)
{ … }
struct evergreen_wm_params { … };
static u32 evergreen_dram_bandwidth(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_dram_bandwidth_for_display(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_data_return_bandwidth(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_dmif_request_bandwidth(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_available_bandwidth(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_average_bandwidth(struct evergreen_wm_params *wm)
{ … }
static u32 evergreen_latency_watermark(struct evergreen_wm_params *wm)
{ … }
static bool evergreen_average_bandwidth_vs_dram_bandwidth_for_display(struct evergreen_wm_params *wm)
{
if (evergreen_average_bandwidth(wm) <=
(evergreen_dram_bandwidth_for_display(wm) / wm->num_heads))
return true;
else
return false;
};
static bool evergreen_average_bandwidth_vs_available_bandwidth(struct evergreen_wm_params *wm)
{
if (evergreen_average_bandwidth(wm) <=
(evergreen_available_bandwidth(wm) / wm->num_heads))
return true;
else
return false;
};
static bool evergreen_check_latency_hiding(struct evergreen_wm_params *wm)
{ … }
static void evergreen_program_watermarks(struct radeon_device *rdev,
struct radeon_crtc *radeon_crtc,
u32 lb_size, u32 num_heads)
{ … }
void evergreen_bandwidth_update(struct radeon_device *rdev)
{ … }
int evergreen_mc_wait_for_idle(struct radeon_device *rdev)
{ … }
void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev)
{ … }
static int evergreen_pcie_gart_enable(struct radeon_device *rdev)
{ … }
static void evergreen_pcie_gart_disable(struct radeon_device *rdev)
{ … }
static void evergreen_pcie_gart_fini(struct radeon_device *rdev)
{ … }
static void evergreen_agp_enable(struct radeon_device *rdev)
{ … }
static const unsigned ni_dig_offsets[] = …;
static const unsigned ni_tx_offsets[] = …;
static const unsigned evergreen_dp_offsets[] = …;
static const unsigned evergreen_disp_int_status[] = …;
static bool evergreen_is_dp_sst_stream_enabled(struct radeon_device *rdev,
unsigned crtc_id, unsigned *ret_dig_fe)
{ … }
static void evergreen_blank_dp_output(struct radeon_device *rdev,
unsigned dig_fe)
{ … }
void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save)
{ … }
void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save)
{ … }
void evergreen_mc_program(struct radeon_device *rdev)
{ … }
void evergreen_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib)
{ … }
static int evergreen_cp_load_microcode(struct radeon_device *rdev)
{ … }
static int evergreen_cp_start(struct radeon_device *rdev)
{ … }
static int evergreen_cp_resume(struct radeon_device *rdev)
{ … }
static void evergreen_gpu_init(struct radeon_device *rdev)
{ … }
int evergreen_mc_init(struct radeon_device *rdev)
{ … }
void evergreen_print_gpu_status_regs(struct radeon_device *rdev)
{ … }
bool evergreen_is_display_hung(struct radeon_device *rdev)
{ … }
u32 evergreen_gpu_check_soft_reset(struct radeon_device *rdev)
{ … }
static void evergreen_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
{ … }
void evergreen_gpu_pci_config_reset(struct radeon_device *rdev)
{ … }
int evergreen_asic_reset(struct radeon_device *rdev, bool hard)
{ … }
bool evergreen_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
{ … }
#define RLC_SAVE_RESTORE_LIST_END_MARKER …
#define RLC_CLEAR_STATE_END_MARKER …
void sumo_rlc_fini(struct radeon_device *rdev)
{ … }
#define CP_ME_TABLE_SIZE …
int sumo_rlc_init(struct radeon_device *rdev)
{ … }
static void evergreen_rlc_start(struct radeon_device *rdev)
{ … }
int evergreen_rlc_resume(struct radeon_device *rdev)
{ … }
u32 evergreen_get_vblank_counter(struct radeon_device *rdev, int crtc)
{ … }
void evergreen_disable_interrupt_state(struct radeon_device *rdev)
{ … }
int evergreen_irq_set(struct radeon_device *rdev)
{ … }
static void evergreen_irq_ack(struct radeon_device *rdev)
{ … }
static void evergreen_irq_disable(struct radeon_device *rdev)
{ … }
void evergreen_irq_suspend(struct radeon_device *rdev)
{ … }
static u32 evergreen_get_ih_wptr(struct radeon_device *rdev)
{ … }
int evergreen_irq_process(struct radeon_device *rdev)
{ … }
static void evergreen_uvd_init(struct radeon_device *rdev)
{ … }
static void evergreen_uvd_start(struct radeon_device *rdev)
{ … }
static void evergreen_uvd_resume(struct radeon_device *rdev)
{ … }
static int evergreen_startup(struct radeon_device *rdev)
{ … }
int evergreen_resume(struct radeon_device *rdev)
{ … }
int evergreen_suspend(struct radeon_device *rdev)
{ … }
int evergreen_init(struct radeon_device *rdev)
{ … }
void evergreen_fini(struct radeon_device *rdev)
{ … }
void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
{ … }
void evergreen_program_aspm(struct radeon_device *rdev)
{ … }