v4l: add parms low_latency_mode for fast output frame. [1/1]
authorNanxin Qin <nanxin.qin@amlogic.com>
Thu, 4 Jun 2020 03:31:18 +0000 (11:31 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Mon, 8 Jun 2020 02:43:22 +0000 (19:43 -0700)
PD#SWPL-27426

Problem:
add param in decoder to control fast_output_enable mode for multi-inst

Solution:
add parms low_latency_mode for fast output frame.

Verify:
w200

Change-Id: I135ecc212c72626a9d498adffade70887c8ffd23
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
drivers/amvdec_ports/aml_vcodec_drv.h
drivers/amvdec_ports/decoder/vdec_h264_if.c
drivers/frame_provider/decoder/h264_multi/vmh264.c

index f28dc5130a1aff886b47ffae1e1ba01751fc0aad..1bc6211c866ca8e9da78d65dbcd5be0b311fb989 100644 (file)
@@ -287,6 +287,7 @@ struct aml_vdec_cfg_infos {
        u32 ref_buf_margin;
        u32 canvas_mem_mode;
        u32 canvas_mem_endian;
+       u32 low_latency_mode;
 };
 
 struct aml_vdec_hdr_infos {
index 04173d6906c235ffc5ccafcbbfc337dee86da36c..40cbeb8578eada2eba4c932c647cf1a0c0297423 100644 (file)
@@ -279,6 +279,8 @@ static void vdec_parser_parms(struct vdec_h264_inst *inst)
                        ctx->config.parm.dec.cfg.canvas_mem_mode);
                pbuf += sprintf(pbuf, "parm_v4l_canvas_mem_endian:%d;",
                        ctx->config.parm.dec.cfg.canvas_mem_endian);
+               pbuf += sprintf(pbuf, "parm_v4l_low_latency_mode:%d;",
+                       ctx->config.parm.dec.cfg.low_latency_mode);
                ctx->config.length = pbuf - ctx->config.buf;
        } else {
                ctx->config.parm.dec.cfg.double_write_mode = 16;
index 9392543ae3af3ac5701b975f9122845e15352813..85ec217fd21548bd4b88961d339946b2f587d3d5 100644 (file)
@@ -890,6 +890,7 @@ struct vdec_h264_hw_s {
        u32 kpi_first_i_decoded;
        int sidebind_type;
        int sidebind_channel_id;
+       u32 low_latency_mode;
 };
 
 static u32 again_threshold;
@@ -6110,7 +6111,7 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq)
                                if (!field_pic_flag && (((p_H264_Dpb->mSPS.profile_idc == BASELINE) &&
                                        (p_H264_Dpb->reorder_pic_num < 2)) ||
                                        (((unsigned long)(hw->vh264_amstream_dec_info
-                                               .param)) & 0x8))) {
+                                               .param)) & 0x8) || hw->low_latency_mode & 0x8)) {
                                        p_H264_Dpb->fast_output_enable =
                                        H264_OUTPUT_MODE_FAST;
                                }
@@ -9426,6 +9427,10 @@ static int ammvdec_h264_probe(struct platform_device *pdev)
                        "parm_v4l_canvas_mem_mode",
                        &config_val) == 0)
                        hw->canvas_mode = config_val;
+               if (get_config_int(pdata->config,
+                       "parm_v4l_low_latency_mode",
+                       &config_val) == 0)
+                       hw->low_latency_mode = config_val;
                if (get_config_int(pdata->config, "sidebind_type",
                                &config_val) == 0)
                        hw->sidebind_type = config_val;