From: Nanxin Qin Date: Thu, 4 Jun 2020 03:31:18 +0000 (+0800) Subject: v4l: add parms low_latency_mode for fast output frame. [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac6d9ebb66d1004fefb6a88cdf0017cc2445b95d;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git v4l: add parms low_latency_mode for fast output frame. [1/1] 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 --- diff --git a/drivers/amvdec_ports/aml_vcodec_drv.h b/drivers/amvdec_ports/aml_vcodec_drv.h index f28dc51..1bc6211 100644 --- a/drivers/amvdec_ports/aml_vcodec_drv.h +++ b/drivers/amvdec_ports/aml_vcodec_drv.h @@ -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 { diff --git a/drivers/amvdec_ports/decoder/vdec_h264_if.c b/drivers/amvdec_ports/decoder/vdec_h264_if.c index 04173d6..40cbeb8 100644 --- a/drivers/amvdec_ports/decoder/vdec_h264_if.c +++ b/drivers/amvdec_ports/decoder/vdec_h264_if.c @@ -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; diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 9392543..85ec217 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -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;