Skip to contentSkip to conversation

drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1

PATCH In review Sonny Jiang 2 participants 2 messages Jun 8, 2023

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

PATCH 1/1 drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1

From: Sonny Jiang <[email protected]>

Only vcn0 can process AV1 codecx. In order to use both vcn0 and vcn1 in h264/265 transcode to AV1 cases, set vcn0 sched score to 1 at initialization time.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +5 -1
index 8d371faaa2b3..b48bb5212488 100644
@@ -129,7 +129,11 @@ static int vcn_v4_0_sw_init(void *handle)
 		if (adev->vcn.harvest_config & (1 << i))
 			continue;
 
-		atomic_set(&adev->vcn.inst[i].sched_score, 0);
+		/* Init instance 0 sched_score to 1, so it's scheduled after other instances */
+		if (i == 0)
+			atomic_set(&adev->vcn.inst[i].sched_score, 1);
+		else
+			atomic_set(&adev->vcn.inst[i].sched_score, 0);
 
 		/* VCN UNIFIED TRAP */
 		r = amdgpu_irq_add_id(adev, amdgpu_ih_clientid_vcns[i],
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[Public]

________________________________
From: amd-gfx <[email protected]> on behalf of Sonny Jiang <[email protected]>
Sent: June 8, 2023 10:54 AM
To: [email protected] <[email protected]>
Cc: Jiang, Sonny <[email protected]>
Subject: [PATCH] drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1

From: Sonny Jiang <[email protected]>

Only vcn0 can process AV1 codecx. In order to use both vcn0 and vcn1 in h264/265 transcode to AV1 cases, set vcn0 sched score to 1 at initialization time.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +5 -1
index 8d371faaa2b3..b48bb5212488 100644
@@ -129,7 +129,11 @@ static int vcn_v4_0_sw_init(void *handle)
                 if (adev->vcn.harvest_config & (1 << i))
                         continue;
 
-               atomic_set(&adev->vcn.inst[i].sched_score, 0);
+               /* Init instance 0 sched_score to 1, so it's scheduled after other instances */
+               if (i == 0)
+                       atomic_set(&adev->vcn.inst[i].sched_score, 1);
+               else
+                       atomic_set(&adev->vcn.inst[i].sched_score, 0);
 
                 /* VCN UNIFIED TRAP */
                 r = amdgpu_irq_add_id(adev, amdgpu_ih_clientid_vcns[i],

--
2.34.1