[Intel-gfx] [PATCH v4 04/11] drm/i915: LVDS pixel clock check
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Aug 14 06:09:05 PDT 2015
On Fri, Aug 14, 2015 at 01:03:24PM +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 LVDS.
>
> V2:
> - removed computation for max pixel clock
>
> V3:
> - cleanup by removing unnecessary lines
>
> V4:
> - moved supported dotclock check from mode_valid() to intel_lvds_init()
>
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>
> ---
> drivers/gpu/drm/i915/intel_lvds.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 881b5d1..06b9d1b 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -1098,8 +1098,11 @@ void intel_lvds_init(struct drm_device *dev)
> drm_mode_debug_printmodeline(scan);
>
> fixed_mode = drm_mode_duplicate(dev, scan);
> - if (fixed_mode)
> - goto out;
> + if (fixed_mode) {
> + if (fixed_mode->clock <= dev_priv->max_dotclk_freq)
> + goto out;
> + }
> + fixed_mode = NULL;
> }
> }
>
> @@ -1111,8 +1114,10 @@ void intel_lvds_init(struct drm_device *dev)
> fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode);
> if (fixed_mode) {
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> - goto out;
> + if (fixed_mode->clock <= dev_priv->max_dotclk_freq)
> + goto out;
> }
> + fixed_mode = NULL;
> }
>
> /*
> @@ -1135,8 +1140,10 @@ void intel_lvds_init(struct drm_device *dev)
> DRM_DEBUG_KMS("using current (BIOS) mode: ");
> drm_mode_debug_printmodeline(fixed_mode);
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> - goto out;
> + if (fixed_mode->clock <= dev_priv->max_dotclk_freq)
> + goto out;
> }
> + fixed_mode = NULL;
I don't think we want to special case just LVDS this way. Whatever we do
with fixed_mode validation should be done for all connector types that
have it. For now I think we can more or less ignore the issue.
So in that light, your previous patch was OK except it should have just
checked fixed_mode->clock instead of mode->clock. Sorry if my ramblings
confused you too much.
> }
>
> /* If we still don't have a mode after all that, give up. */
> --
> 1.9.1
>
> _______________________________________________
> 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