答复: [PATCH 3/3] drm/amdgpu: reset the asic when hibernating v2

2016-08-23 Thread Qu, Jim
Or, we also can use PM_EVENT_ messages to separate freeze, thaw, suspend, 
resume, poweroff and restore.

Thanks
JimQu


发件人: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> 代表 Michel Dänzer 
<mic...@daenzer.net>
发送时间: 2016年8月24日 9:03:20
收件人: Alex Deucher
抄送: amd-gfx@lists.freedesktop.org
主题: Re: [PATCH 3/3] drm/amdgpu: reset the asic when hibernating v2

On 24/08/16 02:45 AM, Alex Deucher wrote:
> Some blocks require a reset to properly resume if there
> is no power down of the asic like during various
> hibernation steps.
>
> Reset the asic on freeze and force asic_init on thaw.
>
> Port of:
> 274ad65c9d02bdcbee9bae045517864c3521d530
> (drm/radeon: hard reset r600 and newer GPU when hibernating.) from radeon.
>
> v2: split out just the freeze change and force init on thaw
>
> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index d0f65d4..2b57d68 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -423,14 +423,14 @@ static int amdgpu_pmops_freeze(struct device *dev)
>  {
>   struct pci_dev *pdev = to_pci_dev(dev);
>   struct drm_device *drm_dev = pci_get_drvdata(pdev);
> - return amdgpu_device_suspend(drm_dev, false, true, false);
> + return amdgpu_device_suspend(drm_dev, false, true, true);
>  }

FWIW, using a single flags parameter tends to be more readable than
multiple boolean parameters. Just a suggestion for possible further
improvement, not a blocker for this patch.


--
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 3/3] drm/amdgpu: reset the asic when hibernating v2

2016-08-23 Thread Michel Dänzer
On 24/08/16 02:45 AM, Alex Deucher wrote:
> Some blocks require a reset to properly resume if there
> is no power down of the asic like during various
> hibernation steps.
> 
> Reset the asic on freeze and force asic_init on thaw.
> 
> Port of:
> 274ad65c9d02bdcbee9bae045517864c3521d530
> (drm/radeon: hard reset r600 and newer GPU when hibernating.) from radeon.
> 
> v2: split out just the freeze change and force init on thaw
> 
> Signed-off-by: Alex Deucher 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index d0f65d4..2b57d68 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -423,14 +423,14 @@ static int amdgpu_pmops_freeze(struct device *dev)
>  {
>   struct pci_dev *pdev = to_pci_dev(dev);
>   struct drm_device *drm_dev = pci_get_drvdata(pdev);
> - return amdgpu_device_suspend(drm_dev, false, true, false);
> + return amdgpu_device_suspend(drm_dev, false, true, true);
>  }

FWIW, using a single flags parameter tends to be more readable than
multiple boolean parameters. Just a suggestion for possible further
improvement, not a blocker for this patch.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 3/3] drm/amdgpu: reset the asic when hibernating v2

2016-08-23 Thread Alex Deucher
Some blocks require a reset to properly resume if there
is no power down of the asic like during various
hibernation steps.

Reset the asic on freeze and force asic_init on thaw.

Port of:
274ad65c9d02bdcbee9bae045517864c3521d530
(drm/radeon: hard reset r600 and newer GPU when hibernating.) from radeon.

v2: split out just the freeze change and force init on thaw

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index d0f65d4..2b57d68 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -423,14 +423,14 @@ static int amdgpu_pmops_freeze(struct device *dev)
 {
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
-   return amdgpu_device_suspend(drm_dev, false, true, false);
+   return amdgpu_device_suspend(drm_dev, false, true, true);
 }
 
 static int amdgpu_pmops_thaw(struct device *dev)
 {
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
-   return amdgpu_device_resume(drm_dev, false, true, false);
+   return amdgpu_device_resume(drm_dev, false, true, true);
 }
 
 static int amdgpu_pmops_runtime_suspend(struct device *dev)
-- 
2.5.5

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx