drm/sun4i: don't add components that are already in the queue
authorChen-Yu Tsai <wens@csie.org>
Sat, 14 Oct 2017 04:02:46 +0000 (12:02 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 16 Oct 2017 07:53:44 +0000 (09:53 +0200)
commite8afb7b67fbadfbb2b4fd74bf34566e64cbcbe6f
tree7c6b119f9147c3246cbf4dfdc482e0863f2fc508
parent652badb9458b41a24b156146a73a5bfbc4356f29
drm/sun4i: don't add components that are already in the queue

Even though the components framework can handle duplicate entries,
the extra entries cause a lot more debug messages to be generated,
which would be confusing to developers not familiar with our driver
and the framework in general.

Instead, we can scan the relatively small queue and check if the
component to be added is already queued up. Since the display
pipelines are symmetrical (not considering the third display
pipeline on the A80), and we add components level by level, when
we get to the second instance at the same level, any shared downstream
components would already be in the queue.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171014040252.9621-2-wens@csie.org
drivers/gpu/drm/sun4i/sun4i_drv.c