diff options
author | Shaoyun Liu <Shaoyun.Liu@amd.com> | 2017-11-29 01:01:21 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-08 19:18:51 +0300 |
commit | 946a4d5b301028621791e6c8b53f64c426dea1a5 (patch) | |
tree | 636bc2d2df27c039b144c5429a7a6e49232f892e /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | b466107e8be15e1727e288639098ef6bfec1a982 (diff) | |
download | linux-946a4d5b301028621791e6c8b53f64c426dea1a5.tar.xz |
drm/amdgpu: Avoid use SOC15_REG_OFFSET in static const array
Handle dynamic offsets correctly in static arrays.
Acked-by: Christian Konig <christian.koenig@amd.com>
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 9b09e938a802..e329faa6166f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1428,6 +1428,23 @@ typedef void (*amdgpu_wreg_t)(struct amdgpu_device*, uint32_t, uint32_t); typedef uint32_t (*amdgpu_block_rreg_t)(struct amdgpu_device*, uint32_t, uint32_t); typedef void (*amdgpu_block_wreg_t)(struct amdgpu_device*, uint32_t, uint32_t, uint32_t); + +/* + * amdgpu nbio functions + * + * Fix me : + * Put more NBIO specifc func wraper here , for now just try to minimize the + * change to avoid use SOC15_REG_OFFSET in the constant array + */ + +struct amdgpu_nbio_funcs { + u32 (*get_hdp_flush_req_offset)(struct amdgpu_device*); + u32 (*get_hdp_flush_done_offset)(struct amdgpu_device*); + u32 (*get_pcie_index_offset)(struct amdgpu_device*); + u32 (*get_pcie_data_offset)(struct amdgpu_device*); +}; + + /* Define the HW IP blocks will be used in driver , add more if necessary */ enum amd_hw_ip_block_type { GC_HWIP = 1, @@ -1647,6 +1664,8 @@ struct amdgpu_device { /* soc15 register offset based on ip, instance and segment */ uint32_t *reg_offset[MAX_HWIP][HWIP_MAX_INSTANCE]; + const struct amdgpu_nbio_funcs *nbio_funcs; + /* delayed work_func for deferring clockgating during resume */ struct delayed_work late_init_work; |