All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/glk: Fix dotclock calculation in skl_check_pipe_max_pixel_rate
Date: Thu, 1 Jun 2017 16:52:51 +0300	[thread overview]
Message-ID: <20170601135251.GM12629@intel.com> (raw)
In-Reply-To: <20170601103413.7037-1-maarten.lankhorst@linux.intel.com>

On Thu, Jun 01, 2017 at 12:34:13PM +0200, Maarten Lankhorst wrote:
> Seems that GLK has a dotclock that's twice the display clock.
> skl_max_scale checks for IS_GEMINILAKE, so perform the same check here.
> 
> While at it, change the DRM_ERROR to DEBUG_KMS.
> 
> Fixes: 73b0ca8ec76d ("drm/i915/skl+: consider max supported plane pixel
> rate while scaling")
> Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 2042f6512e6e..88c8a3511e24 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4122,7 +4122,7 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
>  	struct drm_plane *plane;
>  	const struct drm_plane_state *pstate;
>  	struct intel_plane_state *intel_pstate;
> -	int crtc_clock, cdclk;
> +	int crtc_clock, dotclk;
>  	uint32_t pipe_max_pixel_rate;
>  	uint_fixed_16_16_t pipe_downscale;
>  	uint_fixed_16_16_t max_downscale = u32_to_fixed_16_16(1);
> @@ -4157,11 +4157,15 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
>  	pipe_downscale = mul_fixed16(pipe_downscale, max_downscale);
>  
>  	crtc_clock = crtc_state->adjusted_mode.crtc_clock;
> -	cdclk = to_intel_atomic_state(state)->cdclk.logical.cdclk;
> -	pipe_max_pixel_rate = div_round_up_u32_fixed16(cdclk, pipe_downscale);
> +	dotclk = to_intel_atomic_state(state)->cdclk.logical.cdclk;

dotclk = cdclk. That statement doesn't make sense. It should be called
max_dotclk or something like that.

> +
> +	if (IS_GEMINILAKE(to_i915(intel_crtc->base.dev)))
> +		dotclk *= 2;
> +
> +	pipe_max_pixel_rate = div_round_up_u32_fixed16(dotclk, pipe_downscale);
>  
>  	if (pipe_max_pixel_rate < crtc_clock) {
> -		DRM_ERROR("Max supported pixel clock with scaling exceeded\n");
> +		DRM_DEBUG_KMS("Max supported pixel clock with scaling exceeded\n");
>  		return -EINVAL;
>  	}
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-06-01 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 10:34 [PATCH] drm/i915/glk: Fix dotclock calculation in skl_check_pipe_max_pixel_rate Maarten Lankhorst
2017-06-01 10:50 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-01 10:52 ` [PATCH] " Mahesh Kumar
2017-06-01 10:54   ` Maarten Lankhorst
2017-06-01 13:52 ` Ville Syrjälä [this message]
2017-06-01 17:41   ` Maarten Lankhorst

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=20170601135251.GM12629@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.