All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/amdgpu: Disable DPM in virtualization
@ 2016-11-17  5:59 Trigger Huang
       [not found] ` <1479362340-6222-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Trigger Huang @ 2016-11-17  5:59 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Trigger Huang

This patch is used for virtualization support. In virtualization,
only SMU manager is needed, DPM should be disabled. This is a
use case for commit 2f9346b6f984
("drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.")

Change in V2, according to Christian's suggestion,
This patch will not mess with module parameters amdgpu_dpm, but make
that a dependency for when amdgpu_dpm is evaluated.

Signed-off-by: Trigger Huang <trigger.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 2 +-
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
index e2f0507..fc592c2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
@@ -184,7 +184,7 @@ static int amdgpu_pp_hw_init(void *handle)
 		ret = adev->powerplay.ip_funcs->hw_init(
 					adev->powerplay.pp_handle);
 
-	if (amdgpu_dpm != 0)
+	if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev))
 		adev->pm.dpm_enabled = true;
 
 	return ret;
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 4a4f97b..51a3607 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -911,7 +911,8 @@ static int amd_pp_instance_init(struct amd_pp_init *pp_init,
 
 	amd_pp->pp_handle = handle;
 
-	if (amdgpu_dpm == 0)
+	if ((amdgpu_dpm == 0)
+		|| cgs_is_virtualization_enabled(pp_init->device))
 		return 0;
 
 	ret = hwmgr_init(pp_init, handle);
@@ -940,7 +941,8 @@ static int amd_pp_instance_fini(void *handle)
 	if (instance == NULL)
 		return -EINVAL;
 
-	if (amdgpu_dpm != 0) {
+	if ((amdgpu_dpm != 0)
+		&& !cgs_is_virtualization_enabled(instance->smu_mgr->device)) {
 		eventmgr_fini(instance->eventmgr);
 		hwmgr_fini(instance->hwmgr);
 	}
@@ -1004,7 +1006,8 @@ int amd_powerplay_reset(void *handle)
 
 	hw_init_power_state_table(instance->hwmgr);
 
-	if (amdgpu_dpm == 0)
+	if ((amdgpu_dpm == 0)
+		|| cgs_is_virtualization_enabled(instance->smu_mgr->device))
 		return 0;
 
 	if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)
-- 
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 v2] drm/amdgpu: Disable DPM in virtualization
       [not found] ` <1479362340-6222-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org>
@ 2016-11-17  7:56   ` Christian König
  2016-11-17 14:32   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2016-11-17  7:56 UTC (permalink / raw)
  To: Trigger Huang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 17.11.2016 um 06:59 schrieb Trigger Huang:
> This patch is used for virtualization support. In virtualization,
> only SMU manager is needed, DPM should be disabled. This is a
> use case for commit 2f9346b6f984
> ("drm/amdgpu/powerplay: pp module only enable smu when dpm disabled.")
>
> Change in V2, according to Christian's suggestion,
> This patch will not mess with module parameters amdgpu_dpm, but make
> that a dependency for when amdgpu_dpm is evaluated.
>
> Signed-off-by: Trigger Huang <trigger.huang@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 2 +-
>   drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++++---
>   2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> index e2f0507..fc592c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> @@ -184,7 +184,7 @@ static int amdgpu_pp_hw_init(void *handle)
>   		ret = adev->powerplay.ip_funcs->hw_init(
>   					adev->powerplay.pp_handle);
>   
> -	if (amdgpu_dpm != 0)
> +	if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev))
>   		adev->pm.dpm_enabled = true;
>   
>   	return ret;
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index 4a4f97b..51a3607 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -911,7 +911,8 @@ static int amd_pp_instance_init(struct amd_pp_init *pp_init,
>   
>   	amd_pp->pp_handle = handle;
>   
> -	if (amdgpu_dpm == 0)
> +	if ((amdgpu_dpm == 0)
> +		|| cgs_is_virtualization_enabled(pp_init->device))
>   		return 0;
>   
>   	ret = hwmgr_init(pp_init, handle);
> @@ -940,7 +941,8 @@ static int amd_pp_instance_fini(void *handle)
>   	if (instance == NULL)
>   		return -EINVAL;
>   
> -	if (amdgpu_dpm != 0) {
> +	if ((amdgpu_dpm != 0)
> +		&& !cgs_is_virtualization_enabled(instance->smu_mgr->device)) {
>   		eventmgr_fini(instance->eventmgr);
>   		hwmgr_fini(instance->hwmgr);
>   	}
> @@ -1004,7 +1006,8 @@ int amd_powerplay_reset(void *handle)
>   
>   	hw_init_power_state_table(instance->hwmgr);
>   
> -	if (amdgpu_dpm == 0)
> +	if ((amdgpu_dpm == 0)
> +		|| cgs_is_virtualization_enabled(instance->smu_mgr->device))
>   		return 0;
>   
>   	if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)


_______________________________________________
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 v2] drm/amdgpu: Disable DPM in virtualization
       [not found] ` <1479362340-6222-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org>
  2016-11-17  7:56   ` Christian König
@ 2016-11-17 14:32   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2016-11-17 14:32 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Huang, Trigger

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Trigger Huang
> Sent: Thursday, November 17, 2016 12:59 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, Trigger
> Subject: [PATCH v2] drm/amdgpu: Disable DPM in virtualization
> 
> This patch is used for virtualization support. In virtualization,
> only SMU manager is needed, DPM should be disabled. This is a
> use case for commit 2f9346b6f984
> ("drm/amdgpu/powerplay: pp module only enable smu when dpm
> disabled.")
> 
> Change in V2, according to Christian's suggestion,
> This patch will not mess with module parameters amdgpu_dpm, but make
> that a dependency for when amdgpu_dpm is evaluated.
> 
> Signed-off-by: Trigger Huang <trigger.huang@amd.com>

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

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 2 +-
>  drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++++---
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> index e2f0507..fc592c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
> @@ -184,7 +184,7 @@ static int amdgpu_pp_hw_init(void *handle)
>  		ret = adev->powerplay.ip_funcs->hw_init(
>  					adev->powerplay.pp_handle);
> 
> -	if (amdgpu_dpm != 0)
> +	if ((amdgpu_dpm != 0) && !amdgpu_sriov_vf(adev))
>  		adev->pm.dpm_enabled = true;
> 
>  	return ret;
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index 4a4f97b..51a3607 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -911,7 +911,8 @@ static int amd_pp_instance_init(struct amd_pp_init
> *pp_init,
> 
>  	amd_pp->pp_handle = handle;
> 
> -	if (amdgpu_dpm == 0)
> +	if ((amdgpu_dpm == 0)
> +		|| cgs_is_virtualization_enabled(pp_init->device))
>  		return 0;
> 
>  	ret = hwmgr_init(pp_init, handle);
> @@ -940,7 +941,8 @@ static int amd_pp_instance_fini(void *handle)
>  	if (instance == NULL)
>  		return -EINVAL;
> 
> -	if (amdgpu_dpm != 0) {
> +	if ((amdgpu_dpm != 0)
> +		&& !cgs_is_virtualization_enabled(instance->smu_mgr-
> >device)) {
>  		eventmgr_fini(instance->eventmgr);
>  		hwmgr_fini(instance->hwmgr);
>  	}
> @@ -1004,7 +1006,8 @@ int amd_powerplay_reset(void *handle)
> 
>  	hw_init_power_state_table(instance->hwmgr);
> 
> -	if (amdgpu_dpm == 0)
> +	if ((amdgpu_dpm == 0)
> +		|| cgs_is_virtualization_enabled(instance->smu_mgr-
> >device))
>  		return 0;
> 
>  	if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)
> --
> 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

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

end of thread, other threads:[~2016-11-17 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17  5:59 [PATCH v2] drm/amdgpu: Disable DPM in virtualization Trigger Huang
     [not found] ` <1479362340-6222-1-git-send-email-trigger.huang-5C7GfCeVMHo@public.gmane.org>
2016-11-17  7:56   ` Christian König
2016-11-17 14:32   ` Deucher, Alexander

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.