drm/amd/amdgpu: Update VCN initizalization behvaior
authorBokun Zhang <Bokun.Zhang@amd.com>
Tue, 10 Nov 2020 20:15:50 +0000 (15:15 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Nov 2020 05:13:51 +0000 (00:13 -0500)
commit3617e579eba427ed1f6b86050fe678623184db74
tree28d4a2a83029cc72f7591f571403c1c7ab8be457
parent6bfbfe8c4591c53bf8435af1a0f45b575ba5f53e
drm/amd/amdgpu: Update VCN initizalization behvaior

- Issue:
  In the original vcn3.0 code, it assumes that the VCN's
  init_status is always 1, even after the MMSCH
  updates the header.

  This is incorrect since by default, it should be set to 0,
  and MMSCH will update it to 1 if VCN is ready.

- Fix:
  We need to read back the table header after send it to MMSCH.
  After that, if a VCN instance is not ready (host disabled it),
  we needs to disable the ring buffer as well.

Signed-off-by: Bokun Zhang <Bokun.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c