Skip to contentSkip to conversation

drm/amdgpu/vcn5.0.0: enable secure submission on unified ring

PATCH In review Jeevana Muthyala 3 participants 3 messages May 19

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/vcn5.0.0: enable secure submission on unified ring

From: Jeevana Muthyala <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +5 -2
index d5f49fa33bee..cef15d6a4704 100644
@@ -1203,7 +1203,7 @@ static int vcn_v5_0_0_ring_reset(struct amdgpu_ring *ring,
 	return amdgpu_ring_reset_helper_end(ring, timedout_fence);
 }
 
-static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
+static struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
 	.type = AMDGPU_RING_TYPE_VCN_ENC,
 	.align_mask = 0x3f,
 	.nop = VCN_ENC_CMD_NO_OP,
@@ -1244,12 +1244,15 @@ static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
 static void vcn_v5_0_0_set_unified_ring_funcs(struct amdgpu_device *adev)
 {
 	int i;
+    
+	if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(5, 3, 0))
+		vcn_v5_0_0_unified_ring_vm_funcs.secure_submission_supported = true;
 
 	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
 		if (adev->vcn.harvest_config & (1 << i))
 			continue;
 
-		adev->vcn.inst[i].ring_enc[0].funcs = &vcn_v5_0_0_unified_ring_vm_funcs;
+		adev->vcn.inst[i].ring_enc[0].funcs = (const struct amdgpu_ring_funcs *)&vcn_v5_0_0_unified_ring_vm_funcs;
 		adev->vcn.inst[i].ring_enc[0].me = i;
 	}
 }
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

AMD General

Quoted 62 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jeevana Muthyala
Sent: May 19, 2026 9:15 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Muthyala, Jeevana <[email protected]>; Muthyala, Jeevana <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn5.0.0: enable secure submission on unified ring

[Some people who received this message don't often get email from [email protected]. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]

From: Jeevana Muthyala <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +1 -1
index d5f49fa33bee..cef15d6a4704 100644
@@ -1203,7 +1203,7 @@ static int vcn_v5_0_0_ring_reset(struct
 amdgpu_ring *ring,
        return amdgpu_ring_reset_helper_end(ring, timedout_fence);
 }
 
-static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs
 = {
+static struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
        .type = AMDGPU_RING_TYPE_VCN_ENC,
        .align_mask = 0x3f,
        .nop = VCN_ENC_CMD_NO_OP,
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +3 -1
@@ -1244,12 +1244,15 @@ static const struct amdgpu_ring_funcs
 vcn_v5_0_0_unified_ring_vm_funcs = {
 static void vcn_v5_0_0_set_unified_ring_funcs(struct amdgpu_device
 *adev)
 {
        int i;
+
+       if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(5, 3, 0))
+
 vcn_v5_0_0_unified_ring_vm_funcs.secure_submission_supported = true;
 
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                if (adev->vcn.harvest_config & (1 << i))
                        continue;
 
-               adev->vcn.inst[i].ring_enc[0].funcs =

&vcn_v5_0_0_unified_ring_vm_funcs;
+ adev->vcn.inst[i].ring_enc[0].funcs = (const struct

amdgpu_ring_funcs *)&vcn_v5_0_0_unified_ring_vm_funcs;
                adev->vcn.inst[i].ring_enc[0].me = i;
        }

}
--
2.43.0

#2 lore raw
In reply to Jeevana Muthyala
Quoted 22 lines · Jeevana Muthyala

From: Jeevana Muthyala <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +1 -1
index d5f49fa33bee..cef15d6a4704 100644
@@ -1203,7 +1203,7 @@ static int vcn_v5_0_0_ring_reset(struct amdgpu_ring *ring,
        return amdgpu_ring_reset_helper_end(ring, timedout_fence);
 }
 
-static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
+static struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
        .type = AMDGPU_RING_TYPE_VCN_ENC,
        .align_mask = 0x3f,
        .nop = VCN_ENC_CMD_NO_OP,

drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = { · line 1249

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +3 -0
@@ -1244,12 +1244,15 @@ static const struct amdgpu_ring_funcs vcn_v5_0_0_unified_ring_vm_funcs = {
 static void vcn_v5_0_0_set_unified_ring_funcs(struct amdgpu_device *adev)
 {
        int i;
+
+       if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(5, 3, 0))
+               vcn_v5_0_0_unified_ring_vm_funcs.secure_submission_supported = true;

This won't work. You are changing a global structure. Please add a duplicate vcn_v5_0_0_unified_ring_vm_funcs_secure with the flag set and use that for 5.3.0 and use the other one for other 5.x.x variants.

Alex

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +1 -2
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                if (adev->vcn.harvest_config & (1 << i))
                        continue;
 
-               adev->vcn.inst[i].ring_enc[0].funcs = &vcn_v5_0_0_unified_ring_vm_funcs;
+               adev->vcn.inst[i].ring_enc[0].funcs = (const struct amdgpu_ring_funcs *)&vcn_v5_0_0_unified_ring_vm_funcs;
                adev->vcn.inst[i].ring_enc[0].me = i;
        }
 }
--

2.43.0