mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/amdgpu/vcn4.0: enable secure submission on unified ring
Set secure_submission_supported = true for the VCN unified ring funcs in vcn_v4_0.c so secure IBs are allowed on the unified ring. Without this, protected decode submissions are blocked by the common IB gate and can fail playback for secure content. For vcn_v4_0.c, the secure ring funcs are selected for the secure-capable IP version. This change only advertises existing hardware/firmware capability; non-secure decode paths are unaffected. Signed-off-by: Jeevana Muthyala <jmuthyal@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
09774af2a7
commit
9667dc9f1c
|
|
@ -1992,7 +1992,7 @@ static int vcn_v4_0_ring_reset(struct amdgpu_ring *ring,
|
|||
return amdgpu_ring_reset_helper_end(ring, timedout_fence);
|
||||
}
|
||||
|
||||
static struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
|
||||
static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
|
||||
.type = AMDGPU_RING_TYPE_VCN_ENC,
|
||||
.align_mask = 0x3f,
|
||||
.nop = VCN_ENC_CMD_NO_OP,
|
||||
|
|
@ -2025,6 +2025,40 @@ static struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
|
|||
.reset = vcn_v4_0_ring_reset,
|
||||
};
|
||||
|
||||
static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs_secure = {
|
||||
.type = AMDGPU_RING_TYPE_VCN_ENC,
|
||||
.align_mask = 0x3f,
|
||||
.nop = VCN_ENC_CMD_NO_OP,
|
||||
.secure_submission_supported = true,
|
||||
.no_user_fence = true,
|
||||
.extra_bytes = sizeof(struct amdgpu_vcn_rb_metadata),
|
||||
.get_rptr = vcn_v4_0_unified_ring_get_rptr,
|
||||
.get_wptr = vcn_v4_0_unified_ring_get_wptr,
|
||||
.set_wptr = vcn_v4_0_unified_ring_set_wptr,
|
||||
.patch_cs_in_place = vcn_v4_0_ring_patch_cs_in_place,
|
||||
.emit_frame_size =
|
||||
SOC15_FLUSH_GPU_TLB_NUM_WREG * 3 +
|
||||
SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 4 +
|
||||
4 + /* vcn_v2_0_enc_ring_emit_vm_flush */
|
||||
5 + 5 + /* vcn_v2_0_enc_ring_emit_fence x2 vm fence */
|
||||
1, /* vcn_v2_0_enc_ring_insert_end */
|
||||
.emit_ib_size = 5, /* vcn_v2_0_enc_ring_emit_ib */
|
||||
.emit_ib = vcn_v2_0_enc_ring_emit_ib,
|
||||
.emit_fence = vcn_v2_0_enc_ring_emit_fence,
|
||||
.emit_vm_flush = vcn_v2_0_enc_ring_emit_vm_flush,
|
||||
.test_ring = amdgpu_vcn_enc_ring_test_ring,
|
||||
.test_ib = amdgpu_vcn_unified_ring_test_ib,
|
||||
.insert_nop = amdgpu_ring_insert_nop,
|
||||
.insert_end = vcn_v2_0_enc_ring_insert_end,
|
||||
.pad_ib = amdgpu_ring_generic_pad_ib,
|
||||
.begin_use = amdgpu_vcn_ring_begin_use,
|
||||
.end_use = amdgpu_vcn_ring_end_use,
|
||||
.emit_wreg = vcn_v2_0_enc_ring_emit_wreg,
|
||||
.emit_reg_wait = vcn_v2_0_enc_ring_emit_reg_wait,
|
||||
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
|
||||
.reset = vcn_v4_0_ring_reset,
|
||||
};
|
||||
|
||||
/**
|
||||
* vcn_v4_0_set_unified_ring_funcs - set unified ring functions
|
||||
*
|
||||
|
|
@ -2041,10 +2075,11 @@ static void vcn_v4_0_set_unified_ring_funcs(struct amdgpu_device *adev)
|
|||
continue;
|
||||
|
||||
if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 2))
|
||||
vcn_v4_0_unified_ring_vm_funcs.secure_submission_supported = true;
|
||||
|
||||
adev->vcn.inst[i].ring_enc[0].funcs =
|
||||
(const struct amdgpu_ring_funcs *)&vcn_v4_0_unified_ring_vm_funcs;
|
||||
adev->vcn.inst[i].ring_enc[0].funcs =
|
||||
&vcn_v4_0_unified_ring_vm_funcs_secure;
|
||||
else
|
||||
adev->vcn.inst[i].ring_enc[0].funcs =
|
||||
&vcn_v4_0_unified_ring_vm_funcs;
|
||||
adev->vcn.inst[i].ring_enc[0].me = i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user