aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-09-16 10:57:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-16 15:52:57 -0400
commit7512ad16b532eee288a85a55a41ebf7d0eb8080d (patch)
tree9f66563f45ad40102e6d5a42bc94d642f9295a56 /drivers/gpu
parentb04e26b3c7a74c8bf8f4a7568de1e7d69b1dbee2 (diff)
drm/amdgpu/gfx8: 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')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index e2ed71d5fd53..1e7c615c054e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -6105,6 +6105,42 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
6105 amdgpu_ring_write(ring, 0); 6105 amdgpu_ring_write(ring, 0);
6106} 6106}
6107 6107
6108static unsigned gfx_v8_0_ring_get_emit_ib_size_gfx(struct amdgpu_ring *ring)
6109{
6110 return
6111 4; /* gfx_v8_0_ring_emit_ib_gfx */
6112}
6113
6114static unsigned gfx_v8_0_ring_get_dma_frame_size_gfx(struct amdgpu_ring *ring)
6115{
6116 return
6117 20 + /* gfx_v8_0_ring_emit_gds_switch */
6118 7 + /* gfx_v8_0_ring_emit_hdp_flush */
6119 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */
6120 6 + 6 + 6 +/* gfx_v8_0_ring_emit_fence_gfx x3 for user fence, vm fence */
6121 7 + /* gfx_v8_0_ring_emit_pipeline_sync */
6122 256 + 19 + /* gfx_v8_0_ring_emit_vm_flush */
6123 2 + /* gfx_v8_ring_emit_sb */
6124 3; /* gfx_v8_ring_emit_cntxcntl */
6125}
6126
6127static unsigned gfx_v8_0_ring_get_emit_ib_size_compute(struct amdgpu_ring *ring)
6128{
6129 return
6130 4; /* gfx_v8_0_ring_emit_ib_compute */
6131}
6132
6133static unsigned gfx_v8_0_ring_get_dma_frame_size_compute(struct amdgpu_ring *ring)
6134{
6135 return
6136 20 + /* gfx_v8_0_ring_emit_gds_switch */
6137 7 + /* gfx_v8_0_ring_emit_hdp_flush */
6138 5 + /* gfx_v8_0_ring_emit_hdp_invalidate */
6139 7 + /* gfx_v8_0_ring_emit_pipeline_sync */
6140 17 + /* gfx_v8_0_ring_emit_vm_flush */
6141 7 + 7 + 7; /* gfx_v8_0_ring_emit_fence_compute x3 for user fence, vm fence */
6142}
6143
6108static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, 6144static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
6109 enum amdgpu_interrupt_state state) 6145 enum amdgpu_interrupt_state state)
6110{ 6146{
@@ -6288,6 +6324,8 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
6288 .pad_ib = amdgpu_ring_generic_pad_ib, 6324 .pad_ib = amdgpu_ring_generic_pad_ib,
6289 .emit_switch_buffer = gfx_v8_ring_emit_sb, 6325 .emit_switch_buffer = gfx_v8_ring_emit_sb,
6290 .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl, 6326 .emit_cntxcntl = gfx_v8_ring_emit_cntxcntl,
6327 .get_emit_ib_size = gfx_v8_0_ring_get_emit_ib_size_gfx,
6328 .get_dma_frame_size = gfx_v8_0_ring_get_dma_frame_size_gfx,
6291}; 6329};
6292 6330
6293static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = { 6331static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
@@ -6306,6 +6344,8 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
6306 .test_ib = gfx_v8_0_ring_test_ib, 6344 .test_ib = gfx_v8_0_ring_test_ib,
6307 .insert_nop = amdgpu_ring_insert_nop, 6345 .insert_nop = amdgpu_ring_insert_nop,
6308 .pad_ib = amdgpu_ring_generic_pad_ib, 6346 .pad_ib = amdgpu_ring_generic_pad_ib,
6347 .get_emit_ib_size = gfx_v8_0_ring_get_emit_ib_size_compute,
6348 .get_dma_frame_size = gfx_v8_0_ring_get_dma_frame_size_compute,
6309}; 6349};
6310 6350
6311static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev) 6351static void gfx_v8_0_set_ring_funcs(struct amdgpu_device *adev)