All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Unify the dm resume calls into one
@ 2018-02-05 21:14 mikita.lipski-5C7GfCeVMHo
       [not found] ` <1517865269-15199-1-git-send-email-mikita.lipski-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: mikita.lipski-5C7GfCeVMHo @ 2018-02-05 21:14 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	harry.wentland-5C7GfCeVMHo, andrey.grodzovsky-5C7GfCeVMHo
  Cc: Mikita Lipski

From: Mikita Lipski <mikita.lipski@amd.com>

amdgpu_dm_display_resume is now called from dm_resume to
unify DAL resume call into a single function call

There is no more need to separately call 2 resume functions
for DM.

Initially they were separated to resume display state after
cursor is pinned. But because there is no longer any corruption
with the cursor - the calls can be merged into one function hook.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c        | 10 +---------
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  4 +++-
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 850453e..0aaba27 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2287,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
 				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
 			}
 			drm_modeset_unlock_all(dev);
-		} else {
-			/*
-			 * There is no equivalent atomic helper to turn on
-			 * display, so we defined our own function for this,
-			 * once suspend resume is supported by the atomic
-			 * framework this will be reworked
-			 */
-			amdgpu_dm_display_resume(adev);
 		}
 	}
 
@@ -2515,6 +2507,7 @@ static int amdgpu_device_reset(struct amdgpu_device *adev,
 				goto out;
 
 			r = amdgpu_device_ip_resume_phase2(adev);
+
 			if (r)
 				goto out;
 
@@ -2729,7 +2722,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 	if (amdgpu_device_has_dc_support(adev)) {
 		if (drm_atomic_helper_resume(adev->ddev, state))
 			dev_info(adev->dev, "drm resume failed:%d\n", r);
-		amdgpu_dm_display_resume(adev);
 	} else {
 		drm_helper_resume_force_mode(adev->ddev);
 	}
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ac82382..8e6e60e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -659,11 +659,13 @@ static int dm_resume(void *handle)
 {
 	struct amdgpu_device *adev = handle;
 	struct amdgpu_display_manager *dm = &adev->dm;
+	int ret = 0;
 
 	/* power on hardware */
 	dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
 
-	return 0;
+	ret = amdgpu_dm_display_resume(adev);
+	return ret;
 }
 
 int amdgpu_dm_display_resume(struct amdgpu_device *adev)
-- 
2.7.4

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

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

* Re: [PATCH] drm/amdgpu: Unify the dm resume calls into one
       [not found] ` <1517865269-15199-1-git-send-email-mikita.lipski-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-05 21:16   ` Harry Wentland
  2018-02-05 21:35   ` Andrey Grodzovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2018-02-05 21:16 UTC (permalink / raw)
  To: mikita.lipski-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	andrey.grodzovsky-5C7GfCeVMHo

On 2018-02-05 04:14 PM, mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
> 
> amdgpu_dm_display_resume is now called from dm_resume to
> unify DAL resume call into a single function call
> 
> There is no more need to separately call 2 resume functions
> for DM.
> 
> Initially they were separated to resume display state after
> cursor is pinned. But because there is no longer any corruption
> with the cursor - the calls can be merged into one function hook.
> 
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c        | 10 +---------
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  4 +++-
>  2 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 850453e..0aaba27 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2287,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
>  				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
>  			}
>  			drm_modeset_unlock_all(dev);
> -		} else {
> -			/*
> -			 * There is no equivalent atomic helper to turn on
> -			 * display, so we defined our own function for this,
> -			 * once suspend resume is supported by the atomic
> -			 * framework this will be reworked
> -			 */
> -			amdgpu_dm_display_resume(adev);
>  		}
>  	}
>  
> @@ -2515,6 +2507,7 @@ static int amdgpu_device_reset(struct amdgpu_device *adev,
>  				goto out;
>  
>  			r = amdgpu_device_ip_resume_phase2(adev);
> +

Nitpick: remove the unrelated newline change.

With this fixed patch is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

>  			if (r)
>  				goto out;
>  
> @@ -2729,7 +2722,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>  	if (amdgpu_device_has_dc_support(adev)) {
>  		if (drm_atomic_helper_resume(adev->ddev, state))
>  			dev_info(adev->dev, "drm resume failed:%d\n", r);
> -		amdgpu_dm_display_resume(adev);
>  	} else {
>  		drm_helper_resume_force_mode(adev->ddev);
>  	}
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index ac82382..8e6e60e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -659,11 +659,13 @@ static int dm_resume(void *handle)
>  {
>  	struct amdgpu_device *adev = handle;
>  	struct amdgpu_display_manager *dm = &adev->dm;
> +	int ret = 0;
>  
>  	/* power on hardware */
>  	dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
>  
> -	return 0;
> +	ret = amdgpu_dm_display_resume(adev);
> +	return ret;
>  }
>  
>  int amdgpu_dm_display_resume(struct amdgpu_device *adev)
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: Unify the dm resume calls into one
       [not found] ` <1517865269-15199-1-git-send-email-mikita.lipski-5C7GfCeVMHo@public.gmane.org>
  2018-02-05 21:16   ` Harry Wentland
@ 2018-02-05 21:35   ` Andrey Grodzovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Grodzovsky @ 2018-02-05 21:35 UTC (permalink / raw)
  To: mikita.lipski-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	harry.wentland-5C7GfCeVMHo


[-- Attachment #1.1: Type: text/plain, Size: 2866 bytes --]

Reviewed-by: Andrey Grodzovsky<andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>

Andrey


On 02/05/2018 04:14 PM, mikita.lipski-5C7GfCeVMHo@public.gmane.org wrote:
> From: Mikita Lipski <mikita.lipski-5C7GfCeVMHo@public.gmane.org>
>
> amdgpu_dm_display_resume is now called from dm_resume to
> unify DAL resume call into a single function call
>
> There is no more need to separately call 2 resume functions
> for DM.
>
> Initially they were separated to resume display state after
> cursor is pinned. But because there is no longer any corruption
> with the cursor - the calls can be merged into one function hook.
>
> Signed-off-by: Mikita Lipski <mikita.lipski-5C7GfCeVMHo@public.gmane.org>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c        | 10 +---------
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  4 +++-
>   2 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 850453e..0aaba27 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2287,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
>   				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
>   			}
>   			drm_modeset_unlock_all(dev);
> -		} else {
> -			/*
> -			 * There is no equivalent atomic helper to turn on
> -			 * display, so we defined our own function for this,
> -			 * once suspend resume is supported by the atomic
> -			 * framework this will be reworked
> -			 */
> -			amdgpu_dm_display_resume(adev);
>   		}
>   	}
>   
> @@ -2515,6 +2507,7 @@ static int amdgpu_device_reset(struct amdgpu_device *adev,
>   				goto out;
>   
>   			r = amdgpu_device_ip_resume_phase2(adev);
> +
>   			if (r)
>   				goto out;
>   
> @@ -2729,7 +2722,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>   	if (amdgpu_device_has_dc_support(adev)) {
>   		if (drm_atomic_helper_resume(adev->ddev, state))
>   			dev_info(adev->dev, "drm resume failed:%d\n", r);
> -		amdgpu_dm_display_resume(adev);
>   	} else {
>   		drm_helper_resume_force_mode(adev->ddev);
>   	}
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index ac82382..8e6e60e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -659,11 +659,13 @@ static int dm_resume(void *handle)
>   {
>   	struct amdgpu_device *adev = handle;
>   	struct amdgpu_display_manager *dm = &adev->dm;
> +	int ret = 0;
>   
>   	/* power on hardware */
>   	dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
>   
> -	return 0;
> +	ret = amdgpu_dm_display_resume(adev);
> +	return ret;
>   }
>   
>   int amdgpu_dm_display_resume(struct amdgpu_device *adev)


[-- Attachment #1.2: Type: text/html, Size: 3562 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

end of thread, other threads:[~2018-02-05 21:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 21:14 [PATCH] drm/amdgpu: Unify the dm resume calls into one mikita.lipski-5C7GfCeVMHo
     [not found] ` <1517865269-15199-1-git-send-email-mikita.lipski-5C7GfCeVMHo@public.gmane.org>
2018-02-05 21:16   ` Harry Wentland
2018-02-05 21:35   ` Andrey Grodzovsky

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.