diff options
author | Christian König <christian.koenig@amd.com> | 2018-09-17 10:13:49 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-01-14 15:04:47 -0500 |
commit | 8bb9eb480d032418bd08d0a6a39e4eaa1dec2fb8 (patch) | |
tree | 0b83e974d2b75e4d0fc1aaa6fb3e28eb838f22ab /drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | |
parent | 73c97fa4421fa0465a0b25a0ccf62af32e4bd01e (diff) |
drm/amdgpu: add IH ring to ih_get_wptr/ih_set_rptr v2
Let's start to support multiple rings.
v2: decode IV is needed as well
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h index f877bb78d10a..d810fd73d574 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | |||
@@ -50,15 +50,16 @@ struct amdgpu_ih_ring { | |||
50 | /* provided by the ih block */ | 50 | /* provided by the ih block */ |
51 | struct amdgpu_ih_funcs { | 51 | struct amdgpu_ih_funcs { |
52 | /* ring read/write ptr handling, called from interrupt context */ | 52 | /* ring read/write ptr handling, called from interrupt context */ |
53 | u32 (*get_wptr)(struct amdgpu_device *adev); | 53 | u32 (*get_wptr)(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih); |
54 | void (*decode_iv)(struct amdgpu_device *adev, | 54 | void (*decode_iv)(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih, |
55 | struct amdgpu_iv_entry *entry); | 55 | struct amdgpu_iv_entry *entry); |
56 | void (*set_rptr)(struct amdgpu_device *adev); | 56 | void (*set_rptr)(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih); |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define amdgpu_ih_get_wptr(adev) (adev)->irq.ih_funcs->get_wptr((adev)) | 59 | #define amdgpu_ih_get_wptr(adev, ih) (adev)->irq.ih_funcs->get_wptr((adev), (ih)) |
60 | #define amdgpu_ih_decode_iv(adev, iv) (adev)->irq.ih_funcs->decode_iv((adev), (iv)) | 60 | #define amdgpu_ih_decode_iv(adev, iv) \ |
61 | #define amdgpu_ih_set_rptr(adev) (adev)->irq.ih_funcs->set_rptr((adev)) | 61 | (adev)->irq.ih_funcs->decode_iv((adev), (ih), (iv)) |
62 | #define amdgpu_ih_set_rptr(adev, ih) (adev)->irq.ih_funcs->set_rptr((adev), (ih)) | ||
62 | 63 | ||
63 | int amdgpu_ih_ring_init(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih, | 64 | int amdgpu_ih_ring_init(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih, |
64 | unsigned ring_size, bool use_bus_addr); | 65 | unsigned ring_size, bool use_bus_addr); |