aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-10-05 08:29:38 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-25 14:38:36 -0400
commite12f3d7a23c99617f72305a805ed827567a43a9c (patch)
tree826d4091007045c5dc405f4ca0138a965761a34d /drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
parent7bc6be825a2efb00cf8a194e1d0560c92d5a2f6c (diff)
drm/amdgpu: move IB and frame size directly into the engine description
I should have suggested that on the initial patchset. This saves us a few CPU cycles during CS and a bunch of loc. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c56
1 files changed, 17 insertions, 39 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 9a54ea982b87..f2415f58c160 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -4357,41 +4357,6 @@ static void gfx_v7_0_ring_emit_gds_switch(struct amdgpu_ring *ring,
4357 amdgpu_ring_write(ring, (1 << (oa_size + oa_base)) - (1 << oa_base)); 4357 amdgpu_ring_write(ring, (1 << (oa_size + oa_base)) - (1 << oa_base));
4358} 4358}
4359 4359
4360static unsigned gfx_v7_0_ring_get_emit_ib_size_gfx(struct amdgpu_ring *ring)
4361{
4362 return
4363 4; /* gfx_v7_0_ring_emit_ib_gfx */
4364}
4365
4366static unsigned gfx_v7_0_ring_get_dma_frame_size_gfx(struct amdgpu_ring *ring)
4367{
4368 return
4369 20 + /* gfx_v7_0_ring_emit_gds_switch */
4370 7 + /* gfx_v7_0_ring_emit_hdp_flush */
4371 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
4372 12 + 12 + 12 + /* gfx_v7_0_ring_emit_fence_gfx x3 for user fence, vm fence */
4373 7 + 4 + /* gfx_v7_0_ring_emit_pipeline_sync */
4374 17 + 6 + /* gfx_v7_0_ring_emit_vm_flush */
4375 3; /* gfx_v7_ring_emit_cntxcntl */
4376}
4377
4378static unsigned gfx_v7_0_ring_get_emit_ib_size_compute(struct amdgpu_ring *ring)
4379{
4380 return
4381 4; /* gfx_v7_0_ring_emit_ib_compute */
4382}
4383
4384static unsigned gfx_v7_0_ring_get_dma_frame_size_compute(struct amdgpu_ring *ring)
4385{
4386 return
4387 20 + /* gfx_v7_0_ring_emit_gds_switch */
4388 7 + /* gfx_v7_0_ring_emit_hdp_flush */
4389 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
4390 7 + /* gfx_v7_0_ring_emit_pipeline_sync */
4391 17 + /* gfx_v7_0_ring_emit_vm_flush */
4392 7 + 7 + 7; /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
4393}
4394
4395static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = { 4360static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = {
4396 .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter, 4361 .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter,
4397 .select_se_sh = &gfx_v7_0_select_se_sh, 4362 .select_se_sh = &gfx_v7_0_select_se_sh,
@@ -5147,6 +5112,15 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
5147 .get_rptr = gfx_v7_0_ring_get_rptr, 5112 .get_rptr = gfx_v7_0_ring_get_rptr,
5148 .get_wptr = gfx_v7_0_ring_get_wptr_gfx, 5113 .get_wptr = gfx_v7_0_ring_get_wptr_gfx,
5149 .set_wptr = gfx_v7_0_ring_set_wptr_gfx, 5114 .set_wptr = gfx_v7_0_ring_set_wptr_gfx,
5115 .emit_frame_size =
5116 20 + /* gfx_v7_0_ring_emit_gds_switch */
5117 7 + /* gfx_v7_0_ring_emit_hdp_flush */
5118 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
5119 12 + 12 + 12 + /* gfx_v7_0_ring_emit_fence_gfx x3 for user fence, vm fence */
5120 7 + 4 + /* gfx_v7_0_ring_emit_pipeline_sync */
5121 17 + 6 + /* gfx_v7_0_ring_emit_vm_flush */
5122 3, /* gfx_v7_ring_emit_cntxcntl */
5123 .emit_ib_size = 4, /* gfx_v7_0_ring_emit_ib_gfx */
5150 .emit_ib = gfx_v7_0_ring_emit_ib_gfx, 5124 .emit_ib = gfx_v7_0_ring_emit_ib_gfx,
5151 .emit_fence = gfx_v7_0_ring_emit_fence_gfx, 5125 .emit_fence = gfx_v7_0_ring_emit_fence_gfx,
5152 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync, 5126 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync,
@@ -5159,14 +5133,20 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
5159 .insert_nop = amdgpu_ring_insert_nop, 5133 .insert_nop = amdgpu_ring_insert_nop,
5160 .pad_ib = amdgpu_ring_generic_pad_ib, 5134 .pad_ib = amdgpu_ring_generic_pad_ib,
5161 .emit_cntxcntl = gfx_v7_ring_emit_cntxcntl, 5135 .emit_cntxcntl = gfx_v7_ring_emit_cntxcntl,
5162 .get_emit_ib_size = gfx_v7_0_ring_get_emit_ib_size_gfx,
5163 .get_dma_frame_size = gfx_v7_0_ring_get_dma_frame_size_gfx,
5164}; 5136};
5165 5137
5166static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = { 5138static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
5167 .get_rptr = gfx_v7_0_ring_get_rptr, 5139 .get_rptr = gfx_v7_0_ring_get_rptr,
5168 .get_wptr = gfx_v7_0_ring_get_wptr_compute, 5140 .get_wptr = gfx_v7_0_ring_get_wptr_compute,
5169 .set_wptr = gfx_v7_0_ring_set_wptr_compute, 5141 .set_wptr = gfx_v7_0_ring_set_wptr_compute,
5142 .emit_frame_size =
5143 20 + /* gfx_v7_0_ring_emit_gds_switch */
5144 7 + /* gfx_v7_0_ring_emit_hdp_flush */
5145 5 + /* gfx_v7_0_ring_emit_hdp_invalidate */
5146 7 + /* gfx_v7_0_ring_emit_pipeline_sync */
5147 17 + /* gfx_v7_0_ring_emit_vm_flush */
5148 7 + 7 + 7, /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
5149 .emit_ib_size = 4, /* gfx_v7_0_ring_emit_ib_compute */
5170 .emit_ib = gfx_v7_0_ring_emit_ib_compute, 5150 .emit_ib = gfx_v7_0_ring_emit_ib_compute,
5171 .emit_fence = gfx_v7_0_ring_emit_fence_compute, 5151 .emit_fence = gfx_v7_0_ring_emit_fence_compute,
5172 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync, 5152 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync,
@@ -5178,8 +5158,6 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
5178 .test_ib = gfx_v7_0_ring_test_ib, 5158 .test_ib = gfx_v7_0_ring_test_ib,
5179 .insert_nop = amdgpu_ring_insert_nop, 5159 .insert_nop = amdgpu_ring_insert_nop,
5180 .pad_ib = amdgpu_ring_generic_pad_ib, 5160 .pad_ib = amdgpu_ring_generic_pad_ib,
5181 .get_emit_ib_size = gfx_v7_0_ring_get_emit_ib_size_compute,
5182 .get_dma_frame_size = gfx_v7_0_ring_get_dma_frame_size_compute,
5183}; 5161};
5184 5162
5185static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev) 5163static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev)