]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: Make atomic iterators less surprising
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 27 Sep 2017 08:35:32 +0000 (10:35 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fri, 6 Oct 2017 09:06:11 +0000 (11:06 +0200)
commitfa3e219bfedfc180eb8ac0e7820dbecef726f66f
treec32d1bfea43da323fda926caa28bd6b9111c8a1a
parent3def2ccb904ddac9064c28223552eaba71640f11
drm/atomic: Make atomic iterators less surprising

Commit 550ccf4c0b7a ("drm/atomic: Make async plane update checks work as
intended, v2.") assumed incorrectly that if only 1 plane is matched in
the loop, the variables will be set to that plane. In reality we reset
them to NULL every time a new plane was iterated. This behavior is
surprising, so fix this by making the for loops only assign the
variables on a match.

When we have not added all the planes/crtc/connector to the state, and
there's a few NULL ones after the last one we iterated, te assumption
is broken that the pointers will hold the values from the last loop
iteration, which holds true for all other for_each macros we're using.
Except of course the iterator pointer itself, but that one really is
entirely internal.

Cc: Dmitry Osipenko <digetx@gmail.com>
Fixes: 550ccf4c0b7a ("drm/atomic: Make async plane update checks work as intended, v2.")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
include/drm/drm_atomic.h