Skip to content

Commit

Permalink
drm/imx: Annotate dma-fence critical section in commit path
Browse files Browse the repository at this point in the history
drm_atomic_helper_commit_hw_done() is the last thing (no plane cleanup
apparrently), so it's the entire function. And a nice comment
explaining why the wait_for_flip_done is ahead, unlike the usual
sequence.

Aside, I think since the atomic helpers do track plane disabling now
separately this might no longer be a real problem since:

commit 21a01ab
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Mon Sep 4 12:48:37 2017 +0200

    drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.

Plus the subsequent bugfixes of course, this was tricky to get right.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Daniel Vetter authored and Philipp Zabel committed May 10, 2021
1 parent 0684114 commit f4b34fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/imx/imx-drm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
struct drm_plane_state *old_plane_state, *new_plane_state;
bool plane_disabling = false;
int i;
bool fence_cookie = dma_fence_begin_signalling();

drm_atomic_helper_commit_modeset_disables(dev, state);

Expand Down Expand Up @@ -111,6 +112,7 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
}

drm_atomic_helper_commit_hw_done(state);
dma_fence_end_signalling(fence_cookie);
}

static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {
Expand Down

0 comments on commit f4b34fa

Please sign in to comment.