Skip to contentSkip to conversation

drm/amdgpu: allow secure submission on VCN4 ring

PATCH In review sguttula 2 participants 4 messages Jul 14, 2023 – Jul 17, 2023

Subsystems (2)
lore
Share & tools
lore

sguttula

author
#0 lore raw

PATCH 1/2 drm/amdgpu: allow secure submission on VCN4 ring

This patch will enable secure decode playback on VCN4

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 -0
index e8c02ae10163..d199f87febd1 100644
@@ -1804,6 +1804,7 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
 static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
 	.type = AMDGPU_RING_TYPE_VCN_ENC,
 	.align_mask = 0x3f,
+	.secure_submission_supported = true,
 	.nop = VCN_ENC_CMD_NO_OP,
 	.get_rptr = vcn_v4_0_unified_ring_get_rptr,
 	.get_wptr = vcn_v4_0_unified_ring_get_wptr,
Signature · 1 line
2.25.1
#1 lore raw
Quoted 12 lines · sguttula

This patch will enable secure decode playback on VCN4

---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index e8c02ae10163..d199f87febd1 100644

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p, · line 1807

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 -0
@@ -1804,6 +1804,7 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
  static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
  	.type = AMDGPU_RING_TYPE_VCN_ENC,
  	.align_mask = 0x3f,
+	.secure_submission_supported = true,

We should set it to true  with VCN4_0_4 only for now, and check either this boolean or VCN4_0_4 with your implementation from patch 2

Regards,

Leo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
  	.nop = VCN_ENC_CMD_NO_OP,
  	.get_rptr = vcn_v4_0_unified_ring_get_rptr,
  	.get_wptr = vcn_v4_0_unified_ring_get_wptr,
#2 lore raw

Hi Leo,

There are two issues here.

This change fixing the Crash while secure playback and we see below error:

2023-07-14T15:51:24.837592Z ERR kernel: [  129.255823] amdgpu 0000:c2:00.0: amdgpu: secure submissions not supported on ring <vcn_unified_0>
2023-07-14T15:51:24.837601Z ERR kernel: [  129.255827] [drm:amdgpu_job_run] *ERROR* Error scheduling IBs (-22)
2023-07-14T15:51:24.837603Z INFO kernel: [  129.255834] [drm] Skip scheduling IBs!

The second one : https://patchwork.freedesktop.org/patch/547587/
Fixing the garbage/corruption.

With both patches playback working fine.

Thanks,
Suresh G

-----Original Message-----
From: Liu, Leo <[email protected]>
Sent: Friday, July 14, 2023 7:08 PM
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/2] drm/amdgpu: allow secure submission on VCN4 ring

Quoted 13 lines · sguttula

This patch will enable secure decode playback on VCN4

---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index e8c02ae10163..d199f87febd1 100644

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p, · line 1807

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 -0
@@ -1804,6 +1804,7 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
  static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
  	.type = AMDGPU_RING_TYPE_VCN_ENC,
  	.align_mask = 0x3f,
+	.secure_submission_supported = true,

We should set it to true  with VCN4_0_4 only for now, and check either this boolean or VCN4_0_4 with your implementation from patch 2

Regards,

Leo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
  	.nop = VCN_ENC_CMD_NO_OP,
  	.get_rptr = vcn_v4_0_unified_ring_get_rptr,
  	.get_wptr = vcn_v4_0_unified_ring_get_wptr,
#3 lore raw

Since the changes will affect multiple ASICs, if you only tested with VCN4_0_4, please just apply the set to that HW.

Regards,

Leo

Quoted 53 lines · Suresh

Hi Leo,

There are two issues here.

This change fixing the Crash while secure playback and we see below error:

2023-07-14T15:51:24.837592Z ERR kernel: [  129.255823] amdgpu 0000:c2:00.0: amdgpu: secure submissions not supported on ring <vcn_unified_0>
2023-07-14T15:51:24.837601Z ERR kernel: [  129.255827] [drm:amdgpu_job_run] *ERROR* Error scheduling IBs (-22)
2023-07-14T15:51:24.837603Z INFO kernel: [  129.255834] [drm] Skip scheduling IBs!

The second one : https://patchwork.freedesktop.org/patch/547587/
Fixing the garbage/corruption.

With both patches playback working fine.

Thanks,
Suresh G

-----Original Message-----
From: Liu, Leo <[email protected]>
Sent: Friday, July 14, 2023 7:08 PM
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/2] drm/amdgpu: allow secure submission on VCN4 ring

Quoted 13 lines · sguttula

This patch will enable secure decode playback on VCN4

---
   drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 +
   1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index e8c02ae10163..d199f87febd1 100644

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p, · line 1807

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 -0
@@ -1804,6 +1804,7 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
   static const struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = {
   	.type = AMDGPU_RING_TYPE_VCN_ENC,
   	.align_mask = 0x3f,
+	.secure_submission_supported = true,

We should set it to true  with VCN4_0_4 only for now, and check either this boolean or VCN4_0_4 with your implementation from patch 2

Regards,

Leo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
   	.nop = VCN_ENC_CMD_NO_OP,
   	.get_rptr = vcn_v4_0_unified_ring_get_rptr,
   	.get_wptr = vcn_v4_0_unified_ring_get_wptr,