[RESEND] drm: Switch to use DEVFREQ_GOV_SIMPLE_ONDEMAND constant

Submitted by Yue Hu on July 25, 2019, 3:52 a.m.

Details

Message ID 20190725035239.1192-1-zbestahu@gmail.com
State New
Headers show
Series "drm: Switch to use DEVFREQ_GOV_SIMPLE_ONDEMAND constant" ( rev: 2 ) in Freedreno

Not browsing as part of any series.

Commit Message

Yue Hu July 25, 2019, 3:52 a.m.
From: Yue Hu <huyue2@yulong.com>

Since governor name is defined by DEVFREQ framework internally, use the
macro definition instead of using the name directly.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 drivers/gpu/drm/msm/msm_gpu.c               | 3 ++-
 drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 4edb874..f7308d6 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -95,7 +95,8 @@  static void msm_devfreq_init(struct msm_gpu *gpu)
 	 */
 
 	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
-			&msm_devfreq_profile, "simple_ondemand", NULL);
+			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
+			NULL);
 
 	if (IS_ERR(gpu->devfreq.devfreq)) {
 		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
index db79853..a7c18bc 100644
--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
@@ -157,7 +157,8 @@  int panfrost_devfreq_init(struct panfrost_device *pfdev)
 	dev_pm_opp_put(opp);
 
 	pfdev->devfreq.devfreq = devm_devfreq_add_device(&pfdev->pdev->dev,
-			&panfrost_devfreq_profile, "simple_ondemand", NULL);
+			&panfrost_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
+			NULL);
 	if (IS_ERR(pfdev->devfreq.devfreq)) {
 		DRM_DEV_ERROR(&pfdev->pdev->dev, "Couldn't initialize GPU devfreq\n");
 		ret = PTR_ERR(pfdev->devfreq.devfreq);

Comments

On 19. 7. 25. 오후 12:52, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> Since governor name is defined by DEVFREQ framework internally, use the
> macro definition instead of using the name directly.
> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>
> ---
>  drivers/gpu/drm/msm/msm_gpu.c               | 3 ++-
>  drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 4edb874..f7308d6 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -95,7 +95,8 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
>  	 */
>  
>  	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
> -			&msm_devfreq_profile, "simple_ondemand", NULL);
> +			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>  
>  	if (IS_ERR(gpu->devfreq.devfreq)) {
>  		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> index db79853..a7c18bc 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> @@ -157,7 +157,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
>  	dev_pm_opp_put(opp);
>  
>  	pfdev->devfreq.devfreq = devm_devfreq_add_device(&pfdev->pdev->dev,
> -			&panfrost_devfreq_profile, "simple_ondemand", NULL);
> +			&panfrost_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>  	if (IS_ERR(pfdev->devfreq.devfreq)) {
>  		DRM_DEV_ERROR(&pfdev->pdev->dev, "Couldn't initialize GPU devfreq\n");
>  		ret = PTR_ERR(pfdev->devfreq.devfreq);
> 

The include/linux/devfreq.h defines the governor name.
It looks good to me.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
On Thu, Jul 25, 2019 at 11:52:39AM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> Since governor name is defined by DEVFREQ framework internally, use the
> macro definition instead of using the name directly.

Acked-by: Jordan Crouse <jcrouse@codeaurora.org> for the msm part.

> Signed-off-by: Yue Hu <huyue2@yulong.com>
> ---
>  drivers/gpu/drm/msm/msm_gpu.c               | 3 ++-
>  drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 4edb874..f7308d6 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -95,7 +95,8 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
>  	 */
>  
>  	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
> -			&msm_devfreq_profile, "simple_ondemand", NULL);
> +			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>  
>  	if (IS_ERR(gpu->devfreq.devfreq)) {
>  		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> index db79853..a7c18bc 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> @@ -157,7 +157,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
>  	dev_pm_opp_put(opp);
>  
>  	pfdev->devfreq.devfreq = devm_devfreq_add_device(&pfdev->pdev->dev,
> -			&panfrost_devfreq_profile, "simple_ondemand", NULL);
> +			&panfrost_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>  	if (IS_ERR(pfdev->devfreq.devfreq)) {
>  		DRM_DEV_ERROR(&pfdev->pdev->dev, "Couldn't initialize GPU devfreq\n");
>  		ret = PTR_ERR(pfdev->devfreq.devfreq);
> -- 
> 1.9.1
>
On 7/25/19 5:52 AM, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> Since governor name is defined by DEVFREQ framework internally, use the
> macro definition instead of using the name directly.
> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>

Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>

> ---
>   drivers/gpu/drm/msm/msm_gpu.c               | 3 ++-
>   drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 4edb874..f7308d6 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -95,7 +95,8 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
>   	 */
>   
>   	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
> -			&msm_devfreq_profile, "simple_ondemand", NULL);
> +			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>   
>   	if (IS_ERR(gpu->devfreq.devfreq)) {
>   		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> index db79853..a7c18bc 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> @@ -157,7 +157,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
>   	dev_pm_opp_put(opp);
>   
>   	pfdev->devfreq.devfreq = devm_devfreq_add_device(&pfdev->pdev->dev,
> -			&panfrost_devfreq_profile, "simple_ondemand", NULL);
> +			&panfrost_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,
> +			NULL);
>   	if (IS_ERR(pfdev->devfreq.devfreq)) {
>   		DRM_DEV_ERROR(&pfdev->pdev->dev, "Couldn't initialize GPU devfreq\n");
>   		ret = PTR_ERR(pfdev->devfreq.devfreq);
>
On Wed, Jul 24, 2019 at 9:53 PM Yue Hu <zbestahu@gmail.com> wrote:
>
> From: Yue Hu <huyue2@yulong.com>
>
> Since governor name is defined by DEVFREQ framework internally, use the
> macro definition instead of using the name directly.
>
> Signed-off-by: Yue Hu <huyue2@yulong.com>
> ---
>  drivers/gpu/drm/msm/msm_gpu.c               | 3 ++-
>  drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)

I've applied this to drm-misc-next.

Rob