summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-12-19 09:57:53 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-19 23:44:13 -0500
commit04a0d2d9a6ee9dad813efadc653a7708220f9de8 (patch)
treecfe4bee083ad44989eff691302d5a6d57b5340ed /drivers/gpu/drm/amd
parent57ad33a307bf85cafda3a77c03a555c9f9ee4139 (diff)
downloadlinux-04a0d2d9a6ee9dad813efadc653a7708220f9de8.tar.bz2
drm/amdgpu: use defines for mmBIF_IOV_FUNC_IDENTIFIER fields
Rather than magic numbers. Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index c59b37365e4d..da2b99c2d95f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -455,11 +455,10 @@ static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
adev->asic_type == CHIP_FIJI) {
reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER);
/* bit0: 0 means pf and 1 means vf */
- /* bit31: 0 means disable IOV and 1 means enable */
- if (reg & 1)
+ if (REG_GET_FIELD(reg, BIF_IOV_FUNC_IDENTIFIER, FUNC_IDENTIFIER))
adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
-
- if (reg & 0x80000000)
+ /* bit31: 0 means disable IOV and 1 means enable */
+ if (REG_GET_FIELD(reg, BIF_IOV_FUNC_IDENTIFIER, IOV_ENABLE))
adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
}