Skip to content

Commit ea29221

Browse files
Nirmoy Dasalexdeucher
authored andcommitted
drm/amdgpu: do not set nil entry in compute_prio_sched
If there are no high priority compute queues available then set normal priority sched array to compute_prio_sched[AMDGPU_GFX_PIPE_PRIO_HIGH] Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 552b80d commit ea29221

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,17 @@ static void amdgpu_ctx_init_compute_sched(struct amdgpu_device *adev)
686686
adev->gfx.num_compute_sched[i] = num_compute_sched_normal;
687687

688688
i = AMDGPU_GFX_PIPE_PRIO_HIGH;
689-
adev->gfx.compute_prio_sched[i] =
690-
&adev->gfx.compute_sched[num_compute_sched_high - 1];
691-
adev->gfx.num_compute_sched[i] =
692-
adev->gfx.num_compute_rings - num_compute_sched_normal;
689+
if (num_compute_sched_high == (AMDGPU_MAX_COMPUTE_RINGS - 1)) {
690+
/* When compute has no high priority rings then use */
691+
/* normal priority sched array */
692+
adev->gfx.compute_prio_sched[i] = &adev->gfx.compute_sched[0];
693+
adev->gfx.num_compute_sched[i] = num_compute_sched_normal;
694+
} else {
695+
adev->gfx.compute_prio_sched[i] =
696+
&adev->gfx.compute_sched[num_compute_sched_high - 1];
697+
adev->gfx.num_compute_sched[i] =
698+
adev->gfx.num_compute_rings - num_compute_sched_normal;
699+
}
693700
}
694701

695702
void amdgpu_ctx_init_sched(struct amdgpu_device *adev)

0 commit comments

Comments
 (0)