]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: disable gpu-sched load balance for uvd
authorNirmoy Das <nirmoy.das@amd.com>
Sat, 29 Aug 2020 04:51:41 +0000 (06:51 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Sep 2020 18:46:54 +0000 (14:46 -0400)
On hardware with multiple uvd instances, dependent uvd jobs
may get scheduled to different uvd instances. Because uvd_enc
jobs retain hw context, dependent jobs should always run on the
same uvd instance. This patch disables GPU scheduler's load balancer
for a context that binds jobs from the same context to a uvd
instance.

v2: Squash in uvd_enc fix

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

index 59032c26fc82364bff3c38eaf4d04308806b6107..c80d8339f58c4726999de96a0b4a53b422efa156 100644 (file)
@@ -114,7 +114,11 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
        scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
        num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 
-       if (hw_ip == AMDGPU_HW_IP_VCN_ENC || hw_ip == AMDGPU_HW_IP_VCN_DEC) {
+       /* disable load balance if the hw engine retains context among dependent jobs */
+       if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
+           hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+           hw_ip == AMDGPU_HW_IP_UVD_ENC ||
+           hw_ip == AMDGPU_HW_IP_UVD) {
                sched = drm_sched_pick_best(scheds, num_scheds);
                scheds = &sched;
                num_scheds = 1;