#include <linux/firmware.h>
#include "amdgpu.h"
#include "amdgpu_gfx.h"
#include "amdgpu_rlc.h"
#include "amdgpu_ras.h"
#include "amdgpu_xcp.h"
#include "amdgpu_xgmi.h"
#define GFX_OFF_DELAY_ENABLE …
#define GFX_OFF_NO_DELAY …
int amdgpu_gfx_mec_queue_to_bit(struct amdgpu_device *adev, int mec,
int pipe, int queue)
{ … }
void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit,
int *mec, int *pipe, int *queue)
{ … }
bool amdgpu_gfx_is_mec_queue_enabled(struct amdgpu_device *adev,
int xcc_id, int mec, int pipe, int queue)
{ … }
int amdgpu_gfx_me_queue_to_bit(struct amdgpu_device *adev,
int me, int pipe, int queue)
{ … }
void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,
int *me, int *pipe, int *queue)
{ … }
bool amdgpu_gfx_is_me_queue_enabled(struct amdgpu_device *adev,
int me, int pipe, int queue)
{ … }
void amdgpu_gfx_parse_disable_cu(unsigned int *mask, unsigned int max_se, unsigned int max_sh)
{ … }
static bool amdgpu_gfx_is_graphics_multipipe_capable(struct amdgpu_device *adev)
{ … }
static bool amdgpu_gfx_is_compute_multipipe_capable(struct amdgpu_device *adev)
{ … }
bool amdgpu_gfx_is_high_priority_graphics_queue(struct amdgpu_device *adev,
struct amdgpu_ring *ring)
{ … }
bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
struct amdgpu_ring *ring)
{ … }
void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev)
{ … }
void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev)
{ … }
static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
struct amdgpu_ring *ring, int xcc_id)
{ … }
int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, int xcc_id)
{ … }
void amdgpu_gfx_kiq_free_ring(struct amdgpu_ring *ring)
{ … }
void amdgpu_gfx_kiq_fini(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_gfx_kiq_init(struct amdgpu_device *adev,
unsigned int hpd_size, int xcc_id)
{ … }
int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
unsigned int mqd_size, int xcc_id)
{ … }
void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_queue_mask_bit_to_set_resource_bit(struct amdgpu_device *adev,
int queue_bit)
{ … }
static int amdgpu_gfx_mes_enable_kcq(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev, int xcc_id)
{ … }
int amdgpu_gfx_enable_kgq(struct amdgpu_device *adev, int xcc_id)
{ … }
void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
{ … }
int amdgpu_set_gfx_off_residency(struct amdgpu_device *adev, bool value)
{ … }
int amdgpu_get_gfx_off_residency(struct amdgpu_device *adev, u32 *value)
{ … }
int amdgpu_get_gfx_off_entrycount(struct amdgpu_device *adev, u64 *value)
{ … }
int amdgpu_get_gfx_off_status(struct amdgpu_device *adev, uint32_t *value)
{ … }
int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{ … }
int amdgpu_gfx_ras_sw_init(struct amdgpu_device *adev)
{ … }
int amdgpu_gfx_poison_consumption_handler(struct amdgpu_device *adev,
struct amdgpu_iv_entry *entry)
{ … }
int amdgpu_gfx_process_ras_data_cb(struct amdgpu_device *adev,
void *err_data,
struct amdgpu_iv_entry *entry)
{ … }
int amdgpu_gfx_cp_ecc_error_irq(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
struct amdgpu_iv_entry *entry)
{ … }
void amdgpu_gfx_ras_error_func(struct amdgpu_device *adev,
void *ras_error_status,
void (*func)(struct amdgpu_device *adev, void *ras_error_status,
int xcc_id))
{ … }
uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_id)
{ … }
void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint32_t xcc_id)
{ … }
int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev)
{ … }
void amdgpu_gfx_cp_init_microcode(struct amdgpu_device *adev,
uint32_t ucode_id)
{ … }
bool amdgpu_gfx_is_master_xcc(struct amdgpu_device *adev, int xcc_id)
{ … }
static ssize_t amdgpu_gfx_get_current_compute_partition(struct device *dev,
struct device_attribute *addr,
char *buf)
{ … }
static ssize_t amdgpu_gfx_set_compute_partition(struct device *dev,
struct device_attribute *addr,
const char *buf, size_t count)
{ … }
static ssize_t amdgpu_gfx_get_available_compute_partition(struct device *dev,
struct device_attribute *addr,
char *buf)
{ … }
static DEVICE_ATTR(current_compute_partition, 0644,
amdgpu_gfx_get_current_compute_partition,
amdgpu_gfx_set_compute_partition);
static DEVICE_ATTR(available_compute_partition, 0444,
amdgpu_gfx_get_available_compute_partition, NULL);
int amdgpu_gfx_sysfs_init(struct amdgpu_device *adev)
{ … }
void amdgpu_gfx_sysfs_fini(struct amdgpu_device *adev)
{ … }