diff mbox

[1/3] drm/nouveau/tegra: Skip manual unpowergating when not necessary

Message ID 20170609122541.31118-1-mperttunen@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mikko Perttunen June 9, 2017, 12:25 p.m. UTC
On Tegra186, powergating is handled by the BPMP power domain provider
and the "legacy" powergating API is not available. Therefore skip
these calls if we are attached to a power domain.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Ben Skeggs June 12, 2017, 10:52 p.m. UTC | #1
On 06/09/2017 10:25 PM, Mikko Perttunen wrote:
> On Tegra186, powergating is handled by the BPMP power domain provider
> and the "legacy" powergating API is not available. Therefore skip
> these calls if we are attached to a power domain.
Thanks Mikko,

Taken all 3 patches into my tree.

Ben.

> 
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> index 6474bd2a6d07..3d42cdbbe9c0 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> @@ -51,10 +51,12 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
>  	reset_control_assert(tdev->rst);
>  	udelay(10);
>  
> -	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
> -	if (ret)
> -		goto err_clamp;
> -	udelay(10);
> +	if (!tdev->pdev->dev.pm_domain) {
> +		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
> +		if (ret)
> +			goto err_clamp;
> +		udelay(10);
> +	}
>  
>  	reset_control_deassert(tdev->rst);
>  	udelay(10);
>
Mikko Perttunen June 13, 2017, 12:43 p.m. UTC | #2
On 13.06.2017 01:52, Ben Skeggs wrote:
> On 06/09/2017 10:25 PM, Mikko Perttunen wrote:
>> On Tegra186, powergating is handled by the BPMP power domain provider
>> and the "legacy" powergating API is not available. Therefore skip
>> these calls if we are attached to a power domain.
> Thanks Mikko,
>
> Taken all 3 patches into my tree.

Thanks!

>
> Ben.
>
>>
>> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>> ---
>>  drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
>> index 6474bd2a6d07..3d42cdbbe9c0 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
>> @@ -51,10 +51,12 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
>>  	reset_control_assert(tdev->rst);
>>  	udelay(10);
>>
>> -	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
>> -	if (ret)
>> -		goto err_clamp;
>> -	udelay(10);
>> +	if (!tdev->pdev->dev.pm_domain) {
>> +		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
>> +		if (ret)
>> +			goto err_clamp;
>> +		udelay(10);
>> +	}
>>
>>  	reset_control_deassert(tdev->rst);
>>  	udelay(10);
>>
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
index 6474bd2a6d07..3d42cdbbe9c0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
@@ -51,10 +51,12 @@  nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
 	reset_control_assert(tdev->rst);
 	udelay(10);
 
-	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
-	if (ret)
-		goto err_clamp;
-	udelay(10);
+	if (!tdev->pdev->dev.pm_domain) {
+		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+		if (ret)
+			goto err_clamp;
+		udelay(10);
+	}
 
 	reset_control_deassert(tdev->rst);
 	udelay(10);