linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>, Sean Paul <sean@poorly.run>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<linux-arm-msm@vger.kernel.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<freedreno@lists.freedesktop.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] drm/msm: Split out get_freq() helper
Date: Tue, 27 Jul 2021 23:11:53 +0300	[thread overview]
Message-ID: <ba388984-3fb1-ae8c-1382-119847981ba8@linaro.org> (raw)
In-Reply-To: <20210726144653.2180096-3-robdclark@gmail.com>

On 26/07/2021 17:46, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> In the next patch, it grows a bit more, so lets not duplicate the logic
> in multiple places.
> 
> Signed-off-by: Rob Clark <robdclark@chromium.org>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   drivers/gpu/drm/msm/msm_gpu_devfreq.c | 21 ++++++++++-----------
>   1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
> index 3bcea0baddab..2e24a97be624 100644
> --- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c
> +++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
> @@ -37,17 +37,21 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq,
>   	return 0;
>   }
>   
> +static unsigned long get_freq(struct msm_gpu *gpu)
> +{
> +	if (gpu->funcs->gpu_get_freq)
> +		return gpu->funcs->gpu_get_freq(gpu);
> +
> +	return clk_get_rate(gpu->core_clk);
> +}
> +
>   static int msm_devfreq_get_dev_status(struct device *dev,
>   		struct devfreq_dev_status *status)
>   {
>   	struct msm_gpu *gpu = dev_to_gpu(dev);
>   	ktime_t time;
>   
> -	if (gpu->funcs->gpu_get_freq)
> -		status->current_frequency = gpu->funcs->gpu_get_freq(gpu);
> -	else
> -		status->current_frequency = clk_get_rate(gpu->core_clk);
> -
> +	status->current_frequency = get_freq(gpu);
>   	status->busy_time = gpu->funcs->gpu_busy(gpu);
>   
>   	time = ktime_get();
> @@ -59,12 +63,7 @@ static int msm_devfreq_get_dev_status(struct device *dev,
>   
>   static int msm_devfreq_get_cur_freq(struct device *dev, unsigned long *freq)
>   {
> -	struct msm_gpu *gpu = dev_to_gpu(dev);
> -
> -	if (gpu->funcs->gpu_get_freq)
> -		*freq = gpu->funcs->gpu_get_freq(gpu);
> -	else
> -		*freq = clk_get_rate(gpu->core_clk);
> +	*freq = get_freq(dev_to_gpu(dev));
>   
>   	return 0;
>   }
> 


-- 
With best wishes
Dmitry

  reply	other threads:[~2021-07-27 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 14:46 [PATCH v2 0/3] drm/msm: Improved devfreq tuning Rob Clark
2021-07-26 14:46 ` [PATCH v2 1/3] drm/msm: Split out devfreq handling Rob Clark
2021-07-27 20:11   ` Dmitry Baryshkov
2021-07-26 14:46 ` [PATCH v2 2/3] drm/msm: Split out get_freq() helper Rob Clark
2021-07-27 20:11   ` Dmitry Baryshkov [this message]
2021-07-26 14:46 ` [PATCH v2 3/3] drm/msm: Devfreq tuning Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba388984-3fb1-ae8c-1382-119847981ba8@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).