On Tue, Oct 20, 2015 at 04:01:20PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursu...@intel.com>
> 
> Cdclk < crtc_clock is not allowed and suggests a different problem
> elsewhere in the code.
> 
> It is more robust and safe to assume no scaling is possible in
> this case with no other downsides since it will also WARN_ON_ONCE
> so that this definitely gets noticed.
> 
> Call it an assert to help new platform bring-up in simulation.
> 
> v2: Better commit msg and use WARN_ON_ONCE to signify the unexpectedness.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursu...@intel.com>
> Cc: Ville Syrjälä <ville.syrj...@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 9cb29086971a..f315ed45358f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13439,7 +13439,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct 
> intel_crtc_state *crtc_state
>       crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
>       cdclk = to_intel_atomic_state(crtc_state->base.state)->cdclk;
>  
> -     if (!crtc_clock || !cdclk)
> +     if (!crtc_clock || !cdclk || WARN_ON_ONCE(cdclk < crtc_clock))

I'm thinking the zero crtc_clock check should also be inside the WARN.
And you could drop the !cdclk part since the < already covers it.

With those:
Reviewed-by: Ville Syrjälä <ville.syrj...@linux.intel.com>

>               return DRM_PLANE_HELPER_NO_SCALING;
>  
>       /*
> -- 
> 1.9.1

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

Reply via email to