[PATCH] drm: Add deprecation warnings to the old midlayer callbacks

Daniel Vetter daniel at ffwll.ch
Tue Jun 20 09:00:33 UTC 2017


On Thu, Jun 01, 2017 at 07:25:46PM +0100, Emil Velikov wrote:
> On 1 June 2017 at 14:00, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > Daniel started a crusade a few years back to move control over the
> > initialisation and teardown into the driver rather than drm core, for
> > greater control and far fewer surprises. Help in that fight by adding
> > compiler warnings to the stale functions.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >
> > This is not as useful as I hoped. I wanted for gcc to emit a
> > compile-time warning when a deprecated field was assigned, however it
> > only emits when it is used. So we end up with a lot of noise in drm_core
> > and none in the drivers. However, the runtime warning is probably useful
> > and a motivator for change?
> >
> > Should be made WARN_ONCE though
> >
> I recall suggesting something similar a while back, but Daniel was not
> too happy with it.
> Hope it goes well this time.

The problem is that if we enable it by default people scream regressions!
If we enable it behind a Kconfig, Linus screams Kconfig! And no one else
will look at it.

I'm half-tempted to add cocci-check support to dim to catch these, but
that's also an imcomplete solution.

I'd love to enforce this with tooling though, one way or another, I just
haven't seen something that works well yet :-/
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list