drm/amdgpu: check PSP support before adding the ip block
Subsystems (2)
PATCH 1/2 drm/amdgpu: check PSP support before adding the ip block
So that we do not need to check this in every internal function.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 24 ------------------------ drivers/gpu/drm/amd/amdgpu/soc15.c | 13 ++++++++----- 2 files changed, 8 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -24
@@ -67,9 +67,6 @@ static int psp_sw_init(void *handle) psp->adev = adev; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; - ret =psp_init_microcode (psp);if (ret) {DRM_ERROR ("Failed to load psp firmware!\n" );
@@ -83,9 +80,6 @@ static int psp_sw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; -release_firmware (adev->psp.sos_fw); adev->psp.sos_fw =NULL ;release_firmware (adev->psp.asd_fw);
@@ -721,10 +715,6 @@ static int psp_hw_init(void *handle)int ret;struct amdgpu_device *adev = (struct amdgpu_device *)handle; - -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; -mutex_lock (&adev->firmware.mutex);/* * This sequence is just used on hw_init only once, no need on
@@ -754,9 +744,6 @@ static int psp_hw_fini(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct psp_context *psp = &adev->psp; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; -if (adev->gmc.xgmi.num_physical_nodes >1 && psp->xgmi_context.initialized ==1 )psp_xgmi_terminate (psp);
@@ -785,9 +772,6 @@ static int psp_suspend(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct psp_context *psp = &adev->psp; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; -if (adev->gmc.xgmi.num_physical_nodes >1 && psp->xgmi_context.initialized ==1 ) { ret =psp_xgmi_terminate (psp);
@@ -812,9 +796,6 @@ static int psp_resume(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct psp_context *psp = &adev->psp; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) -return 0 ; -DRM_INFO ("PSP is resuming...\n" );mutex_lock (&adev->firmware.mutex);
@@ -850,11 +831,6 @@ static bool psp_check_fw_loading_status(struct amdgpu_device *adev, {struct amdgpu_firmware_info *ucode =NULL ; -if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) { -DRM_INFO ("firmware is not loaded by PSP\n" ); -return true; - } -if (!adev->firmware.fw_size)return false;
drivers/gpu/drm/amd/amdgpu/soc15.c +8 -5
@@ -595,10 +595,12 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &vega10_common_ip_block);amdgpu_device_ip_block_add (adev, &gmc_v9_0_ip_block);amdgpu_device_ip_block_add (adev, &vega10_ih_ip_block); -if (adev->asic_type ==CHIP_VEGA20 ) -amdgpu_device_ip_block_add (adev, &psp_v11_0_ip_block); -else -amdgpu_device_ip_block_add (adev, &psp_v3_1_ip_block); +if (likely (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP )) { +if (adev->asic_type ==CHIP_VEGA20 ) +amdgpu_device_ip_block_add (adev, &psp_v11_0_ip_block); +else +amdgpu_device_ip_block_add (adev, &psp_v3_1_ip_block); + }amdgpu_device_ip_block_add (adev, &gfx_v9_0_ip_block);amdgpu_device_ip_block_add (adev, &sdma_v4_0_ip_block);if (!amdgpu_sriov_vf (adev))
@@ -620,7 +622,8 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &vega10_common_ip_block);amdgpu_device_ip_block_add (adev, &gmc_v9_0_ip_block);amdgpu_device_ip_block_add (adev, &vega10_ih_ip_block); -amdgpu_device_ip_block_add (adev, &psp_v10_0_ip_block); +if (likely (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP )) +amdgpu_device_ip_block_add (adev, &psp_v10_0_ip_block);amdgpu_device_ip_block_add (adev, &gfx_v9_0_ip_block);amdgpu_device_ip_block_add (adev, &sdma_v4_0_ip_block);amdgpu_device_ip_block_add (adev, &pp_smu_ip_block);
Signature · 6 lines
2.20.1 _______________________________________________ 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): [email protected]
PATCH 2/2 drm/amdgpu: fix wrong APU judgement
Fix the APU judgement to make it really work as expected.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -2483,7 +2483,7 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)return ret; }/* PCIe Perf counters won't work on APU nodes */ -if (adev->flags & !AMD_IS_APU ) { +if (!(adev->flags &AMD_IS_APU )) { ret =device_create_file (adev->dev, &dev_attr_pcie_bw);if (ret) {DRM_ERROR ("failed to create device file pcie_bw\n" );
@@ -2546,7 +2546,7 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)device_remove_file (adev->dev, &dev_attr_pp_od_clk_voltage);device_remove_file (adev->dev, &dev_attr_gpu_busy_percent); -if (adev->flags & !AMD_IS_APU ) +if (!(adev->flags &AMD_IS_APU ))device_remove_file (adev->dev, &dev_attr_pcie_bw);if ((adev->asic_type >=CHIP_VEGA10 ) && !(adev->flags &AMD_IS_APU ))
Signature · 6 lines
2.20.1 _______________________________________________ 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): [email protected]
Deucher, Alexander
Reviewed-byRe: [PATCH 2/2] drm/amdgpu: fix wrong APU judgement
Series is:
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Wednesday, January 16, 2019 1:16:15 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH 2/2] drm/amdgpu: fix wrong APU judgement
Fix the APU judgement to make it really work as expected.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -2483,7 +2483,7 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)return ret; }/* PCIe Perf counters won't work on APU nodes */ -if (adev->flags & !AMD_IS_APU ) { +if (!(adev->flags &AMD_IS_APU )) { ret =device_create_file (adev->dev, &dev_attr_pcie_bw);if (ret) {DRM_ERROR ("failed to create device file pcie_bw\n" );
@@ -2546,7 +2546,7 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)device_remove_file (adev->dev, &dev_attr_pp_od_clk_voltage);device_remove_file (adev->dev, &dev_attr_gpu_busy_percent); -if (adev->flags & !AMD_IS_APU ) +if (!(adev->flags &AMD_IS_APU ))device_remove_file (adev->dev, &dev_attr_pcie_bw);if ((adev->asic_type >=CHIP_VEGA10 ) && !(adev->flags &AMD_IS_APU ))
--
2.20.1
_______________________________________________
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