aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-09-16 10:57:20 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-16 15:52:56 -0400
commitb04e26b3c7a74c8bf8f4a7568de1e7d69b1dbee2 (patch)
tree6daeaf82c36eff45a58cc3d68cd5b3d9fb7b79c1
parenta851d0f4ca60416e0e969b5f752536bc28484823 (diff)
drm/amdgpu/gfx7: add ring callbacks for ib and dma frame size
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 8c780f6c1276..90102f123bb8 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -4190,6 +4190,41 @@ static void gfx_v7_0_ring_emit_gds_switch(struct amdgpu_ring *ring,
4190 amdgpu_ring_write(ring, (1 << (oa_size + oa_base)) - (1 << oa_base)); 4190 amdgpu_ring_write(ring, (1 << (oa_size + oa_base)) - (1 << oa_base));
4191} 4191}
4192 4192
4193static unsigned gfx_v7_0_ring_get_emit_ib_size_gfx(struct amdgpu_ring *ring)
4194{
4195 return
4196 4; /* gfx_v7_0_ring_emit_ib_gfx */
4197}
4198
4199static unsigned gfx_v7_0_ring_get_dma_frame_size_gfx(struct amdgpu_ring *ring)
4200{
4201 return
4202 20 + /* gfx_v7_0_ring_emit_gds_switch */
4203 7 + /* gfx_v7_0_ring_emit_hdp_flush */
4204 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
4205 12 + 12 + 12 + /* gfx_v7_0_ring_emit_fence_gfx x3 for user fence, vm fence */
4206 7 + 4 + /* gfx_v7_0_ring_emit_pipeline_sync */
4207 17 + 6 + /* gfx_v7_0_ring_emit_vm_flush */
4208 3; /* gfx_v7_ring_emit_cntxcntl */
4209}
4210
4211static unsigned gfx_v7_0_ring_get_emit_ib_size_compute(struct amdgpu_ring *ring)
4212{
4213 return
4214 4; /* gfx_v7_0_ring_emit_ib_compute */
4215}
4216
4217static unsigned gfx_v7_0_ring_get_dma_frame_size_compute(struct amdgpu_ring *ring)
4218{
4219 return
4220 20 + /* gfx_v7_0_ring_emit_gds_switch */
4221 7 + /* gfx_v7_0_ring_emit_hdp_flush */
4222 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
4223 7 + /* gfx_v7_0_ring_emit_pipeline_sync */
4224 17 + /* gfx_v7_0_ring_emit_vm_flush */
4225 7 + 7 + 7; /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
4226}
4227
4193static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = { 4228static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = {
4194 .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter, 4229 .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter,
4195 .select_se_sh = &gfx_v7_0_select_se_sh, 4230 .select_se_sh = &gfx_v7_0_select_se_sh,
@@ -4958,6 +4993,8 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
4958 .insert_nop = amdgpu_ring_insert_nop, 4993 .insert_nop = amdgpu_ring_insert_nop,
4959 .pad_ib = amdgpu_ring_generic_pad_ib, 4994 .pad_ib = amdgpu_ring_generic_pad_ib,
4960 .emit_cntxcntl = gfx_v7_ring_emit_cntxcntl, 4995 .emit_cntxcntl = gfx_v7_ring_emit_cntxcntl,
4996 .get_emit_ib_size = gfx_v7_0_ring_get_emit_ib_size_gfx,
4997 .get_dma_frame_size = gfx_v7_0_ring_get_dma_frame_size_gfx,
4961}; 4998};
4962 4999
4963static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = { 5000static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
@@ -4976,6 +5013,8 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
4976 .test_ib = gfx_v7_0_ring_test_ib, 5013 .test_ib = gfx_v7_0_ring_test_ib,
4977 .insert_nop = amdgpu_ring_insert_nop, 5014 .insert_nop = amdgpu_ring_insert_nop,
4978 .pad_ib = amdgpu_ring_generic_pad_ib, 5015 .pad_ib = amdgpu_ring_generic_pad_ib,
5016 .get_emit_ib_size = gfx_v7_0_ring_get_emit_ib_size_compute,
5017 .get_dma_frame_size = gfx_v7_0_ring_get_dma_frame_size_compute,
4979}; 5018};
4980 5019
4981static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev) 5020static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev)