[Intel-gfx] [PATCH v2 03/11] drm/i915: HDMI pixel clock check

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 29 23:54:22 PDT 2015


On Thu, Jul 30, 2015 at 09:49:30AM +0300, Mika Kahola wrote:
> It is possible the we request to have a mode that has
> higher pixel clock than our HW can support. This patch
> checks if requested pixel clock is lower than the one
> supported by the HW. The requested mode is discarded
> if we cannot support the requested pixel clock.
> 
> This patch applies to HDMI.
> 
> V2:
> - removed computation for max dot clock
> 
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 70bad5b..b85efaa 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1191,15 +1191,22 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
>  {
>  	struct intel_hdmi *hdmi = intel_attached_hdmi(connector);
>  	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> +	struct drm_i915_private *dev_priv = to_i915(dev);
>  	enum drm_mode_status status;
>  	int clock;
> +	int max_pixclk = dev_priv->max_dotclk;
>  
>  	if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
>  		return MODE_NO_DBLESCAN;
>  
>  	clock = mode->clock;
> -	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
> +	if (mode->flags & DRM_MODE_FLAG_DBLCLK) {
>  		clock *= 2;
> +		max_pixclk *= 2;
> +	}
> +
> +	if (clock > max_pixclk)
> +		return MODE_CLOCK_HIGH;

Or do the test before the DBLCLK?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list