amvideo: fix axis not update when video is paused [1/1]
authorjintao xu <jintao.xu@amlogic.com>
Thu, 12 Dec 2019 05:47:29 +0000 (13:47 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 12 Dec 2019 07:20:01 +0000 (00:20 -0700)
PD#SWPL-17536

Problem:
axis not update when video is paused

Solution:
update axis every vsync

Verify:
Verify on u212

Change-Id: Iad1629f750e9ba075cbb1737a8c0b66be7f7fed4
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
drivers/amlogic/media/video_sink/video.c
drivers/amlogic/media/video_sink/video_priv.h

index 597912ef6c610c0fd761e1e414b53af97ba21f46..21a512593303dcef9e2d74e94d63b49eb64a2481 100644 (file)
@@ -3384,6 +3384,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
        u32 next_afbc_request = atomic_read(&gafbc_request);
        s32 vd1_path_id = glayer_info[0].display_path_id;
        s32 vd2_path_id = glayer_info[1].display_path_id;
+       int axis[4];
+       int crop[4];
 
        if (debug_flag & DEBUG_FLAG_VSYNC_DONONE)
                return IRQ_HANDLED;
@@ -4507,6 +4509,21 @@ SET_FILTER:
                                get_layer_display_canvas(0);
                }
        }
+       if (vd_layer[0].dispbuf &&
+           (vd_layer[0].dispbuf->flag & VFRAME_FLAG_VIDEO_COMPOSER) &&
+           !(debug_flag & DEBUG_FLAG_AXIS_NO_UPDATE)) {
+               axis[0] = vd_layer[0].dispbuf->axis[0];
+               axis[1] = vd_layer[0].dispbuf->axis[1];
+               axis[2] = vd_layer[0].dispbuf->axis[2];
+               axis[3] = vd_layer[0].dispbuf->axis[3];
+               crop[0] = vd_layer[0].dispbuf->crop[0];
+               crop[1] = vd_layer[0].dispbuf->crop[1];
+               crop[2] = vd_layer[0].dispbuf->crop[2];
+               crop[3] = vd_layer[0].dispbuf->crop[3];
+               _set_video_window(&glayer_info[0], axis);
+               _set_video_crop(&glayer_info[0], crop);
+               glayer_info[0].zorder = vd_layer[0].dispbuf->zorder;
+       }
        /* setting video display property in underflow mode */
        if (!new_frame &&
            vd_layer[0].dispbuf &&
@@ -4689,6 +4706,22 @@ SET_FILTER:
                }
        }
 
+       if (vd_layer[1].dispbuf &&
+           (vd_layer[1].dispbuf->flag & VFRAME_FLAG_VIDEO_COMPOSER) &&
+           !(debug_flag & DEBUG_FLAG_AXIS_NO_UPDATE)) {
+               axis[0] = vd_layer[1].dispbuf->axis[0];
+               axis[1] = vd_layer[1].dispbuf->axis[1];
+               axis[2] = vd_layer[1].dispbuf->axis[2];
+               axis[3] = vd_layer[1].dispbuf->axis[3];
+               crop[0] = vd_layer[1].dispbuf->crop[0];
+               crop[1] = vd_layer[1].dispbuf->crop[1];
+               crop[2] = vd_layer[1].dispbuf->crop[2];
+               crop[3] = vd_layer[1].dispbuf->crop[3];
+               _set_video_window(&glayer_info[1], axis);
+               _set_video_crop(&glayer_info[1], crop);
+               glayer_info[1].zorder = vd_layer[1].dispbuf->zorder;
+       }
+
        /* setting video display property in underflow mode */
        if (!new_frame2 &&
            vd_layer[1].dispbuf &&
index 5f68d90e904303fca4473e898173ffc047ec290d..16103e4d0edb4135a3b0ae7b3044fd76c57e8c87 100644 (file)
@@ -45,6 +45,7 @@
 #define DEBUG_FLAG_PRINT_DROP_FRAME        0x4000000
 #define DEBUG_FLAG_OMX_DV_DROP_FRAME        0x8000000
 #define DEBUG_FLAG_COMPOSER_NO_DROP_FRAME     0x10000000
+#define DEBUG_FLAG_AXIS_NO_UPDATE     0x20000000
 
 #define VOUT_TYPE_TOP_FIELD 0
 #define VOUT_TYPE_BOT_FIELD 1