Fix some decoder and encoder code bugs as follows:
- change vpu_stop_streaming to prevent deleting repeated entry
- reduce wait time for encoder from 5s to 1s
- change vpu_suspend to correct the calling of vpu_set_power() function
- change vpu_next_free_instance() to depart QM from QXP
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 77a85c0fdeecac5042147d4e842e6a60240a745e)
Add support for i.MX8QM B0 vpu decoder and encoder and it is compatiable
with i.MX8QXP B0 VPU.
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit f2d7823da29c55644299eea84a2e866ea188c698)
Modify the action for disable recoder
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 64302c586a541f8effc1e16427f50ec490918a9d)
- Add sync frame flags
- modify width & height value when get format after set format for capture
- modify poll function
- decrease MIN_BUFFER_COUNT count to 3
- change file license
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 378f251af9ccd6b94b48ff88582b9044c9ac367d)
Add support for VC1 by adding start code and adjust transfer format for
H263
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 5bf003ce4fda812286eb9dc2f365e2608bfd5bad)
Add self-defined EOS tag for some formats, includes: Mpeg2 and Mjpeg
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 6550b3dca4eaf6c42c38234a6e8bbf09072d9f54)
- For DMA buffer add a record for the physical address of the luma
buffer and chroma buffer
- Add a judge in poll function to make sure that all frames can
output after eos event queued
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Send eos event when receive VID_API_EVENT_FIRMWARE_XCPT to make vpu decoder
exit when firmware has error
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
and modify interlaced
- Reserve 24M memory for vpu decoder stream buffers in dts, and 8M
for each instance
- Modify interlaced by using ctx->pSeqinfo->uProgressive to judge
interlaced or progressive
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
600000000 (-22)" and "clk: couldn't set vpu_enc_clk clk rate to
600000000 (-22), current rate: 0" when boot up. 100%
vpu clock is not settable, remove the assigned-clock-rates from the dts
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
simplify the current design about EOS handling:
- add_eos() is called only in V4L2_DEC_CMD_STOP, and no any block for
application
- stream_feed_complete: removed
- firmware_finished: simplified and reserved only for debug
- eos_stop_added: simplified and reserved only for debug
avoid abort hang(h264/hevc) in corner case
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
and Linux calling
Change g_fmt and s_fmt to make it compitable with Andriod and Linux
calling for vpu decoder
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
multi-instance for vpu decoder
Create multi workqueue for different instance to run multi-instance for
vpu decoder, in case that when one instance hang, it will impact others
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Add reset opreation for vpu b0 decoder, when the hang path number
reached to the max supported instance number, reset VPU decoder.
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Change behaviour of end-of-stream behaviour. When application signals stream
feed complete by sending a V4L2_DEC_CMD_STOP, rather than immediately inserting
the EOS marker into the buffer, instead set a flag to do the insertion on the
next LWM from hardware. This involves both driver and firmware changes.
New flow
-------
1. Receive V4L2_DEC_CMD_STOP, set ctx->stream_feed_complete = true
2. On next VID_API_EVENT_FIFO_LOW call add_eos() to insert an EOS
and padding. Set ctx->eos_stop_added = true
3. On VID_API_EVENT_FINISHED generate V4L2_EVENT_EOS from driver
Additional control also present to ensure that...
1. If an abort is triggered prior to the end of stream EOS marker
being added, then the EOS is not added by driver
2. If an abort is triggered after the driver has inserted the EOS
marker to signify end of stream then the abort is ignored
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
scfw xrdc enforcing, and add sync for v4l2 driver and firmware
Add MU for vpu encoder and decoder power in dts for scfw xrdc enforcing,
and add sync for v4l2 driver and firmware
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
fimware name
- Change the info get from v4l2_ioctl_g_crop, change decode
resolution to display resolution
- Add the synchronization for START COMMAND with firmware, and
print firmware version
- Add vpu/ for firmware name vpu_fw_imx8qxp_dec.bin
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
update vpu decoder B0 driver for seek operation, changes as follows:
- Check ‘firmware_stopped’ before send eos when receive
application end of stream command
- Add calling of ‘v4l2_update_stream_addr’ on stream on
- Add check before calling abort command
- Not call add_eos for abort command since firmware will insert
eos locally
- Insert mb() for command/feed_data operation
- Move ‘v4l2_event_queue_fh(eos)’ from VID_API_EVENT_STOPPED to
VID_API_EVENT_FINISHED
- Add ‘firmware_finished’ in VID_API_EVENT_FINISHED
- Header file: wait_abort_done/ firmware_finished/ eos_stop_added
- Update mediasys_types.h to get crop info
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
-Max instances count be set to three
-Encoder will stop when receive STOP command
-modify decoder log level between error and info
Signed-off-by: GuoRui <rui.guo_4@nxp.com>
VID_API_EVENT_FINISHED when reset
Deal with the case that receive VID_API_EVENT_FINISHED when reset in vpu
B0 decoder driver
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
driver
Some code adjustment for IMX8QXP B0 VPU decoder driver:
- replace sending command VID_API_CMD_STOP with add_eos() when receive
V4L2_DEC_CMD_STOP
- add some protection in event handler when firmware is stopped
- change pStrBufDesc->wptr = pStrBufDesc->rptr, when receive ABORT DONE
event
- add lock when get the index for ctx
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
imx8qxp B0 board
VPU fault when use the latest toolchain for imx8qxp B0 board, replace
"ioreamp" with "ioremap_wc" in decoder and encoder for the following
memcpy action
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
qxp board
Change the definition of vpu B0 firmware name for qxp board to follow
previous platforms
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
gplay decoding streams and when press "x" to end decoding
Solve the problem that it will hang when using gplay decoding stream and
when press "x" to end decoding, as driver still deal with request frame
event after receive reset done, it will hang, so add some judge to avoid it
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
null and a judge function for request buffer
Add a buffer null flag to ensure the buffer is not null when calling
report_buffer_done(), and add a judge function when receive event
VID_API_EVENT_REQ_FRAME_BUFF to ensure that we have right status buffer
for the firmware
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
redundacy code
Modify buffer status management, when the status is wrong, report it but
still change the status, move the abort action before the vb2_streamoff
calling, and delete some redundacy code
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
NULL buffer
Add judgement for find_buffer_id to avoid read NULL buffer, it is a
simple workaround and this case should not happen
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Judge the buffer status when it is free or decoded, that means it is
used by the firmware, don't put it on the list
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>