[PATCH 0/8] Cleanup CRTC .enable()/.disable() cargo-cult

Emil Velikov emil.l.velikov at gmail.com
Wed Jun 28 11:27:06 UTC 2017


Hi Laurent,

On 27 June 2017 at 21:38, Laurent Pinchart
<laurent.pinchart+renesas at ideasonboard.com> wrote:
> Hello,
>
> The atomic helpers favour the .enable() and .atomic_disable() CRTC helper
> operations, but still support the legacy .prepare(), .commit(), .disable() and
> .dpms() operations. Some drivers have been updated, but most still use various
> combination of new and legacy operations, leading to confusion among new
> developers when they read the code.
>
Just had a crazy idea:

Would it make sense for the function(s) that takes the
driver_foo_funcs as an argument to cross-check for such mistakes?
Since many of the hooks are optional, one could check for the
'forbidden' combinations:
Atomic drivers should not have any legacy hooks set, while legacy ones
should not have any of the atomic ones.

Of course the idea is not restricted to the CRTC helpers -
drm_{crtc,encoder,connector,plane,mode_config}_{helper_,}funcs should
all be applicable.

Regards,
Emil


More information about the dri-devel mailing list