drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji
Subsystems (2)
PATCH 1/2 drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji
We only support SR-IOV on tonga/fiji. Don't check this register on other VI parts.
--- drivers/gpu/drm/amd/amdgpu/vi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/vi.c +13 -8
@@ -449,14 +449,19 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,static void vi_detect_hw_virtualization (struct amdgpu_device *adev) { -uint32_t 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 ) - adev->virt.caps |=AMDGPU_SRIOV_CAPS_IS_VF ; - -if (reg &0x80000000 ) - adev->virt.caps |=AMDGPU_SRIOV_CAPS_ENABLE_IOV ; +uint32_t reg =0 ; + +if (adev->asic_type ==CHIP_TONGA || + 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 ) + adev->virt.caps |=AMDGPU_SRIOV_CAPS_IS_VF ; + +if (reg &0x80000000 ) + adev->virt.caps |=AMDGPU_SRIOV_CAPS_ENABLE_IOV ; + }if (reg ==0 ) {if (is_virtual_machine ())/* passthrough mode exclus sr-iov mode */
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20171219150650.14659-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: use defines for mmBIF_IOV_FUNC_IDENTIFIER fields
Rather than magic numbers.
--- drivers/gpu/drm/amd/amdgpu/vi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/vi.c +3 -4
@@ -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 ; }
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20171219150650.14659-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Yu, Xiangliang
Reviewed-by Xiangliang YuRE: [PATCH 2/2] drm/amdgpu: use defines for mmBIF_IOV_FUNC_IDENTIFIER fields
Quoted 42 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Tuesday, December 19, 2017 11:07 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: use defines formmBIF_IOV_FUNC_IDENTIFIERfieldsRather than magic numbers.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/vi.cindexc59b37365e4d..da2b99c2d95f100644drivers/gpu/drm/amd/amdgpu/vi.c +4
-5@@ -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.13.6
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Yu, Xiangliang
Reviewed-by Xiangliang YuQuoted 54 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Tuesday, December 19, 2017 11:07 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: only checkmmBIF_IOV_FUNC_IDENTIFIERon tonga/fijiWe only support SR-IOV on tonga/fiji. Don't check this register on other VI parts.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/vi.cindexd9bb26322850..c59b37365e4d100644drivers/gpu/drm/amd/amdgpu/vi.c +13
-8@@ -449,14 +449,19 @@ static bool vi_read_bios_from_rom(structamdgpu_device *adev, static void vi_detect_hw_virtualization(struct amdgpu_device *adev) { - uint32_t 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 ) - adev->virt.caps |=AMDGPU_SRIOV_CAPS_IS_VF ; - -if (reg &0x80000000 ) - adev->virt.caps |=AMDGPU_SRIOV_CAPS_ENABLE_IOV ; + uint32_t reg = 0; + +if (adev->asic_type ==CHIP_TONGA || + 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 ) + adev->virt.caps |=AMDGPU_SRIOV_CAPS_IS_VF ; + +if (reg &0x80000000 ) + adev->virt.caps |=AMDGPU_SRIOV_CAPS_ENABLE_IOV ; + }if (reg ==0 ) {if (is_virtual_machine ())/* passthrough mode exclus sr-iov mode */
--
2.13.6
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx