omap_plane_pre_apply() sets the plane's output channel too late, only
after the plane has already been otherwise configured and enabled. This
causes problems, as at the configuration stage we need to make decisions
based on the output channel.

This may lead to bad plane settings or failing to setup the plane.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
---
 drivers/gpu/drm/omapdrm/omap_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c 
b/drivers/gpu/drm/omapdrm/omap_plane.c
index bedd6f7af0f1..8e94694ba8a3 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -153,6 +153,8 @@ static void omap_plane_pre_apply(struct omap_drm_apply 
*apply)
        ilace = false;
        replication = false;

+       dispc_ovl_set_channel_out(omap_plane->id, channel);
+
        /* and finally, update omapdss: */
        ret = dispc_ovl_setup(omap_plane->id, info,
                        replication, omap_crtc_timings(crtc), false);
@@ -162,7 +164,6 @@ static void omap_plane_pre_apply(struct omap_drm_apply 
*apply)
        }

        dispc_ovl_enable(omap_plane->id, true);
-       dispc_ovl_set_channel_out(omap_plane->id, channel);
 }

 static void omap_plane_post_apply(struct omap_drm_apply *apply)
-- 
2.3.0

Reply via email to