<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Leo Liu <leo.liu@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Sonny Jiang <sonny.jiang@amd.com><br>
<b>Sent:</b> June 8, 2023 10:54 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Jiang, Sonny <Sonny.Jiang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: vcn_4_0 set instance 0 init sched score to 1</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Sonny Jiang <sonjiang@amd.com><br>
<br>
Only vcn0 can process AV1 codecx. In order to use both vcn0 and<br>
vcn1 in h264/265 transcode to AV1 cases, set vcn0 sched score to 1<br>
at initialization time.<br>
<br>
Signed-off-by: Sonny Jiang <sonjiang@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 6 +++++-<br>
 1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c<br>
index 8d371faaa2b3..b48bb5212488 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c<br>
@@ -129,7 +129,11 @@ static int vcn_v4_0_sw_init(void *handle)<br>
                 if (adev->vcn.harvest_config & (1 << i))<br>
                         continue;<br>
 <br>
-               atomic_set(&adev->vcn.inst[i].sched_score, 0);<br>
+               /* Init instance 0 sched_score to 1, so it's scheduled after other instances */<br>
+               if (i == 0)<br>
+                       atomic_set(&adev->vcn.inst[i].sched_score, 1);<br>
+               else<br>
+                       atomic_set(&adev->vcn.inst[i].sched_score, 0);<br>
 <br>
                 /* VCN UNIFIED TRAP */<br>
                 r = amdgpu_irq_add_id(adev, amdgpu_ih_clientid_vcns[i],<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>