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_v6_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_v6_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c index 4e35e16d1311..a86b17944bcf 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | |||
@@ -2814,33 +2814,6 @@ static void gfx_v6_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) | |||
2814 | amdgpu_ring_write(ring, 0); | 2814 | amdgpu_ring_write(ring, 0); |
2815 | } | 2815 | } |
2816 | 2816 | ||
2817 | static unsigned gfx_v6_0_ring_get_emit_ib_size(struct amdgpu_ring *ring) | ||
2818 | { | ||
2819 | return | ||
2820 | 6; /* gfx_v6_0_ring_emit_ib */ | ||
2821 | } | ||
2822 | |||
2823 | static unsigned gfx_v6_0_ring_get_dma_frame_size_gfx(struct amdgpu_ring *ring) | ||
2824 | { | ||
2825 | return | ||
2826 | 5 + /* gfx_v6_0_ring_emit_hdp_flush */ | ||
2827 | 5 + /* gfx_v6_0_ring_emit_hdp_invalidate */ | ||
2828 | 14 + 14 + 14 + /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */ | ||
2829 | 7 + 4 + /* gfx_v6_0_ring_emit_pipeline_sync */ | ||
2830 | 17 + 6 + /* gfx_v6_0_ring_emit_vm_flush */ | ||
2831 | 3; /* gfx_v6_ring_emit_cntxcntl */ | ||
2832 | } | ||
2833 | |||
2834 | static unsigned gfx_v6_0_ring_get_dma_frame_size_compute(struct amdgpu_ring *ring) | ||
2835 | { | ||
2836 | return | ||
2837 | 5 + /* gfx_v6_0_ring_emit_hdp_flush */ | ||
2838 | 5 + /* gfx_v6_0_ring_emit_hdp_invalidate */ | ||
2839 | 7 + /* gfx_v6_0_ring_emit_pipeline_sync */ | ||
2840 | 17 + /* gfx_v6_0_ring_emit_vm_flush */ | ||
2841 | 14 + 14 + 14; /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */ | ||
2842 | } | ||
2843 | |||
2844 | static const struct amdgpu_gfx_funcs gfx_v6_0_gfx_funcs = { | 2817 | static const struct amdgpu_gfx_funcs gfx_v6_0_gfx_funcs = { |
2845 | .get_gpu_clock_counter = &gfx_v6_0_get_gpu_clock_counter, | 2818 | .get_gpu_clock_counter = &gfx_v6_0_get_gpu_clock_counter, |
2846 | .select_se_sh = &gfx_v6_0_select_se_sh, | 2819 | .select_se_sh = &gfx_v6_0_select_se_sh, |
@@ -3258,6 +3231,14 @@ static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_gfx = { | |||
3258 | .get_rptr = gfx_v6_0_ring_get_rptr, | 3231 | .get_rptr = gfx_v6_0_ring_get_rptr, |
3259 | .get_wptr = gfx_v6_0_ring_get_wptr, | 3232 | .get_wptr = gfx_v6_0_ring_get_wptr, |
3260 | .set_wptr = gfx_v6_0_ring_set_wptr_gfx, | 3233 | .set_wptr = gfx_v6_0_ring_set_wptr_gfx, |
3234 | .emit_frame_size = | ||
3235 | 5 + /* gfx_v6_0_ring_emit_hdp_flush */ | ||
3236 | 5 + /* gfx_v6_0_ring_emit_hdp_invalidate */ | ||
3237 | 14 + 14 + 14 + /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */ | ||
3238 | 7 + 4 + /* gfx_v6_0_ring_emit_pipeline_sync */ | ||
3239 | 17 + 6 + /* gfx_v6_0_ring_emit_vm_flush */ | ||
3240 | 3, /* gfx_v6_ring_emit_cntxcntl */ | ||
3241 | .emit_ib_size = 6, /* gfx_v6_0_ring_emit_ib */ | ||
3261 | .emit_ib = gfx_v6_0_ring_emit_ib, | 3242 | .emit_ib = gfx_v6_0_ring_emit_ib, |
3262 | .emit_fence = gfx_v6_0_ring_emit_fence, | 3243 | .emit_fence = gfx_v6_0_ring_emit_fence, |
3263 | .emit_pipeline_sync = gfx_v6_0_ring_emit_pipeline_sync, | 3244 | .emit_pipeline_sync = gfx_v6_0_ring_emit_pipeline_sync, |
@@ -3268,14 +3249,19 @@ static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_gfx = { | |||
3268 | .test_ib = gfx_v6_0_ring_test_ib, | 3249 | .test_ib = gfx_v6_0_ring_test_ib, |
3269 | .insert_nop = amdgpu_ring_insert_nop, | 3250 | .insert_nop = amdgpu_ring_insert_nop, |
3270 | .emit_cntxcntl = gfx_v6_ring_emit_cntxcntl, | 3251 | .emit_cntxcntl = gfx_v6_ring_emit_cntxcntl, |
3271 | .get_emit_ib_size = gfx_v6_0_ring_get_emit_ib_size, | ||
3272 | .get_dma_frame_size = gfx_v6_0_ring_get_dma_frame_size_gfx, | ||
3273 | }; | 3252 | }; |
3274 | 3253 | ||
3275 | static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_compute = { | 3254 | static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_compute = { |
3276 | .get_rptr = gfx_v6_0_ring_get_rptr, | 3255 | .get_rptr = gfx_v6_0_ring_get_rptr, |
3277 | .get_wptr = gfx_v6_0_ring_get_wptr, | 3256 | .get_wptr = gfx_v6_0_ring_get_wptr, |
3278 | .set_wptr = gfx_v6_0_ring_set_wptr_compute, | 3257 | .set_wptr = gfx_v6_0_ring_set_wptr_compute, |
3258 | .emit_frame_size = | ||
3259 | 5 + /* gfx_v6_0_ring_emit_hdp_flush */ | ||
3260 | 5 + /* gfx_v6_0_ring_emit_hdp_invalidate */ | ||
3261 | 7 + /* gfx_v6_0_ring_emit_pipeline_sync */ | ||
3262 | 17 + /* gfx_v6_0_ring_emit_vm_flush */ | ||
3263 | 14 + 14 + 14, /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */ | ||
3264 | .emit_ib_size = 6, /* gfx_v6_0_ring_emit_ib */ | ||
3279 | .emit_ib = gfx_v6_0_ring_emit_ib, | 3265 | .emit_ib = gfx_v6_0_ring_emit_ib, |
3280 | .emit_fence = gfx_v6_0_ring_emit_fence, | 3266 | .emit_fence = gfx_v6_0_ring_emit_fence, |
3281 | .emit_pipeline_sync = gfx_v6_0_ring_emit_pipeline_sync, | 3267 | .emit_pipeline_sync = gfx_v6_0_ring_emit_pipeline_sync, |
@@ -3285,8 +3271,6 @@ static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_compute = { | |||
3285 | .test_ring = gfx_v6_0_ring_test_ring, | 3271 | .test_ring = gfx_v6_0_ring_test_ring, |
3286 | .test_ib = gfx_v6_0_ring_test_ib, | 3272 | .test_ib = gfx_v6_0_ring_test_ib, |
3287 | .insert_nop = amdgpu_ring_insert_nop, | 3273 | .insert_nop = amdgpu_ring_insert_nop, |
3288 | .get_emit_ib_size = gfx_v6_0_ring_get_emit_ib_size, | ||
3289 | .get_dma_frame_size = gfx_v6_0_ring_get_dma_frame_size_compute, | ||
3290 | }; | 3274 | }; |
3291 | 3275 | ||
3292 | static void gfx_v6_0_set_ring_funcs(struct amdgpu_device *adev) | 3276 | static void gfx_v6_0_set_ring_funcs(struct amdgpu_device *adev) |