[Intel-gfx] [PATCH] drm/i915: Set mode->crtc_clock during hardware state readout

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Oct 6 09:52:57 PDT 2015


On Tue, Oct 06, 2015 at 09:26:31AM -0700, Matt Roper wrote:
> intel_mode_from_pipe_config() fills in a mode structure from the CRTC
> state that was read out of the hardware, but does not set the
> .crtc_clock field (it only sets the .clock).  This causes the subsequent
> call to drm_calc_timestamping_constants() to complain with messages like
> "*ERROR* crtc 21: Can't calculate constants, dotclock = 0!"  Ensuring
> .crtc_clock is set as well eliminates this error.
> 
> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index bbeb6d3..4e481e3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7752,6 +7752,7 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
>  	mode->type = DRM_MODE_TYPE_DRIVER;
>  
>  	mode->clock = pipe_config->base.adjusted_mode.crtc_clock;
> +	mode->crtc_clock = pipe_config->base.adjusted_mode.crtc_clock;

You should never look at crtc_clock unless you're looking at the
adjusted mode. Are you actually seeing these errors with the current
code? They should have been fixed by:

7f4c62840cc4 drm/i915: Assign hwmode after encoder state readout
0f64614dde17 drm/i915: Fix clock readout when pipes are enabled w/o ports

>  	mode->flags |= pipe_config->base.adjusted_mode.flags;
>  
>  	mode->hsync = drm_mode_hsync(mode);
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list