#include "amdgpu.h"
#include "amdgpu_jpeg.h"
#include "soc15.h"
#include "soc15d.h"
#include "jpeg_v4_0_3.h"
#include "mmsch_v4_0_3.h"
#include "vcn/vcn_4_0_3_offset.h"
#include "vcn/vcn_4_0_3_sh_mask.h"
#include "ivsrcid/vcn/irqsrcs_vcn_4_0.h"
#define NORMALIZE_JPEG_REG_OFFSET(offset) …
enum jpeg_engin_status { … };
static void jpeg_v4_0_3_set_dec_ring_funcs(struct amdgpu_device *adev);
static void jpeg_v4_0_3_set_irq_funcs(struct amdgpu_device *adev);
static int jpeg_v4_0_3_set_powergating_state(void *handle,
enum amd_powergating_state state);
static void jpeg_v4_0_3_set_ras_funcs(struct amdgpu_device *adev);
static void jpeg_v4_0_3_dec_ring_set_wptr(struct amdgpu_ring *ring);
static int amdgpu_ih_srcid_jpeg[] = …;
static int jpeg_v4_0_3_early_init(void *handle)
{ … }
static int jpeg_v4_0_3_sw_init(void *handle)
{ … }
static int jpeg_v4_0_3_sw_fini(void *handle)
{ … }
static int jpeg_v4_0_3_start_sriov(struct amdgpu_device *adev)
{ … }
static int jpeg_v4_0_3_hw_init(void *handle)
{ … }
static int jpeg_v4_0_3_hw_fini(void *handle)
{ … }
static int jpeg_v4_0_3_suspend(void *handle)
{ … }
static int jpeg_v4_0_3_resume(void *handle)
{ … }
static void jpeg_v4_0_3_disable_clock_gating(struct amdgpu_device *adev, int inst_idx)
{ … }
static void jpeg_v4_0_3_enable_clock_gating(struct amdgpu_device *adev, int inst_idx)
{ … }
static int jpeg_v4_0_3_start(struct amdgpu_device *adev)
{ … }
static int jpeg_v4_0_3_stop(struct amdgpu_device *adev)
{ … }
static uint64_t jpeg_v4_0_3_dec_ring_get_rptr(struct amdgpu_ring *ring)
{ … }
static uint64_t jpeg_v4_0_3_dec_ring_get_wptr(struct amdgpu_ring *ring)
{ … }
static void jpeg_v4_0_3_ring_emit_hdp_flush(struct amdgpu_ring *ring)
{ … }
static void jpeg_v4_0_3_dec_ring_set_wptr(struct amdgpu_ring *ring)
{ … }
void jpeg_v4_0_3_dec_ring_insert_start(struct amdgpu_ring *ring)
{ … }
void jpeg_v4_0_3_dec_ring_insert_end(struct amdgpu_ring *ring)
{ … }
void jpeg_v4_0_3_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq,
unsigned int flags)
{ … }
void jpeg_v4_0_3_dec_ring_emit_ib(struct amdgpu_ring *ring,
struct amdgpu_job *job,
struct amdgpu_ib *ib,
uint32_t flags)
{ … }
void jpeg_v4_0_3_dec_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
uint32_t val, uint32_t mask)
{ … }
void jpeg_v4_0_3_dec_ring_emit_vm_flush(struct amdgpu_ring *ring,
unsigned int vmid, uint64_t pd_addr)
{ … }
void jpeg_v4_0_3_dec_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg, uint32_t val)
{ … }
void jpeg_v4_0_3_dec_ring_nop(struct amdgpu_ring *ring, uint32_t count)
{ … }
static bool jpeg_v4_0_3_is_idle(void *handle)
{ … }
static int jpeg_v4_0_3_wait_for_idle(void *handle)
{ … }
static int jpeg_v4_0_3_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{ … }
static int jpeg_v4_0_3_set_powergating_state(void *handle,
enum amd_powergating_state state)
{ … }
static int jpeg_v4_0_3_set_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
unsigned int type,
enum amdgpu_interrupt_state state)
{ … }
static int jpeg_v4_0_3_process_interrupt(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
struct amdgpu_iv_entry *entry)
{ … }
static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = …;
static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = …;
static void jpeg_v4_0_3_set_dec_ring_funcs(struct amdgpu_device *adev)
{ … }
static const struct amdgpu_irq_src_funcs jpeg_v4_0_3_irq_funcs = …;
static void jpeg_v4_0_3_set_irq_funcs(struct amdgpu_device *adev)
{ … }
const struct amdgpu_ip_block_version jpeg_v4_0_3_ip_block = …;
static const struct amdgpu_ras_err_status_reg_entry jpeg_v4_0_3_ue_reg_list[] = …;
static void jpeg_v4_0_3_inst_query_ras_error_count(struct amdgpu_device *adev,
uint32_t jpeg_inst,
void *ras_err_status)
{ … }
static void jpeg_v4_0_3_query_ras_error_count(struct amdgpu_device *adev,
void *ras_err_status)
{ … }
static void jpeg_v4_0_3_inst_reset_ras_error_count(struct amdgpu_device *adev,
uint32_t jpeg_inst)
{ … }
static void jpeg_v4_0_3_reset_ras_error_count(struct amdgpu_device *adev)
{ … }
static const struct amdgpu_ras_block_hw_ops jpeg_v4_0_3_ras_hw_ops = …;
static struct amdgpu_jpeg_ras jpeg_v4_0_3_ras = …;
static void jpeg_v4_0_3_set_ras_funcs(struct amdgpu_device *adev)
{ … }