Re: [PATCH 3/4] drm/i915/dsi: Adjust crtc_clock for burst_mode_ratio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 01, 2018 at 12:31:47PM +0100, Hans de Goede wrote:
> On devices with a burst_mode_ratio which is not 100 (1:1), the pclk
> will have a different value then drm_display_mode.clock .
> 
> On a Prowise PT301 tablet where vbt.lfp_lvds_vbt_mode.clock is 66100 and
> burst_mode_ratio is 130 this leads to the following errors:
> 
> [drm:pipe_config_err [i915]] *ERROR* mismatch in
> pixel_rate (expected 66100, found 86458)
> [drm:pipe_config_err [i915]] *ERROR* mismatch in
> base.adjusted_mode.crtc_clock (expected 66100, found 86458)
> [drm:pipe_config_err [i915]] *ERROR* mismatch in
> port_clock (expected 66100, found 86458)
> 
> This commit makes intel_dsi_compute_config() set
> pipe_config.adjusted_mode.crtc_clock, taking the burst_mode_ratio into
> account fixing this.
> 
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/vlv_dsi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
> index c21cbfa9653c..d72ccf557a9c 100644
> --- a/drivers/gpu/drm/i915/vlv_dsi.c
> +++ b/drivers/gpu/drm/i915/vlv_dsi.c
> @@ -347,6 +347,10 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,
>  			return false;
>  	}
>  
> +	adjusted_mode->crtc_clock =
> +		DIV_ROUND_UP(adjusted_mode->crtc_clock *
> +					 intel_dsi->burst_mode_ratio, 100);

Hmm. Won't this cause incorrect refresh rate to be used in eg.
vblank timestmap calculations?

OTOH if the pipe is really fetching data at the higher burst
rate then we should rather want to calculate the watermarks/cdclk
based on that higher rate. We do have pixel_rate in the crtc state
but atm that is computed in generic code. We might have to push that
to be encoder specific to do this correctly...

> +
>  	pipe_config->clock_set = true;
>  
>  	return true;
> -- 
> 2.19.1

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




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux