OSDN Git Service

drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch
authorJames Zhu <James.Zhu@amd.com>
Mon, 10 Feb 2020 17:52:16 +0000 (12:52 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Apr 2020 18:44:45 +0000 (14:44 -0400)
commite3b41d82dabaf6f1da94df8339afeee66e9b1a7e
treec2251647d564f0e6c2d1dfd92d37261d588f5b7f
parentbd718638b8513e20a481a67f37a8acc1ebf2d957
drm/amdgpu/vcn: fix race condition issue for dpg unpause mode switch

Couldn't only rely on enc fence to decide switching to dpg unpaude mode.
Since a enc thread may not schedule a fence in time during multiple
threads running situation.

v3: 1. Rename enc_submission_cnt to dpg_enc_submission_cnt
    2. Add dpg_enc_submission_cnt check in idle_work_handler

v4:  Remove extra counter check, and reduce counter before idle
    work schedule

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h