Commit 9a37f65c authored by Lang Yu's avatar Lang Yu Committed by Alex Deucher

drm/amdgpu/vpe: fix insert_nop ops

Avoid infinite loop when count is 0.
This is missed in rebase.
Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
Reviewed-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 54967d56
......@@ -240,11 +240,12 @@ static void vpe_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
{
int i;
amdgpu_ring_write(ring, ring->funcs->nop |
for (i = 0; i < count; i++)
if (i == 0)
amdgpu_ring_write(ring, ring->funcs->nop |
VPE_CMD_NOP_HEADER_COUNT(count - 1));
for (i = 0; i < count - 1; i++)
amdgpu_ring_write(ring, 0);
else
amdgpu_ring_write(ring, ring->funcs->nop);
}
static uint64_t vpe_get_csa_mc_addr(struct amdgpu_ring *ring, uint32_t vmid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment