diff options
author | Christian König <christian.koenig@amd.com> | 2016-10-05 08:29:38 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-25 14:38:36 -0400 |
commit | e12f3d7a23c99617f72305a805ed827567a43a9c (patch) | |
tree | 826d4091007045c5dc405f4ca0138a965761a34d /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |
parent | 7bc6be825a2efb00cf8a194e1d0560c92d5a2f6c (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_v8_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 58 |
1 files changed, 18 insertions, 40 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 404c49c45b03..e3330d06af9a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -6363,42 +6363,6 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) | |||
6363 | amdgpu_ring_write(ring, 0); | 6363 | amdgpu_ring_write(ring, 0); |
6364 | } | 6364 | } |
6365 | 6365 | ||
6366 | static unsigned gfx_v8_0_ring_get_emit_ib_size_gfx(struct amdgpu_ring *ring) | ||
6367 | { | ||
6368 | return | ||
6369 | 4; /* gfx_v8_0_ring_emit_ib_gfx */ | ||
6370 | } | ||
6371 | |||
6372 | static unsigned gfx_v8_0_ring_get_dma_frame_size_gfx(struct amdgpu_ring *ring) | ||
6373 | { | ||
6374 | return | ||
6375 | 20 + /* gfx_v8_0_ring_emit_gds_switch */ | ||
6376 | 7 + /* gfx_v8_0_ring_emit_hdp_flush */ | ||
6377 | 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */ | ||
6378 | 6 + 6 + 6 +/* gfx_v8_0_ring_emit_fence_gfx x3 for user fence, vm fence */ | ||
6379 | 7 + /* gfx_v8_0_ring_emit_pipeline_sync */ | ||
6380 | 128 + 19 + /* gfx_v8_0_ring_emit_vm_flush */ | ||
6381 | 2 + /* gfx_v8_ring_emit_sb */ | ||
6382 | 3; /* gfx_v8_ring_emit_cntxcntl */ | ||
6383 | } | ||
6384 | |||
6385 | static unsigned gfx_v8_0_ring_get_emit_ib_size_compute(struct amdgpu_ring *ring) | ||
6386 | { | ||
6387 | return | ||
6388 | 4; /* gfx_v8_0_ring_emit_ib_compute */ | ||
6389 | } | ||
6390 | |||
6391 | static unsigned gfx_v8_0_ring_get_dma_frame_size_compute(struct amdgpu_ring *ring) | ||
6392 | { | ||
6393 | return | ||
6394 | 20 + /* gfx_v8_0_ring_emit_gds_switch */ | ||
6395 | 7 + /* gfx_v8_0_ring_emit_hdp_flush */ | ||
6396 | 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */ | ||
6397 | 7 + /* gfx_v8_0_ring_emit_pipeline_sync */ | ||
6398 | 17 + /* gfx_v8_0_ring_emit_vm_flush */ | ||
6399 | 7 + 7 + 7; /* gfx_v8_0_ring_emit_fence_compute x3 for user fence, vm fence */ | ||
6400 | } | ||
6401 | |||
6402 | static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, | 6366 | static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, |
6403 | enum amdgpu_interrupt_state state) | 6367 | enum amdgpu_interrupt_state state) |
6404 | { | 6368 | { |
@@ -6568,6 +6532,16 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { | |||
6568 | .get_rptr = gfx_v8_0_ring_get_rptr, | 6532 | .get_rptr = gfx_v8_0_ring_get_rptr, |
6569 | .get_wptr = gfx_v8_0_ring_get_wptr_gfx, | 6533 | .get_wptr = gfx_v8_0_ring_get_wptr_gfx, |
6570 | .set_wptr = gfx_v8_0_ring_set_wptr_gfx, | 6534 | .set_wptr = gfx_v8_0_ring_set_wptr_gfx, |
6535 | .emit_frame_size = | ||
6536 | 20 + /* gfx_v8_0_ring_emit_gds_switch */ | ||
6537 | 7 + /* gfx_v8_0_ring_emit_hdp_flush */ | ||
6538 | 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */ | ||
6539 | 6 + 6 + 6 +/* gfx_v8_0_ring_emit_fence_gfx x3 for user fence, vm fence */ | ||
6540 | 7 + /* gfx_v8_0_ring_emit_pipeline_sync */ | ||
6541 | 128 + 19 + /* gfx_v8_0_ring_emit_vm_flush */ | ||
6542 | 2 + /* gfx_v8_ring_emit_sb */ | ||
6543 | 3, /* gfx_v8_ring_emit_cntxcntl */ | ||
6544 | .emit_ib_size = 4, /* gfx_v8_0_ring_emit_ib_gfx */ | ||
6571 | .emit_ib = gfx_v8_0_ring_emit_ib_gfx, | 6545 | .emit_ib = gfx_v8_0_ring_emit_ib_gfx, |
6572 | .emit_fence = gfx_v8_0_ring_emit_fence_gfx, | 6546 | .emit_fence = gfx_v8_0_ring_emit_fence_gfx, |
6573 | .emit_pipeline_sync = gfx_v8_0_ring_emit_pipeline_sync, | 6547 | .emit_pipeline_sync = gfx_v8_0_ring_emit_pipeline_sync, |
@@ -6581,14 +6555,20 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { | |||
6581 | .pad_ib = amdgpu_ring_generic_pad_ib, | 6555 | .pad_ib = amdgpu_ring_generic_pad_ib, |
6582 | .emit_switch_buffer = gfx_v8_ring_emit_sb, | 6556 | .emit_switch_buffer = gfx_v8_ring_emit_sb, |
6583 | .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, | 6557 | .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, |
6584 | .get_emit_ib_size = gfx_v8_0_ring_get_emit_ib_size_gfx, | ||
6585 | .get_dma_frame_size = gfx_v8_0_ring_get_dma_frame_size_gfx, | ||
6586 | }; | 6558 | }; |
6587 | 6559 | ||
6588 | static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { | 6560 | static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { |
6589 | .get_rptr = gfx_v8_0_ring_get_rptr, | 6561 | .get_rptr = gfx_v8_0_ring_get_rptr, |
6590 | .get_wptr = gfx_v8_0_ring_get_wptr_compute, | 6562 | .get_wptr = gfx_v8_0_ring_get_wptr_compute, |
6591 | .set_wptr = gfx_v8_0_ring_set_wptr_compute, | 6563 | .set_wptr = gfx_v8_0_ring_set_wptr_compute, |
6564 | .emit_frame_size = | ||
6565 | 20 + /* gfx_v8_0_ring_emit_gds_switch */ | ||
6566 | 7 + /* gfx_v8_0_ring_emit_hdp_flush */ | ||
6567 | 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */ | ||
6568 | 7 + /* gfx_v8_0_ring_emit_pipeline_sync */ | ||
6569 | 17 + /* gfx_v8_0_ring_emit_vm_flush */ | ||
6570 | 7 + 7 + 7, /* gfx_v8_0_ring_emit_fence_compute x3 for user fence, vm fence */ | ||
6571 | .emit_ib_size = 4, /* gfx_v8_0_ring_emit_ib_compute */ | ||
6592 | .emit_ib = gfx_v8_0_ring_emit_ib_compute, | 6572 | .emit_ib = gfx_v8_0_ring_emit_ib_compute, |
6593 | .emit_fence = gfx_v8_0_ring_emit_fence_compute, | 6573 | .emit_fence = gfx_v8_0_ring_emit_fence_compute, |
6594 | .emit_pipeline_sync = gfx_v8_0_ring_emit_pipeline_sync, | 6574 | .emit_pipeline_sync = gfx_v8_0_ring_emit_pipeline_sync, |
@@ -6600,8 +6580,6 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { | |||
6600 | .test_ib = gfx_v8_0_ring_test_ib, | 6580 | .test_ib = gfx_v8_0_ring_test_ib, |
6601 | .insert_nop = amdgpu_ring_insert_nop, | 6581 | .insert_nop = amdgpu_ring_insert_nop, |
6602 | .pad_ib = amdgpu_ring_generic_pad_ib, | 6582 | .pad_ib = amdgpu_ring_generic_pad_ib, |
6603 | .get_emit_ib_size = gfx_v8_0_ring_get_emit_ib_size_compute, | ||
6604 | .get_dma_frame_size = gfx_v8_0_ring_get_dma_frame_size_compute, | ||
6605 | }; | 6583 | }; |
6606 | 6584 | ||
6607 | static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev) | 6585 | static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev) |