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; } |