]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic-helpers: functions for state duplicate/destroy/reset
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Nov 2014 14:56:43 +0000 (15:56 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Nov 2014 20:02:23 +0000 (21:02 +0100)
commit44d1fdfde58d9010775fb23dc63bfd8b7ec58f63
tree05c8057756af686e1e7f679f3d24b79a559fc355
parent070477d7965d73958cc12fe8fae3e8e3dec45c65
drm/atomic-helpers: functions for state duplicate/destroy/reset

The atomic users and helpers assume that there is always a obj->state
structure around. Which means drivers need to somehow create that at
driver load time. Also it should obviously reset hardware state, so
needs to be reset upon resume.

Finally the destroy/duplicate_state functions are an awful lot of
boilerplate if the driver doesn't need anything beyond the default
state objects.

So add helper functions for all of this.

v2: Somehow the plane/connector versions got lost in the first
version.

v3: Add kerneldoc.

v4: Make duplicate_state functions a bit more robust, which is useful
for debugging state tracking issues when transitioning to atomic.

v5: Clear temporary variables in the crtc state when duplicating it,
like ->mode_changed or ->planes_changed. If we don't do this stale
values for these might pollute the next atomic modeset.

v6: Also clear crtc_state->event in case the driver didn't (yet) clear
this out.

v7: Split out wrong squashed commit. Also improve the kerneldoc to
mention that obj->state can be NULL and when.  Both suggested by
Daniel Thompson.

Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic_helper.h