OSDN Git Service

drm/atomic: Add helpers for state-subclassing drivers
authorThierry Reding <treding@nvidia.com>
Wed, 28 Jan 2015 13:54:32 +0000 (14:54 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 2 Apr 2015 16:48:32 +0000 (18:48 +0200)
commitf5e7840b0c4368f8cdbb055188c2a0eef50c3052
tree820a100556fa6062025f6cf3b4f64d735ce9892d
parent42e9ce0523699b3f3383b7c5c0bcc2657a77d0ca
drm/atomic: Add helpers for state-subclassing drivers

Drivers that subclass CRTC, plane or connector state need to carefully
duplicate the code that the atomic helpers have. This is bound to cause
breakage eventually because it requires auditing all drivers and update
them when code is added to the helpers.

In order to avoid that, implement new helpers that perform the required
steps when copying and destroying state. These new helpers are exported
so that state-subclassing drivers can use them. The default helpers are
implemented using them as well, providing a single location that needs
to be changed when adding to base atomic states.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic_helper.h