summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--[-rwxr-xr-x]Media.mk1
-rw-r--r--drivers/amvdec_ports/Makefile1
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.c112
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.h5
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c992
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.h2
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_drv.c122
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.c206
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.h34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_drv.h188
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.c34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.h90
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.c28
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.c81
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.c133
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.c34
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.c178
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.c26
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/vdec_h264_if.c223
-rw-r--r--drivers/amvdec_ports/decoder/vdec_hevc_if.c194
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mjpeg_if.c210
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg12_if.c304
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg4_if.c209
-rw-r--r--drivers/amvdec_ports/decoder/vdec_vp9_if.c195
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.c6
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.h21
-rw-r--r--drivers/common/chips/chips.c1
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.c8
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.h1
-rw-r--r--drivers/common/firmware/firmware_drv.c9
-rw-r--r--drivers/common/firmware/firmware_type.c1
-rw-r--r--drivers/common/firmware/firmware_type.h1
-rw-r--r--drivers/common/media_clock/clk/clk.c3
-rw-r--r--drivers/common/media_clock/clk/clkg12.c5
-rw-r--r--drivers/frame_provider/decoder/Makefile1
-rw-r--r--drivers/frame_provider/decoder/avs/avs.c60
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_bufmgr.c12
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_global.h3
-rw-r--r--drivers/frame_provider/decoder/avs2/vavs2.c115
-rw-r--r--drivers/frame_provider/decoder/avs_multi/Makefile2
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avs_multi.c1633
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avsp_trans_multi.c5065
-rw-r--r--drivers/frame_provider/decoder/h264/vh264.c58
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.c50
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.h34
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c1043
-rw-r--r--drivers/frame_provider/decoder/h265/vh265.c707
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c60
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c595
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4.c5
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c80
-rw-r--r--drivers/frame_provider/decoder/utils/amvdec.c5
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.c178
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.h4
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.c530
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.h18
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c12
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.h3
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.c92
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.h7
-rw-r--r--drivers/frame_provider/decoder/vav1/Makefile2
-rw-r--r--drivers/frame_provider/decoder/vav1/aom_av1_define.h171
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_bufmgr.c3392
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_global.h2310
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.c9946
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.h22
-rw-r--r--drivers/frame_provider/decoder/vc1/vvc1.c46
-rw-r--r--drivers/frame_provider/decoder/vp9/vvp9.c449
-rw-r--r--drivers/frame_sink/encoder/h264/encoder.c2
-rw-r--r--drivers/stream_input/Makefile5
-rw-r--r--drivers/stream_input/amports/amstream.c263
-rw-r--r--drivers/stream_input/parser/demux/aml_dvb.h5
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/demod_gt.h62
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/frontend.c293
-rw-r--r--drivers/stream_input/parser/dvb_common.c17
-rw-r--r--drivers/stream_input/parser/dvb_common.h26
-rw-r--r--drivers/stream_input/parser/esparser.c15
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_demod_gt.h87
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dmx.c270
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.c445
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.h32
-rw-r--r--drivers/stream_input/parser/streambuf.c9
-rw-r--r--drivers/stream_input/parser/tsdemux.c14
-rw-r--r--drivers/stream_input/parser/tsdemux.h1
-rw-r--r--drivers/stream_input/tv_frontend/Makefile16
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.c1372
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.h213
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_frontend.c791
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.c2163
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.h323
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/aml_demod.c725
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/amlfrontend.c1402
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/demod_func.c2996
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbc_func.c1331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbt_func.c2188
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/i2c_func.c42
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/acf_filter_coefficient.h414
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che.h77
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che_bit.h266
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front.h70
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front_bit.h331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync.h53
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync_bit.h110
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top.h90
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top_bit.h178
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/aml_dtv_demod_reg.h28
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/amlfrontend.h86
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/demod_func.h626
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/tuner_func.c189
-rw-r--r--firmware/video_ucode.bin14148
116 files changed, 25845 insertions, 36303 deletions
diff --git a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
index 493231b..eab36e5 100644
--- a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
+++ b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
@@ -257,6 +257,22 @@ static void set_frame_info(struct vdec_mjpeg_hw_s *hw, struct vframe_s *vf)
static irqreturn_t vmjpeg_isr(struct vdec_s *vdec, int irq)
{
+ struct vdec_mjpeg_hw_s *hw =
+ (struct vdec_mjpeg_hw_s *)(vdec->private);
+
+ if (!hw)
+ return IRQ_HANDLED;
+
+ if (hw->eos)
+ return IRQ_HANDLED;
+
+ WRITE_VREG(ASSIST_MBOX1_CLR_REG, 1);
+
+ return IRQ_WAKE_THREAD;
+}
+
+static irqreturn_t vmjpeg_isr_thread_fn(struct vdec_s *vdec, int irq)
+{
struct vdec_mjpeg_hw_s *hw = (struct vdec_mjpeg_hw_s *)(vdec->private);
u32 reg;
struct vframe_s *vf = NULL;
@@ -264,13 +280,7 @@ static irqreturn_t vmjpeg_isr(struct vdec_s *vdec, int irq)
u64 pts_us64;
u32 frame_size;
- if (!hw)
- return IRQ_HANDLED;
-
- if (hw->eos)
- return IRQ_HANDLED;
reset_process_time(hw);
- WRITE_VREG(ASSIST_MBOX1_CLR_REG, 1);
if (READ_VREG(AV_SCRATCH_D) != 0 &&
(debug_enable & PRINT_FLAG_UCODE_DETAIL)) {
pr_info("dbg%x: %x\n", READ_VREG(AV_SCRATCH_D),
@@ -308,9 +318,6 @@ static irqreturn_t vmjpeg_isr(struct vdec_s *vdec, int irq)
hw->v4l_params_parsed = true;
vdec_v4l_set_ps_infos(ctx, &ps);
}
-
- if (!ctx->v4l_codec_ready)
- return IRQ_HANDLED;
}
if (hw->is_used_v4l) {
@@ -351,6 +358,7 @@ static irqreturn_t vmjpeg_isr(struct vdec_s *vdec, int irq)
vf->mem_handle =
decoder_bmmu_box_get_mem_handle(
hw->mm_blk_handle, index);
+ decoder_do_frame_check(vdec, vf);
kfifo_put(&hw->display_q, (const struct vframe_s *)vf);
ATRACE_COUNTER(MODULE_NAME, vf->pts);
hw->frame_num++;
@@ -463,8 +471,11 @@ static void vmjpeg_canvas_init(struct vdec_mjpeg_hw_s *hw)
u32 canvas_width, canvas_height;
u32 decbuf_size, decbuf_y_size, decbuf_uv_size;
unsigned long buf_start, addr;
+ u32 endian;
struct vdec_s *vdec = hw_to_vdec(hw);
+ endian = (vdec->canvas_mode ==
+ CANVAS_BLKMODE_LINEAR) ? 7 : 0;
canvas_width = 1920;
canvas_height = 1088;
decbuf_y_size = 0x200000;
@@ -509,12 +520,12 @@ static void vmjpeg_canvas_init(struct vdec_mjpeg_hw_s *hw)
hw->buffer_spec[i].v_canvas_index = canvas_v(canvas);
}
- canvas_config(hw->buffer_spec[i].y_canvas_index,
+ canvas_config_ex(hw->buffer_spec[i].y_canvas_index,
hw->buffer_spec[i].y_addr,
canvas_width,
canvas_height,
CANVAS_ADDR_NOWRAP,
- CANVAS_BLKMODE_LINEAR);
+ CANVAS_BLKMODE_LINEAR, endian);
hw->buffer_spec[i].canvas_config[0].phy_addr =
hw->buffer_spec[i].y_addr;
hw->buffer_spec[i].canvas_config[0].width =
@@ -523,13 +534,15 @@ static void vmjpeg_canvas_init(struct vdec_mjpeg_hw_s *hw)
canvas_height;
hw->buffer_spec[i].canvas_config[0].block_mode =
CANVAS_BLKMODE_LINEAR;
+ hw->buffer_spec[i].canvas_config[0].endian =
+ endian;
- canvas_config(hw->buffer_spec[i].u_canvas_index,
+ canvas_config_ex(hw->buffer_spec[i].u_canvas_index,
hw->buffer_spec[i].u_addr,
canvas_width / 2,
canvas_height / 2,
CANVAS_ADDR_NOWRAP,
- CANVAS_BLKMODE_LINEAR);
+ CANVAS_BLKMODE_LINEAR, endian);
hw->buffer_spec[i].canvas_config[1].phy_addr =
hw->buffer_spec[i].u_addr;
hw->buffer_spec[i].canvas_config[1].width =
@@ -538,13 +551,15 @@ static void vmjpeg_canvas_init(struct vdec_mjpeg_hw_s *hw)
canvas_height / 2;
hw->buffer_spec[i].canvas_config[1].block_mode =
CANVAS_BLKMODE_LINEAR;
+ hw->buffer_spec[i].canvas_config[1].endian =
+ endian;
- canvas_config(hw->buffer_spec[i].v_canvas_index,
+ canvas_config_ex(hw->buffer_spec[i].v_canvas_index,
hw->buffer_spec[i].v_addr,
canvas_width / 2,
canvas_height / 2,
CANVAS_ADDR_NOWRAP,
- CANVAS_BLKMODE_LINEAR);
+ CANVAS_BLKMODE_LINEAR, endian);
hw->buffer_spec[i].canvas_config[2].phy_addr =
hw->buffer_spec[i].v_addr;
hw->buffer_spec[i].canvas_config[2].width =
@@ -553,6 +568,8 @@ static void vmjpeg_canvas_init(struct vdec_mjpeg_hw_s *hw)
canvas_height / 2;
hw->buffer_spec[i].canvas_config[2].block_mode =
CANVAS_BLKMODE_LINEAR;
+ hw->buffer_spec[i].canvas_config[2].endian =
+ endian;
}
}
@@ -1432,6 +1449,7 @@ static int ammvdec_mjpeg_probe(struct platform_device *pdev)
pdata->run = run;
pdata->run_ready = run_ready;
pdata->irq_handler = vmjpeg_isr;
+ pdata->threaded_irq_handler = vmjpeg_isr_thread_fn;
pdata->dump_state = vmjpeg_dump_state;
if (pdata->parallel_dec == 1) {
@@ -1504,9 +1522,13 @@ static int ammvdec_mjpeg_remove(struct platform_device *pdev)
struct vdec_mjpeg_hw_s *hw =
(struct vdec_mjpeg_hw_s *)
(((struct vdec_s *)(platform_get_drvdata(pdev)))->private);
- struct vdec_s *vdec = hw_to_vdec(hw);
+ struct vdec_s *vdec;
int i;
+ if (!hw)
+ return -1;
+ vdec = hw_to_vdec(hw);
+
vmjpeg_stop(hw);
if (vdec->parallel_dec == 1)
@@ -1521,10 +1543,8 @@ static int ammvdec_mjpeg_remove(struct platform_device *pdev)
vdec->free_canvas_ex(hw->buffer_spec[i].v_canvas_index, vdec->id);
}
}
- if (hw) {
- vfree(hw);
- hw = NULL;
- }
+ vfree(hw);
+
pr_info("%s\n", __func__);
return 0;
}