diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-09-16 11:00:58 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-16 15:53:01 -0400 |
commit | c3f5875888cc4a65f16eb2298a5b4ba3a39fb1a6 (patch) | |
tree | cd5afc9c0c6f42113ad70c49732fac0858379484 /drivers/gpu/drm/amd/amdgpu | |
parent | cdbbb7846ce055c4e6ebf6c08560a6e9c8819ba9 (diff) |
drm/amdgpu/uvd6: 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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 2abe8a93c99f..e0fd9f21ed95 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -725,6 +725,31 @@ static void uvd_v6_0_ring_emit_pipeline_sync(struct amdgpu_ring *ring) | |||
725 | amdgpu_ring_write(ring, 0xE); | 725 | amdgpu_ring_write(ring, 0xE); |
726 | } | 726 | } |
727 | 727 | ||
728 | static unsigned uvd_v6_0_ring_get_emit_ib_size(struct amdgpu_ring *ring) | ||
729 | { | ||
730 | return | ||
731 | 8; /* uvd_v6_0_ring_emit_ib */ | ||
732 | } | ||
733 | |||
734 | static unsigned uvd_v6_0_ring_get_dma_frame_size(struct amdgpu_ring *ring) | ||
735 | { | ||
736 | return | ||
737 | 2 + /* uvd_v6_0_ring_emit_hdp_flush */ | ||
738 | 2 + /* uvd_v6_0_ring_emit_hdp_invalidate */ | ||
739 | 10 + /* uvd_v6_0_ring_emit_pipeline_sync */ | ||
740 | 14; /* uvd_v6_0_ring_emit_fence x1 no user fence */ | ||
741 | } | ||
742 | |||
743 | static unsigned uvd_v6_0_ring_get_dma_frame_size_vm(struct amdgpu_ring *ring) | ||
744 | { | ||
745 | return | ||
746 | 2 + /* uvd_v6_0_ring_emit_hdp_flush */ | ||
747 | 2 + /* uvd_v6_0_ring_emit_hdp_invalidate */ | ||
748 | 10 + /* uvd_v6_0_ring_emit_pipeline_sync */ | ||
749 | 20 + /* uvd_v6_0_ring_emit_vm_flush */ | ||
750 | 14 + 14; /* uvd_v6_0_ring_emit_fence x2 vm fence */ | ||
751 | } | ||
752 | |||
728 | static bool uvd_v6_0_is_idle(void *handle) | 753 | static bool uvd_v6_0_is_idle(void *handle) |
729 | { | 754 | { |
730 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 755 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
@@ -1037,6 +1062,8 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = { | |||
1037 | .pad_ib = amdgpu_ring_generic_pad_ib, | 1062 | .pad_ib = amdgpu_ring_generic_pad_ib, |
1038 | .begin_use = amdgpu_uvd_ring_begin_use, | 1063 | .begin_use = amdgpu_uvd_ring_begin_use, |
1039 | .end_use = amdgpu_uvd_ring_end_use, | 1064 | .end_use = amdgpu_uvd_ring_end_use, |
1065 | .get_emit_ib_size = uvd_v6_0_ring_get_emit_ib_size, | ||
1066 | .get_dma_frame_size = uvd_v6_0_ring_get_dma_frame_size, | ||
1040 | }; | 1067 | }; |
1041 | 1068 | ||
1042 | static const struct amdgpu_ring_funcs uvd_v6_0_ring_vm_funcs = { | 1069 | static const struct amdgpu_ring_funcs uvd_v6_0_ring_vm_funcs = { |
@@ -1056,6 +1083,8 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_vm_funcs = { | |||
1056 | .pad_ib = amdgpu_ring_generic_pad_ib, | 1083 | .pad_ib = amdgpu_ring_generic_pad_ib, |
1057 | .begin_use = amdgpu_uvd_ring_begin_use, | 1084 | .begin_use = amdgpu_uvd_ring_begin_use, |
1058 | .end_use = amdgpu_uvd_ring_end_use, | 1085 | .end_use = amdgpu_uvd_ring_end_use, |
1086 | .get_emit_ib_size = uvd_v6_0_ring_get_emit_ib_size, | ||
1087 | .get_dma_frame_size = uvd_v6_0_ring_get_dma_frame_size_vm, | ||
1059 | }; | 1088 | }; |
1060 | 1089 | ||
1061 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev) | 1090 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev) |