MLK-22584 drm/imx: dpu: crtc: Correct plane's ExtDst source in ->atomic_begin()
authorLiu Ying <victor.liu@nxp.com>
Wed, 4 Sep 2019 18:01:13 +0000 (14:01 -0400)
committerLiu Ying <victor.liu@nxp.com>
Wed, 11 Sep 2019 21:43:48 +0000 (21:43 +0000)
In dpu_helper_funcs->atomic_begin(), we temporarily set the plane's
ExtDst source to ConstFrame in shadow.  In the plane driver,
dpu_plane_helper_funcs->atomic_update() can update the shadow if
necessary.  This way, we may set the source as either ConstFrame
or LayerBlend.  We only set the source for the old top plane in
->atomic_begin().  However, in cases where pixel combiner is used,
the top planes are tracked separately for the master stream and
the slave stream with ->is_left_top or ->is_right_top flags
instead of ->is_top flag when pixel combiner is not used.  This
patch corrects the source for the cases where pixel combiner is
used.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit ff19118af177bab2dc765b242cf5b4392910a5e7)

drivers/gpu/drm/imx/dpu/dpu-crtc.c

index b97a36b..a3ab5d9 100644 (file)
@@ -639,7 +639,10 @@ again:
                        hscaler_mode(hs, SCALER_NEUTRAL);
                        vscaler_mode(vs, SCALER_NEUTRAL);
                }
-               if (old_dpstate->is_top) {
+               if ((!old_dcstate->use_pc && old_dpstate->is_top) ||
+                    (old_dcstate->use_pc &&
+                     ((!stream_id && old_dpstate->is_left_top) ||
+                       (stream_id && old_dpstate->is_right_top)))) {
                        ed = res->ed[stream_id];
                        ed_src = stream_id ?
                                ED_SRC_CONSTFRAME1 : ED_SRC_CONSTFRAME0;