drm/vc4: don't check if plane->state->fb == state->fb #5832
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when using non-blocking commits, we can see the following kernel warning:
This happens because, although
prepare_fb
andcleanup_fb
are perfectly balanced, we cannot guarantee consistency in the check plane->state->fb == state->fb. This means that sometimes we can increase the refcount inprepare_fb
and don't decrease it incleanup_fb
. The opposite can also be true.In fact, the struct drm_plane .state shouldn't be accessed directly but instead, the
drm_atomic_get_new_plane_state()
helper function should be used. So, we could stick to this check, but usingdrm_atomic_get_new_plane_state()
. But actually, this check is not really needed. We can increase and decrease the refcount symmetrically without problems.This is going to make the code more simple and consistent.
This patch addresses issue #5730. I also sent this patch upstream [1].
[1] https://lore.kernel.org/dri-devel/[email protected]/T/