Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Abhinav Kumar <abhinavk@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	hoegsberg@google.com, chandanu@codeaurora.org
Subject: Re: [DPU PATCH v2] drm/msm: make pclk_rate u64 to avoid truncation
Date: Fri, 1 Jun 2018 15:37:44 -0400	[thread overview]
Message-ID: <20180601193744.GR3373@art_vandelay> (raw)
In-Reply-To: <1527732772-25893-1-git-send-email-abhinavk@codeaurora.org>

On Wed, May 30, 2018 at 07:12:52PM -0700, Abhinav Kumar wrote:
> Higher values of pclk can exceed 32 bits when multiplied
> by a factor.
> 
> Make the pclk_rate u64 to accommodate higher pixel clock
> rates.
> 
> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>

Can you please rebase this on "drm/msm/dsi: adjust dsi timing for dual dsi
mode"?

Sean

> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index b916f46..5a04f2d 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -668,7 +668,8 @@ static int dsi_calc_clk_rate(struct msm_dsi_host *msm_host)
>  	const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
>  	u8 lanes = msm_host->lanes;
>  	u32 bpp = dsi_get_bpp(msm_host->format);
> -	u32 pclk_rate;
> +	u64 pclk_rate;
> +	u64 pclk_bpp;
>  
>  	if (!mode) {
>  		pr_err("%s: mode not set\n", __func__);
> @@ -676,14 +677,18 @@ static int dsi_calc_clk_rate(struct msm_dsi_host *msm_host)
>  	}
>  
>  	pclk_rate = mode->clock * 1000;
> +	pclk_bpp = pclk_rate * bpp;
> +
>  	if (lanes > 0) {
> -		msm_host->byte_clk_rate = (pclk_rate * bpp) / (8 * lanes);
> +		do_div(pclk_bpp, (8 * lanes));
>  	} else {
>  		pr_err("%s: forcing mdss_dsi lanes to 1\n", __func__);
> -		msm_host->byte_clk_rate = (pclk_rate * bpp) / 8;
> +		do_div(pclk_bpp, 8);
>  	}
>  
> -	DBG("pclk=%d, bclk=%d", pclk_rate, msm_host->byte_clk_rate);
> +	msm_host->byte_clk_rate = pclk_bpp;
> +
> +	DBG("pclk=%llu, bclk=%d", pclk_rate, msm_host->byte_clk_rate);
>  
>  	msm_host->esc_clk_rate = clk_get_rate(msm_host->esc_clk);
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-06-01 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  2:12 [DPU PATCH v2] drm/msm: make pclk_rate u64 to avoid truncation Abhinav Kumar
2018-06-01 19:37 ` Sean Paul [this message]

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=20180601193744.GR3373@art_vandelay \
    --to=seanpaul@chromium.org \
    --cc=abhinavk@codeaurora.org \
    --cc=chandanu@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=linux-arm-msm@vger.kernel.org \
    /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