Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	linux-samsung-soc@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/exynos: fimd: harden fimd_calc_clkdiv()
Date: Fri, 06 May 2016 07:44:17 +0200	[thread overview]
Message-ID: <572C2F31.7050405@samsung.com> (raw)
In-Reply-To: <1462465418-3769-1-git-send-email-tjakobi@math.uni-bielefeld.de>

Hi Tobias,

On 05/05/2016 06:23 PM, Tobias Jakobi wrote:
> Don't use the vrefresh field of the DRM mode since this
> one is supposed to only be used for debug purpose.
> Instead use the clock field which should also provide
> much more precise information.
>
> Also sanitize the case in which the clock value
> should be zero. We then just default to the maximum
> clock divisor.
>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
--
Regards
Andrzej
> ---
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 57020f9..9d4cae4 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -367,9 +367,16 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc)
>  static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
>  		const struct drm_display_mode *mode)
>  {
> -	unsigned long ideal_clk = mode->htotal * mode->vtotal * mode->vrefresh;
> +	unsigned long ideal_clk;
>  	u32 clkdiv;
>  
> +	if (mode->clock == 0) {
> +		DRM_ERROR("Mode has zero clock value.\n");
> +		return 0xff;
> +	}
> +
> +	ideal_clk = mode->clock * 1000;
> +
>  	if (ctx->i80_if) {
>  		/*
>  		 * The frame done interrupt should be occurred prior to the

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2016-05-06  5:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 16:23 [PATCH] drm/exynos: fimd: harden fimd_calc_clkdiv() Tobias Jakobi
2016-05-06  5:44 ` Andrzej Hajda [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=572C2F31.7050405@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tjakobi@math.uni-bielefeld.de \
    /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