[PATCH 2/2] drm/amdgpu: Power down acp if board uses AZ

Deucher, Alexander Alexander.Deucher at amd.com
Fri Jul 20 15:08:18 UTC 2018


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 at lists.freedesktop.org> on behalf of Zhu, Rex <Rex.Zhu at amd.com>
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 <alexdeucher at gmail.com>
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


On Thu, Jul 19, 2018 at 11:14 AM, Zhu, Rex <Rex.Zhu at amd.com<mailto:Rex.Zhu at amd.com>> wrote:

>We also need to power it back up in hw_fini and 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 <alexdeucher at gmail.com<mailto:alexdeucher at gmail.com>>
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

On Thu, Jul 19, 2018 at 4:46 AM, Rex Zhu <rex.zhu at amd.com<mailto:rex.zhu at amd.com>> wrote:
> 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

> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com<mailto:Rex.Zhu at amd.com>>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> index 71efcf3..4e18a88 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>
> 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.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180720/1462e9b0/attachment.html>


More information about the amd-gfx mailing list