diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2021-08-09 13:17:10 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-10-04 15:23:01 -0400 |
commit | f174161517412225ec7f785ed9edc9d46d0e08dc (patch) | |
tree | 261bbe759d14f8fbb90ca85699218347195d91bf /drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | |
parent | 1b592d00b4ac8359f35882bd678296da157b8408 (diff) | |
download | linux-f174161517412225ec7f785ed9edc9d46d0e08dc.tar.gz linux-f174161517412225ec7f785ed9edc9d46d0e08dc.tar.bz2 linux-f174161517412225ec7f785ed9edc9d46d0e08dc.zip |
drm/amdgpu: get VCN harvest information from IP discovery table
Use the table rather than asic specific harvest registers.
v2: remove harvesting register checking
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c index a81d834ea0d3..316cbef70276 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c @@ -87,7 +87,6 @@ static void vcn_v3_0_enc_ring_set_wptr(struct amdgpu_ring *ring); static int vcn_v3_0_early_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; - int i; if (amdgpu_sriov_vf(adev)) { adev->vcn.num_vcn_inst = VCN_INSTANCES_SIENNA_CICHLID; @@ -95,20 +94,10 @@ static int vcn_v3_0_early_init(void *handle) adev->vcn.num_enc_rings = 1; } else { - if (adev->ip_versions[UVD_HWIP] == IP_VERSION(3, 0, 0)) { - u32 harvest; - - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - harvest = RREG32_SOC15(VCN, i, mmCC_UVD_HARVESTING); - if (harvest & CC_UVD_HARVESTING__UVD_DISABLE_MASK) - adev->vcn.harvest_config |= 1 << i; - } - - if (adev->vcn.harvest_config == (AMDGPU_VCN_HARVEST_VCN0 | - AMDGPU_VCN_HARVEST_VCN1)) - /* both instances are harvested, disable the block */ - return -ENOENT; - } + if (adev->vcn.harvest_config == (AMDGPU_VCN_HARVEST_VCN0 | + AMDGPU_VCN_HARVEST_VCN1)) + /* both instances are harvested, disable the block */ + return -ENOENT; if (adev->ip_versions[UVD_HWIP] == IP_VERSION(3, 0, 33)) adev->vcn.num_enc_rings = 0; |