aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/2991-drm-amdgpu-use-defines-for-mmBIF_IOV_FUNC_IDENTIFIER.patch
blob: 38571b34feaa6e708adfee585a68bae15d24dd5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 721a0d75e998a15de07b7cbe87fc4c33b5d7bf88 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Tue, 19 Dec 2017 09:57:53 -0500
Subject: [PATCH 2991/4131] 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>
---
 drivers/gpu/drm/amd/amdgpu/vi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 2687eca..729f7e5 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;
 	}
 
-- 
2.7.4