diff options
author | Boyuan Zhang <boyuan.zhang@amd.com> | 2018-05-30 14:23:33 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-06-15 13:20:35 -0400 |
commit | e612bcc3abbb10b6a2204e17849f9aed8627a46e (patch) | |
tree | b2d42d887d485c764d3c945af8e8c14e9bf61159 /drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |
parent | 221f36c460d7d671e9d19d0d8184225aa068d3a8 (diff) |
drm/amdgpu: set jpeg ring functions
Set all vcn jpeg ring function pointers.
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
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/vcn_v1_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 4f15833df8aa..8b29f471dad1 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |||
@@ -38,6 +38,7 @@ | |||
38 | static int vcn_v1_0_stop(struct amdgpu_device *adev); | 38 | static int vcn_v1_0_stop(struct amdgpu_device *adev); |
39 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev); | 39 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev); |
40 | static void vcn_v1_0_set_enc_ring_funcs(struct amdgpu_device *adev); | 40 | static void vcn_v1_0_set_enc_ring_funcs(struct amdgpu_device *adev); |
41 | static void vcn_v1_0_set_jpeg_ring_funcs(struct amdgpu_device *adev); | ||
41 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev); | 42 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev); |
42 | 43 | ||
43 | /** | 44 | /** |
@@ -55,6 +56,7 @@ static int vcn_v1_0_early_init(void *handle) | |||
55 | 56 | ||
56 | vcn_v1_0_set_dec_ring_funcs(adev); | 57 | vcn_v1_0_set_dec_ring_funcs(adev); |
57 | vcn_v1_0_set_enc_ring_funcs(adev); | 58 | vcn_v1_0_set_enc_ring_funcs(adev); |
59 | vcn_v1_0_set_jpeg_ring_funcs(adev); | ||
58 | vcn_v1_0_set_irq_funcs(adev); | 60 | vcn_v1_0_set_irq_funcs(adev); |
59 | 61 | ||
60 | return 0; | 62 | return 0; |
@@ -1559,6 +1561,38 @@ static const struct amdgpu_ring_funcs vcn_v1_0_enc_ring_vm_funcs = { | |||
1559 | .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper, | 1561 | .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper, |
1560 | }; | 1562 | }; |
1561 | 1563 | ||
1564 | static const struct amdgpu_ring_funcs vcn_v1_0_jpeg_ring_vm_funcs = { | ||
1565 | .type = AMDGPU_RING_TYPE_VCN_JPEG, | ||
1566 | .align_mask = 0xf, | ||
1567 | .nop = PACKET0(0x81ff, 0), | ||
1568 | .support_64bit_ptrs = false, | ||
1569 | .vmhub = AMDGPU_MMHUB, | ||
1570 | .get_rptr = vcn_v1_0_jpeg_ring_get_rptr, | ||
1571 | .get_wptr = vcn_v1_0_jpeg_ring_get_wptr, | ||
1572 | .set_wptr = vcn_v1_0_jpeg_ring_set_wptr, | ||
1573 | .emit_frame_size = | ||
1574 | 6 + 6 + /* hdp invalidate / flush */ | ||
1575 | SOC15_FLUSH_GPU_TLB_NUM_WREG * 6 + | ||
1576 | SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 8 + | ||
1577 | 8 + /* vcn_v1_0_dec_ring_emit_vm_flush */ | ||
1578 | 14 + 14 + /* vcn_v1_0_dec_ring_emit_fence x2 vm fence */ | ||
1579 | 6, | ||
1580 | .emit_ib_size = 22, /* vcn_v1_0_dec_ring_emit_ib */ | ||
1581 | .emit_ib = vcn_v1_0_jpeg_ring_emit_ib, | ||
1582 | .emit_fence = vcn_v1_0_jpeg_ring_emit_fence, | ||
1583 | .emit_vm_flush = vcn_v1_0_jpeg_ring_emit_vm_flush, | ||
1584 | //.test_ring | ||
1585 | //.test_ib | ||
1586 | .insert_nop = vcn_v1_0_jpeg_ring_nop, | ||
1587 | .insert_start = vcn_v1_0_jpeg_ring_insert_start, | ||
1588 | .insert_end = vcn_v1_0_jpeg_ring_insert_end, | ||
1589 | .pad_ib = amdgpu_ring_generic_pad_ib, | ||
1590 | .begin_use = amdgpu_vcn_ring_begin_use, | ||
1591 | .end_use = amdgpu_vcn_ring_end_use, | ||
1592 | .emit_wreg = vcn_v1_0_jpeg_ring_emit_wreg, | ||
1593 | .emit_reg_wait = vcn_v1_0_jpeg_ring_emit_reg_wait, | ||
1594 | }; | ||
1595 | |||
1562 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev) | 1596 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev) |
1563 | { | 1597 | { |
1564 | adev->vcn.ring_dec.funcs = &vcn_v1_0_dec_ring_vm_funcs; | 1598 | adev->vcn.ring_dec.funcs = &vcn_v1_0_dec_ring_vm_funcs; |
@@ -1575,6 +1609,12 @@ static void vcn_v1_0_set_enc_ring_funcs(struct amdgpu_device *adev) | |||
1575 | DRM_INFO("VCN encode is enabled in VM mode\n"); | 1609 | DRM_INFO("VCN encode is enabled in VM mode\n"); |
1576 | } | 1610 | } |
1577 | 1611 | ||
1612 | static void vcn_v1_0_set_jpeg_ring_funcs(struct amdgpu_device *adev) | ||
1613 | { | ||
1614 | adev->vcn.ring_jpeg.funcs = &vcn_v1_0_jpeg_ring_vm_funcs; | ||
1615 | DRM_INFO("VCN jpeg decode is enabled in VM mode\n"); | ||
1616 | } | ||
1617 | |||
1578 | static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { | 1618 | static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { |
1579 | .set = vcn_v1_0_set_interrupt_state, | 1619 | .set = vcn_v1_0_set_interrupt_state, |
1580 | .process = vcn_v1_0_process_interrupt, | 1620 | .process = vcn_v1_0_process_interrupt, |