All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: minor cleanup of phase1 suspend code
@ 2020-07-09 19:17 Nirmoy Das
  2020-07-09 21:13 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Nirmoy Das @ 2020-07-09 19:17 UTC (permalink / raw)
  To: amd-gfx; +Cc: Nirmoy Das

Cleanup of phase1 suspend code to reduce unnecessary indentation.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2913e41f63a5..81ca92127c00 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2456,18 +2456,21 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_blocks[i].status.valid)
 			continue;
+
 		/* displays are handled separately */
-		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_DCE) {
-			/* XXX handle errors */
-			r = adev->ip_blocks[i].version->funcs->suspend(adev);
-			/* XXX handle errors */
-			if (r) {
-				DRM_ERROR("suspend of IP block <%s> failed %d\n",
-					  adev->ip_blocks[i].version->funcs->name, r);
-				return r;
-			}
-			adev->ip_blocks[i].status.hw = false;
+		if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_DCE)
+			continue;
+
+		/* XXX handle errors */
+		r = adev->ip_blocks[i].version->funcs->suspend(adev);
+		/* XXX handle errors */
+		if (r) {
+			DRM_ERROR("suspend of IP block <%s> failed %d\n",
+				  adev->ip_blocks[i].version->funcs->name, r);
+			return r;
 		}
+
+		adev->ip_blocks[i].status.hw = false;
 	}
 
 	return 0;
-- 
2.27.0

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: minor cleanup of phase1 suspend code
  2020-07-09 19:17 [PATCH] drm/amdgpu: minor cleanup of phase1 suspend code Nirmoy Das
@ 2020-07-09 21:13 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2020-07-09 21:13 UTC (permalink / raw)
  To: Nirmoy Das; +Cc: Nirmoy Das, amd-gfx list

On Thu, Jul 9, 2020 at 3:15 PM Nirmoy Das <nirmoy.aiemd@gmail.com> wrote:
>
> Cleanup of phase1 suspend code to reduce unnecessary indentation.
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 2913e41f63a5..81ca92127c00 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2456,18 +2456,21 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
>         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
>                 if (!adev->ip_blocks[i].status.valid)
>                         continue;
> +
>                 /* displays are handled separately */
> -               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_DCE) {
> -                       /* XXX handle errors */
> -                       r = adev->ip_blocks[i].version->funcs->suspend(adev);
> -                       /* XXX handle errors */
> -                       if (r) {
> -                               DRM_ERROR("suspend of IP block <%s> failed %d\n",
> -                                         adev->ip_blocks[i].version->funcs->name, r);
> -                               return r;
> -                       }
> -                       adev->ip_blocks[i].status.hw = false;
> +               if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_DCE)
> +                       continue;
> +
> +               /* XXX handle errors */
> +               r = adev->ip_blocks[i].version->funcs->suspend(adev);
> +               /* XXX handle errors */
> +               if (r) {
> +                       DRM_ERROR("suspend of IP block <%s> failed %d\n",
> +                                 adev->ip_blocks[i].version->funcs->name, r);
> +                       return r;
>                 }
> +
> +               adev->ip_blocks[i].status.hw = false;
>         }
>
>         return 0;
> --
> 2.27.0
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-09 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 19:17 [PATCH] drm/amdgpu: minor cleanup of phase1 suspend code Nirmoy Das
2020-07-09 21:13 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.