diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/5059-drm-amdgpu-Power-down-acp-if-board-uses-AZ-v2.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/5059-drm-amdgpu-Power-down-acp-if-board-uses-AZ-v2.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/5059-drm-amdgpu-Power-down-acp-if-board-uses-AZ-v2.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/5059-drm-amdgpu-Power-down-acp-if-board-uses-AZ-v2.patch new file mode 100644 index 00000000..5c520495 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/5059-drm-amdgpu-Power-down-acp-if-board-uses-AZ-v2.patch @@ -0,0 +1,73 @@ +From f1b5a8092a0aa022b2083cdab25645d700a9e07e Mon Sep 17 00:00:00 2001 +From: Rex Zhu <Rex.Zhu@amd.com> +Date: Thu, 19 Jul 2018 11:48:36 -0500 +Subject: [PATCH 5059/5725] drm/amdgpu: Power down acp if board uses AZ (v2) + +if board uses AZ rather than ACP, we power down acp +through smu to save power. + +v2: handle S3/S4 and hw_fini (Alex) + +Reviewed-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +index 663634c..b1be634 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +@@ -289,10 +289,12 @@ static int acp_hw_init(void *handle) + r = amd_acp_hw_init(adev->acp.cgs_device, + ip_block->version->major, ip_block->version->minor); + /* -ENODEV means board uses AZ rather than ACP */ +- if (r == -ENODEV) ++ if (r == -ENODEV) { ++ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); + return 0; +- else if (r) ++ } else if (r) { + return r; ++ } + + if (adev->rmmio_size == 0 || adev->rmmio_size < 0x5289) + return -EINVAL; +@@ -498,8 +500,10 @@ static int acp_hw_fini(void *handle) + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + + /* return early if no ACP */ +- if (!adev->acp.acp_cell) ++ if (!adev->acp.acp_cell) { ++ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false); + return 0; ++ } + + /* Assert Soft reset of ACP */ + val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); +@@ -557,11 +561,21 @@ static int acp_hw_fini(void *handle) + + static int acp_suspend(void *handle) + { ++ struct amdgpu_device *adev = (struct amdgpu_device *)handle; ++ ++ /* power up on suspend */ ++ if (!adev->acp.acp_cell) ++ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false); + return 0; + } + + static int acp_resume(void *handle) + { ++ struct amdgpu_device *adev = (struct amdgpu_device *)handle; ++ ++ /* power down again on resume */ ++ if (!adev->acp.acp_cell) ++ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); + return 0; + } + +-- +2.7.4 + |