[RFC/PATCH] drm: Make the .mode_fixup() operations mode argument a const pointer

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed May 30 03:11:49 PDT 2012


Hi Daniel,

On Wednesday 30 May 2012 12:02:19 Daniel Vetter wrote:
> On Wed, May 30, 2012 at 11:24:50AM +0200, Laurent Pinchart wrote:
> > On Wednesday 30 May 2012 11:18:56 Daniel Vetter wrote:
> > > On Wed, May 30, 2012 at 01:01:08AM +0200, Laurent Pinchart wrote:
> > > > The passed mode must not be modified by the operation, make it const.
> > > > 
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > > 
> > > Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > 
> > Thank you for the ack. Would you also be so kind as to tell me how to fix
> > the related i915 issue (as briefly stated in the patch, the i915 driver
> > modifies mode->clock in intel_dp_mode_fixup()) ? Or, even better, provide
> > a patch for that ? :-)
> 
> Oops, lack of coffee. Patch is in the works.

No worries :-) As my patch should go on top of yours, could you please take it 
in your tree ?

> Btw, do you plan to constify other stuff?

Not immediately. When I tried to implement .mode_fixup() I wasn't sure whether 
drivers were allowed to modify the mode argument. After researching it I came 
up to the conclusion that they should not, hence the patch. It would make 
sense to constify other structures and function arguments as well though.

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list