Re: [PATCH] drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up

2018-07-25 Thread Huang Rui
On Tue, Jul 24, 2018 at 09:32:40AM +0530, Shirish S wrote:
> This patch moves amdgpu_fbdev_set_suspend() to the beginning
> of suspend sequence.
> 
> This is to ensure fbcon does not to write to the VRAM
> after GPU is powerd down.
> 
> Signed-off-by: Shirish S 
> Reviewed-by: Michel Dänzer 

Reviewed-by: Huang Rui 

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 7a1bec1..745f760 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2702,6 +2702,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
> suspend, bool fbcon)
>  
>   drm_kms_helper_poll_disable(dev);
>  
> + if (fbcon)
> + amdgpu_fbdev_set_suspend(adev, 1);
> +
>   if (!amdgpu_device_has_dc_support(adev)) {
>   /* turn off display hw */
>   drm_modeset_lock_all(dev);
> @@ -2767,9 +2770,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
> suspend, bool fbcon)
>   DRM_ERROR("amdgpu asic reset failed\n");
>   }
>  
> - if (fbcon)
> - amdgpu_fbdev_set_suspend(adev, 1);
> -
>   return 0;
>  }
>  
> -- 
> 2.7.4
> 
> ___
> 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] drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up

2018-07-24 Thread Alex Deucher
On Tue, Jul 24, 2018 at 12:02 AM, Shirish S  wrote:
> This patch moves amdgpu_fbdev_set_suspend() to the beginning
> of suspend sequence.
>
> This is to ensure fbcon does not to write to the VRAM
> after GPU is powerd down.
>
> Signed-off-by: Shirish S 
> Reviewed-by: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 7a1bec1..745f760 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2702,6 +2702,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
> suspend, bool fbcon)
>
> drm_kms_helper_poll_disable(dev);
>
> +   if (fbcon)
> +   amdgpu_fbdev_set_suspend(adev, 1);
> +
> if (!amdgpu_device_has_dc_support(adev)) {
> /* turn off display hw */
> drm_modeset_lock_all(dev);
> @@ -2767,9 +2770,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
> suspend, bool fbcon)
> DRM_ERROR("amdgpu asic reset failed\n");
> }
>
> -   if (fbcon)
> -   amdgpu_fbdev_set_suspend(adev, 1);
> -
> return 0;
>  }
>
> --
> 2.7.4
>
> ___
> 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


[PATCH] drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up

2018-07-23 Thread Shirish S
This patch moves amdgpu_fbdev_set_suspend() to the beginning
of suspend sequence.

This is to ensure fbcon does not to write to the VRAM
after GPU is powerd down.

Signed-off-by: Shirish S 
Reviewed-by: Michel Dänzer 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7a1bec1..745f760 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2702,6 +2702,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
suspend, bool fbcon)
 
drm_kms_helper_poll_disable(dev);
 
+   if (fbcon)
+   amdgpu_fbdev_set_suspend(adev, 1);
+
if (!amdgpu_device_has_dc_support(adev)) {
/* turn off display hw */
drm_modeset_lock_all(dev);
@@ -2767,9 +2770,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
suspend, bool fbcon)
DRM_ERROR("amdgpu asic reset failed\n");
}
 
-   if (fbcon)
-   amdgpu_fbdev_set_suspend(adev, 1);
-
return 0;
 }
 
-- 
2.7.4

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


Re: [PATCH] drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up

2018-07-23 Thread Michel Dänzer
On 2018-07-23 12:06 PM, Shirish S wrote:
> This patch moves amdgpu_fbdev_set_suspend() to the beginning 
> of suspend sequence.

Would be nice to have some rationale, e.g.:

 This is to avoid fbcon trying to write to the GPU's memory when the GPU
 is already powered down.


Other than that looks great, thanks. With a rationale added to the
commit log,

Reviewed-by: Michel Dänzer 


-- 
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] drm/amdgpu: move the amdgpu_fbdev_set_suspend() further up

2018-07-23 Thread Shirish S
This patch moves amdgpu_fbdev_set_suspend() to the beginning 
of suspend sequence.

Signed-off-by: Shirish S 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7a1bec1..745f760 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2702,6 +2702,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
suspend, bool fbcon)
 
drm_kms_helper_poll_disable(dev);
 
+   if (fbcon)
+   amdgpu_fbdev_set_suspend(adev, 1);
+
if (!amdgpu_device_has_dc_support(adev)) {
/* turn off display hw */
drm_modeset_lock_all(dev);
@@ -2767,9 +2770,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
suspend, bool fbcon)
DRM_ERROR("amdgpu asic reset failed\n");
}
 
-   if (fbcon)
-   amdgpu_fbdev_set_suspend(adev, 1);
-
return 0;
 }
 
-- 
2.7.4

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