amlvideo2: fix video only parameters [1/1]
authorGuosong Zhou <guosong.zhou@amlogic.com>
Sun, 5 May 2019 06:32:35 +0000 (02:32 -0400)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 7 May 2019 05:50:34 +0000 (22:50 -0700)
PD#TV-4664

Problem:
capture video only picture abnormal

Solution:
fix video only parameters

Verify:
T962X2-X301

Change-Id: I3b9d4fcdf1566f22e409264ba8bd82a85559c5cf
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
drivers/amlogic/media/video_processor/video_dev/amlvideo2.c

index 9da298e..7701e7d 100644 (file)
@@ -4967,7 +4967,9 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
        }
 
        memset(&node->display_info, 0, sizeof(struct vdisplay_info_s));
-       if (!node->start_vdin_flag) {
+       if ((!node->start_vdin_flag) ||
+       (node->porttype == TVIN_PORT_VIU1_WB0_VD1) ||
+       (node->porttype == TVIN_PORT_VIU1_VIDEO)) {
                ret = vf_notify_receiver_by_name("amvideo",
                          VFRAME_EVENT_PROVIDER_QUREY_DISPLAY_INFO,
                         &node->display_info);
@@ -5020,8 +5022,16 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
        para.port = node->porttype;
        para.fmt = TVIN_SIG_FMT_MAX;
        para.frame_rate = vinfo->sync_duration_num/vinfo->sync_duration_den;
-       para.h_active = vinfo->width;
-       para.v_active = vinfo->height;
+       if ((para.port == TVIN_PORT_VIU1_WB0_VD1) ||
+       (para.port == TVIN_PORT_VIU1_VIDEO)) {
+               para.h_active = (node->display_info.display_hsc_endp -
+               node->display_info.display_hsc_startp + 1);
+               para.v_active = (node->display_info.display_vsc_endp -
+               node->display_info.display_vsc_startp + 1);
+       } else {
+               para.h_active = vinfo->width;
+               para.v_active = vinfo->height;
+       }
        para.hsync_phase = 0;
        para.vsync_phase = 1;
        para.hs_bp = 0;