[PATCH] drm/i915: don't chnage the original mode in dp_mode_fixup

Chris Wilson chris at chris-wilson.co.uk
Wed May 30 03:58:43 PDT 2012


On Wed, 30 May 2012 12:28:04 +0200, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> We should only frob adjusted_mode. This is in preparation of
> a massive patch by Laurent Pinchart to make the mode argument
> const.
> 
> The only thing we actually touch is mode->clock, but only if
> it's a panel. And in that case we also set adjusted_mode->clock
> to the same value. All the generic code already uses the
> adjusted_mode exclusively, so we only have to move the dp
> link bw calculations over to that. This requires a small
> changes so that the shared code with mode_valid doesn't
> touch the mode argument.

Separate patch please, I'm sure you are right, but that is the scary
one...

> 
> Also mark the mode argument of pch_panel_fitting const.
> 
> Reported-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_dp.c    |   19 +++++++------------
>  drivers/gpu/drm/i915/intel_drv.h   |    2 +-
>  drivers/gpu/drm/i915/intel_panel.c |    2 +-
>  3 files changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 296cfc2..05c4748 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -222,7 +222,7 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)
>  static bool
>  intel_dp_adjust_dithering(struct intel_dp *intel_dp,
>  			  struct drm_display_mode *mode,
> -			  struct drm_display_mode *adjusted_mode)
> +			  bool adjust_mode)

Would this look more pleasant if you rewrote this function so that the
adjustment of flags was done in the caller?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list