drm/atomic: Make async plane update checks work as intended, v2.

By always keeping track of the last commit in plane_state, we know
whether there is an active update on the plane or not. With that
information we can reject the fast update, and force the slowpath
to be used as was originally intended.

We cannot use plane_state->crtc->state here, because this only mentions
the most recent commit for the crtc, but not the planes that were part
of it. We specifically care about what the last commit involving this
plane is, which can only be tracked with a pointer in the plane state.

Changes since v1:
- Clean up the whole function here, instead of partially earlier.
- Add mention in the commit message why we need commit in plane_state.
- Swap plane->state in intel_legacy_cursor_update, instead of
  reassigning all variables. With this commit We know that the cursor
  is not part of any active commits so this hack can be removed.

Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1
Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-7-maarten.lankhorst@linux.intel.com
[mlankhorst: Amend commit for merge conflicts with drm-intel]
This commit is contained in:
Maarten Lankhorst
2017-09-08 10:39:37 +02:00
parent 21a01abbe3
commit 669c9215af
3 changed files with 34 additions and 50 deletions
+3 -2
View File
@@ -124,9 +124,10 @@ struct drm_plane_state {
bool visible;
/**
* @commit: Tracks the pending commit to prevent use-after-free conditions.
* @commit: Tracks the pending commit to prevent use-after-free conditions,
* and for async plane updates.
*
* Is only set when @crtc is NULL.
* May be NULL.
*/
struct drm_crtc_commit *commit;