drm/amd/pp: Add ACP PG support in SMU
Subsystems (2)
PATCH 1/2 drm/amd/pp: Add ACP PG support in SMU
when ACP block not enabled, we power off
acp block to save power.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 18 ++++++++++++++++++ drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 21 ++++++++++++++++++++- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 3 files changed, 39 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +18 -0
@@ -1181,6 +1181,21 @@ static int pp_dpm_powergate_gfx(void *handle, bool gate)return hwmgr->hwmgr_func->powergate_gfx (hwmgr, gate); } +static void pp_dpm_powergate_acp (void *handle,bool gate) +{ +struct pp_hwmgr *hwmgr = handle; + +if (!hwmgr || !hwmgr->pm_en) +return ; + +if (hwmgr->hwmgr_func->powergate_acp ==NULL ) { +pr_info ("%s was not implemented.\n" , __func__); +return ; + } + + hwmgr->hwmgr_func->powergate_acp (hwmgr, gate); +} +static int pp_set_powergating_by_smu (void *handle,uint32_t block_type,bool gate) {
@@ -1200,6 +1215,9 @@ static int pp_set_powergating_by_smu(void *handle,case AMD_IP_BLOCK_TYPE_GFX : ret =pp_dpm_powergate_gfx (handle, gate);break ; +case AMD_IP_BLOCK_TYPE_ACP : +pp_dpm_powergate_acp (handle, gate); +break ;default :break ; }
drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +20 -1
@@ -663,8 +663,13 @@ static void smu8_init_power_gate_state(struct pp_hwmgr *hwmgr) data->uvd_power_gated = false; data->vce_power_gated = false; data->samu_power_gated = false; +#ifdef CONFIG_DRM_AMD_ACP data->acp_power_gated = false; - data->pgacpinit = true; +#else +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerOFF); + data->acp_power_gated = true; +#endif + }static void smu8_init_sclk_threshold (struct pp_hwmgr *hwmgr)
@@ -1885,6 +1890,19 @@ static int smu8_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable) } +static void smu8_dpm_powergate_acp (struct pp_hwmgr *hwmgr,bool bgate) +{ +struct smu8_hwmgr *data = hwmgr->backend; + +if (data->acp_power_gated == bgate) +return ; + +if (bgate) +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerOFF); +else +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerON); +} +static void smu8_dpm_powergate_uvd (struct pp_hwmgr *hwmgr,bool bgate) {struct smu8_hwmgr *data = hwmgr->backend;
@@ -1950,6 +1968,7 @@ static void smu8_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) .powerdown_uvd = smu8_dpm_powerdown_uvd, .powergate_uvd = smu8_dpm_powergate_uvd, .powergate_vce = smu8_dpm_powergate_vce, + .powergate_acp = smu8_dpm_powergate_acp, .get_mclk = smu8_dpm_get_mclk, .get_sclk = smu8_dpm_get_sclk, .patch_boot_state = smu8_dpm_patch_boot_state,
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
@@ -247,6 +247,7 @@ struct pp_hwmgr_func {int (*powerdown_uvd)(struct pp_hwmgr *hwmgr);void (*powergate_vce)(struct pp_hwmgr *hwmgr,bool bgate);void (*powergate_uvd)(struct pp_hwmgr *hwmgr,bool bgate); +void (*powergate_acp)(struct pp_hwmgr *hwmgr,bool bgate);uint32_t (*get_mclk)(struct pp_hwmgr *hwmgr,bool low);uint32_t (*get_sclk)(struct pp_hwmgr *hwmgr,bool low); int (*power_state_set)(struct pp_hwmgr *hwmgr,
Signature · 6 lines
1.9.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): 1531990018-29711-1-git-send-email-rex.zhu-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: Power down acp if board uses AZ
if board uses AZ rather than ACP, we power down acp through smu to save power.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +5 -3
@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1f
@@ -289,11 +290,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 ;
Signature · 6 lines
1.9.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): 1531990018-29711-2-git-send-email-rex.zhu-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 3 lines · Rex Zhu
if board uses AZ rather than ACP, we power down acp through smu to save power.
We also need to power it back up in hw_fini and suspend and then power it back down in resume.
Alex
Quoted 36 lines
Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +5
-4@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1f@@ -289,11 +290,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 ; --1.9.1
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
A message that is not in the archive (sent off-list or not yet received): CADnq5_OiAsxsCN3KiqOggwj_vgFXDb_J7a7_GVm8GXEsWNv7RA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 2 lines
We also need to power it back up in
hw_finiand suspend and then power it back down in resume.
Yes, this logic will be added in acp block.
In this patch, we only power down acp when it was not used and have no inpact wen s3.
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]>
Sent: Thursday, July 19, 2018 9:56 PM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 3 lines · Rex Zhu
if board uses AZ rather than ACP, we power down acp through smu to save power.
We also need to power it back up in hw_fini and suspend and then power it back down in resume.
Alex
Quoted 36 lines
Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +5
-4@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1f@@ -289,11 +290,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 ; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.
_______________________________________________
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): CY4PR12MB1687C48AD2DAAB101BC823B6FB520-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 7 lines · Rex
Quoted 2 lines
We also need to power it back up in
hw_finiand suspend and then power it back down in resume.Yes, this logic will be added in acp block.
In this patch, we only power down acp when it was not used and have no inpact wen s3.
But I think when the asic comes out of S3/S4, the ACP block will be powered up again so it will have to be powered down again to avoid using power after resume. So if the platform uses AZ rather than ACP, we need to handle that case and to power ACP back up on hw_fini() in case the driver gets reloaded. S4 works similarly. Something like the attached patch.
Alex
Quoted 64 lines
Best Regards
Rex------------------------------
*From:* Alex Deucher <[email protected]> *Sent:* Thursday, July 19, 2018 9:56 PM
*To:* Zhu, Rex
*Cc:* amd-gfx list
*Subject:* Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZQuoted 3 lines · Rex Zhu
if board uses AZ rather than ACP, we power down acp through smu to save power.
We also need to power it back up in
hw_finiand suspend and then power it back down in resume.Alex
Review
Quoted 6 lines
Signed-off-by Rex Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.cQuoted 12 lines
index 71efcf3..4e18a88 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +1
-0@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1fdrivers/gpu/drm/amd/amdgpu/amdgpu_acp.c static int acp_hw_init(void *handle) · line 291
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +0
-0@@ -289,11 +290,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);drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c static int acp_hw_init(void *handle) · line 294
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +2
-1/* -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);Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +2
-3return 0 ; - else if (r) + }else if (r) {return r; - + }if (adev->rmmio_size ==0 || adev->rmmio_size <0x5289 )return -EINVAL ; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 8 lines
amd-gfx Info Page - freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.
From 73f4669a60f0def1c5dc61f99a201f88c6d0e528 Mon Sep 17 00:00:00 2001
From: Rex Zhu <[email protected]>
Date: Thu, 19 Jul 2018 11:48:36 -0500
Subject: [PATCH] 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)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +17 -3
@@ -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 ;
@@ -497,8 +499,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);
@@ -556,11 +560,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 ; }
Signature · 1 line
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): CADnq5_P=MunRPuEyqN91c0nj6DdRo7cXKw9u+TTweZKG7zJ1iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Hi Alex,
I am Ok with the patch in v2.
just one question,
+ if (!adev->acp.acp_cell)
+ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);
Do we need to check adev->acp.acp_cell before poweron/off ACP?
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]>
Sent: Friday, July 20, 2018 12:53:37 AM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 2 lines · On Thu, Jul 19, 2018 at 11:14 AM, Zhu, Rex…
We also need to power it back up in
hw_finiand suspend and then power it back down in resume.
Yes, this logic will be added in acp block.
In this patch, we only power down acp when it was not used and have no inpact wen s3.
But I think when the asic comes out of S3/S4, the ACP block will be powered up again so it will have to be powered down again to avoid using power after resume. So if the platform uses AZ rather than ACP, we need to handle that case and to power ACP back up on hw_fini() in case the driver gets reloaded. S4 works similarly. Something like the attached patch.
Alex
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]<mailto:[email protected]>>
Sent: Thursday, July 19, 2018 9:56 PM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 3 lines · On Thu, Jul 19, 2018 at 4:46 AM, Rex Zhu…
if board uses AZ rather than ACP, we power down acp through smu to save power.
We also need to power it back up in hw_fini and suspend and then power it back down in resume.
Alex
Quoted 36 lines
Signed-off-by Rex Zhu <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +5
-4@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1f@@ -289,11 +290,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 ; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org<http://lists.freedesktop.org>
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org<http://freedesktop.org> lists is subject to our Code of Conduct.
_______________________________________________
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): CY4PR12MB16876BF550336DE2751FC7CFFB510-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
We just check that as a way see whether we are using AZ audio (and gpu driver should control ACP power) or i2s audio (and acp driver controls power). In the former case, there is no structure allocated.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Zhu, Rex <[email protected]>
Sent: Friday, July 20, 2018 6:31:50 AM
To: Alex Deucher
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Hi Alex,
I am Ok with the patch in v2.
just one question,
+ if (!adev->acp.acp_cell)
+ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);
Do we need to check adev->acp.acp_cell before poweron/off ACP?
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]>
Sent: Friday, July 20, 2018 12:53:37 AM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 2 lines · On Thu, Jul 19, 2018 at 11:14 AM, Zhu, Rex…
We also need to power it back up in
hw_finiand suspend and then power it back down in resume.
Yes, this logic will be added in acp block.
In this patch, we only power down acp when it was not used and have no inpact wen s3.
But I think when the asic comes out of S3/S4, the ACP block will be powered up again so it will have to be powered down again to avoid using power after resume. So if the platform uses AZ rather than ACP, we need to handle that case and to power ACP back up on hw_fini() in case the driver gets reloaded. S4 works similarly. Something like the attached patch.
Alex
Best Regards
Rex
________________________________
From: Alex Deucher <[email protected]<mailto:[email protected]>>
Sent: Thursday, July 19, 2018 9:56 PM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ
Quoted 3 lines · On Thu, Jul 19, 2018 at 4:46 AM, Rex Zhu…
if board uses AZ rather than ACP, we power down acp through smu to save power.
We also need to power it back up in hw_fini and suspend and then power it back down in resume.
Alex
Quoted 36 lines
Signed-off-by Rex Zhu <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +5
-4@@ -35,6 +35,7 @@#include "acp_gfx_if.h" +#define ACP_TILE_ON_MASK 0x03#define ACP_TILE_OFF_MASK 0x02#define ACP_TILE_ON_RETAIN_REG_MASK 0x1f@@ -289,11 +290,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 ; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org<http://lists.freedesktop.org>
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org<http://freedesktop.org> lists is subject to our Code of Conduct.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Reviewed-byQuoted 4 lines · Rex Zhu
when ACP block not enabled, we power off
acp block to save power.Signed-off-by Rex Zhu <[email protected]>
Quoted 104 lines
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 18 ++++++++++++++++++ drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 21 ++++++++++++++++++++- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 3 files changed, 39 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +18
-0@@ -1181,6 +1181,21 @@ static int pp_dpm_powergate_gfx(void *handle, bool gate)return hwmgr->hwmgr_func->powergate_gfx (hwmgr, gate); } +static void pp_dpm_powergate_acp (void *handle,bool gate) +{ +struct pp_hwmgr *hwmgr = handle; + +if (!hwmgr || !hwmgr->pm_en) +return ; + +if (hwmgr->hwmgr_func->powergate_acp ==NULL ) { +pr_info ("%s was not implemented.\n" , __func__); +return ; + } + + hwmgr->hwmgr_func->powergate_acp (hwmgr, gate); +} +static int pp_set_powergating_by_smu (void *handle,uint32_t block_type,bool gate) {@@ -1200,6 +1215,9 @@ static int pp_set_powergating_by_smu(void *handle,case AMD_IP_BLOCK_TYPE_GFX : ret =pp_dpm_powergate_gfx (handle, gate);break ; +case AMD_IP_BLOCK_TYPE_ACP : +pp_dpm_powergate_acp (handle, gate); +break ;default :break ; }drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +20
-1@@ -663,8 +663,13 @@ static void smu8_init_power_gate_state(struct pp_hwmgr *hwmgr) data->uvd_power_gated = false; data->vce_power_gated = false; data->samu_power_gated = false; +#ifdef CONFIG_DRM_AMD_ACP data->acp_power_gated = false; - data->pgacpinit = true; +#else +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerOFF); + data->acp_power_gated = true; +#endif + }static void smu8_init_sclk_threshold (struct pp_hwmgr *hwmgr)@@ -1885,6 +1890,19 @@ static int smu8_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable) } +static void smu8_dpm_powergate_acp (struct pp_hwmgr *hwmgr,bool bgate) +{ +struct smu8_hwmgr *data = hwmgr->backend; + +if (data->acp_power_gated == bgate) +return ; + +if (bgate) +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerOFF); +else +smum_send_msg_to_smc (hwmgr, PPSMC_MSG_ACPPowerON); +} +static void smu8_dpm_powergate_uvd (struct pp_hwmgr *hwmgr,bool bgate) {struct smu8_hwmgr *data = hwmgr->backend;@@ -1950,6 +1968,7 @@ static void smu8_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) .powerdown_uvd = smu8_dpm_powerdown_uvd, .powergate_uvd = smu8_dpm_powergate_uvd, .powergate_vce = smu8_dpm_powergate_vce, + .powergate_acp = smu8_dpm_powergate_acp, .get_mclk = smu8_dpm_get_mclk, .get_sclk = smu8_dpm_get_sclk, .patch_boot_state = smu8_dpm_patch_boot_state,drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1
-1@@ -247,6 +247,7 @@ struct pp_hwmgr_func {int (*powerdown_uvd)(struct pp_hwmgr *hwmgr);void (*powergate_vce)(struct pp_hwmgr *hwmgr,bool bgate);void (*powergate_uvd)(struct pp_hwmgr *hwmgr,bool bgate); +void (*powergate_acp)(struct pp_hwmgr *hwmgr,bool bgate);uint32_t (*get_mclk)(struct pp_hwmgr *hwmgr,bool low);uint32_t (*get_sclk)(struct pp_hwmgr *hwmgr,bool low); int (*power_state_set)(struct pp_hwmgr *hwmgr, --1.9.1
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