Commit Graph

54 Commits

Author SHA1 Message Date
21c2a9c270 MLK-19403 VPU: Fix some decoder and encoder code bugs
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)
2019-02-12 10:33:37 +08:00
190d52ee4c MLK-19353 VPU: Rename VPU firmware binary
Rename VPU firmware binary, change from 'vpu_fw_imx8qxp_xxx.bin' to
'vpu_fw_imx8_xxx.bin'

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit d645e79676e178674e27c7706cf7080de5fdf3b8)
2019-02-12 10:33:33 +08:00
648b068a90 MLK-19226 VPU: Add support for i.MX8QM B0 vpu decoder and encoder
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)
2019-02-12 10:33:27 +08:00
8dfd457aa8 MLK-19206 VPU: Modify the action for disable recoder
Modify the action for disable recoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 64302c586a541f8effc1e16427f50ec490918a9d)
2019-02-12 10:33:27 +08:00
49f7904786 MLK-19136 VPU: Modify vpu encoder code for Android
- 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)
2019-02-12 10:33:06 +08:00
3278256b1e MLK-19121 - [i.MX8QXP/VPU]: Add low-latency support
Add variable 'b_dis_reorder' to control reorder
Add flush start code for low-latnecy
Add module parameter 'vpu_frm_depth' to allow user config input depth
Add some useful frame count, including decode/display delay
Refine debug level

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit a99e27af849c99aaf753cdad86d7a54da750ccc6)
2019-02-12 10:33:05 +08:00
d67eef9312 MLK-18982 VPU: Add support for vp6, vp8, spk, divx, mjpeg
Add support for vp6, vp8, spk, divx, mjpeg by adding start code

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit b943cabf2255d93c04cec9795a1b9bcbe2b656ec)
2019-02-12 10:33:04 +08:00
5e2b69e26a MLK-18954 VPU: Add support for H263 and VC1
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)
2019-02-12 10:33:04 +08:00
6f08ad897e - MLK-19004 - [i.MX8QXP/VPU]: Add self-defined EOS tag instead of standard tag
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)
2019-02-12 10:32:55 +08:00
38aafdf731 MLK-18831 VPU: Adjust the condition for request frame when do seek
Adjust the condition for request frame when do seek

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:37 +08:00
2feceba603 MLK-18791 VPU: Fix the potential issue for add_eos
Fix the potential issue for add_eos to ensure memory won’t out
of range access

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:36 +08:00
b02db831d5 MLK-18725 VPU: Fix seek issue for Android when use DMA buffer
-	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>
2019-02-12 10:32:34 +08:00
e2038bdbe0 MLK-18717 VPU: Add judge when v4l2 function return error and print the
error value

Add judge when v4l2 function return error and print the error value

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:34 +08:00
54b0943cf2 MLK-18679 VPU: fix the issue that Andriod has memory leak when call
several times reqbufs

fix this issue by free the mbi buffer when request buffer count 0

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:30 +08:00
3a1d4ab723 MLK-18671 VPU: Change MIN CAPTURE buffer count for vpu decoder
Change MIN CAPTURE buffer count for vpu decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:26 +08:00
5cbe90d881 MLK-18664 VPU: Send eos event when receive VID_API_EVENT_FIRMWARE_XCPT
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>
2019-02-12 10:32:26 +08:00
afb045b51c MLK-18659 VPU: Reserve 24M memory for vpu decoder stream buffers in dts
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>
2019-02-12 10:32:25 +08:00
f2fba11c02 MLK-18604 VPU: Add multi-planar support for vpu encoder
Add multi-planar support for vpu encoder, and add more debug logs for
vpu decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:17 +08:00
b9876e09ab MLK-18545: [Linux_8QXP_MEK]Video:Video disappeared after long time loop
play the test clip, 100%

fix it by comment out resolution change event in vpu decoder driver

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:05 +08:00
7a9ffad308 MLK-17305 [MX8QXP-MEK] VPU: "couldn't set vpu_dec_clk clk rate to
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>
2019-02-12 10:32:03 +08:00
9a35b086ac MLK-18495 VPU: Add the event VID_API_EVENT_FIRMWARE_XCPT and modify interlaced flag
Add the event VID_API_EVENT_FIRMWARE_XCPT and modify interlaced flag for
vpu decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:32:02 +08:00
4a98640603 MLK-18467 VPU: Add support for interlaced and 10bit for VPU decoder
Add support for interlaced and 10bit in v4l2 driver for vpu decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:59 +08:00
434111fb29 MLK-18421 VPU: Refine the eos progress for vpu decoder
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>
2019-02-12 10:31:59 +08:00
070e229668 MLK-18389:vpu encoder add multi-workqueue suspend and resume
create multi workqueue for vpu encoder
    add suspend and resume code to encoder driver
    add wait resume done in decoder resume function
    solve coverity issue: 3520461 Out-of-bounds read

Signed-off-by: GuoRui <rui.guo_4@nxp.com>
2019-02-12 10:31:56 +08:00
db8f2669ce MLK-18356 VPU: Change g_fmt and s_fmt to make it compitable with Andriod
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>
2019-02-12 10:31:52 +08:00
66db8ea624 MLK-18354 vpu decoder implement suspend and resume
Signed-off-by: GuoRui <rui.guo_4@nxp.com>
2019-02-12 10:31:51 +08:00
58dce04aa4 MLK-18353 VPU: Fix eos hang issue for vpu decoder
Fix eos hang issue for vpu decoder on mek B0 board

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:51 +08:00
047d4e549c MLK-18332 VPU: Create multi workqueue for different instance to run
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>
2019-02-12 10:31:49 +08:00
b4e924ad83 MLK-18291 VPU: Add reset operation for VPU b0 decoder
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>
2019-02-12 10:31:41 +08:00
9474185333 MLK-18273 VPU: Modify behavior of end of stream for decoder
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>
2019-02-12 10:31:40 +08:00
e1314b06c4 MLK-18250 VPU: Add MU for vpu encoder and decoder power in dts for
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>
2019-02-12 10:31:39 +08:00
f7070fc79b MLK-18194 VPU: Add CRC log dump when receive event
VID_API_EVENT_PIC_DECODED

Add CRC log dump when receive event VID_API_EVENT_PIC_DECODED

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:31 +08:00
2627c66a72 MLK-18131 VPU: Update vpu decoder B0 driver for changing crop info and
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>
2019-02-12 10:31:29 +08:00
8c1a22c7b0 MLK-18125 VPU: update vpu decoder B0 driver for seek operation
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>
2019-02-12 10:31:28 +08:00
296f798aa5 MLK-18103 VPU: Enable runtime resume and suspend in vpu decoder and
encoder

Add runtime resume and suspend operation in vpu decoder and encoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:26 +08:00
c7160ce941 MLK-18079 add encoder multi-instance and stop cmd to firmware, remove yuv format convert, modify decoder log level
-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>
2019-02-12 10:31:25 +08:00
418a5c8632 MLK-18067[IMX8QXP B0] Deal with the case that receive
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>
2019-02-12 10:31:16 +08:00
fea5146a95 MLK-18037[IMX8QXP B0] Add 10bit support on QXP B0 for vpu decoder
Add 10bit support on QXP B0 for vpu decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:15 +08:00
26474ba867 MLK-18030[IMX8QXP B0] Some code adjustment for IMX8QXP B0 VPU decoder
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>
2019-02-12 10:31:14 +08:00
e974df5601 MLK-18006[IMX8QXP B0] VPU fault when use the latest toolchain for
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>
2019-02-12 10:31:14 +08:00
a56388d3df MLK-17999[IMX8QXP B0] Change the definition of vpu B0 firmware name for
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>
2019-02-12 10:31:12 +08:00
caf0c44e18 MLK-17994[IMX8QXP B0] Solve the problem that it will hang when using
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>
2019-02-12 10:31:11 +08:00
5f1cf9b89e MLK-17987[IMX8QXP B0] Fix coverity issues in vpu_b0.c for vpu B0 decoder
code

Fix coverity issues in vpu_b0.c for vpu B0 decoder code:
CID(3248259) Out-of-bounds read
CID(3248246) Dereference after null check
CID(3248229) Resource leak
CID(3248245) Out-of-bounds write
CID(3248242) Out-of-bounds read
CID(3248241) Out-of-bounds write
CID(3248227) Negative array index read

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:11 +08:00
306e617e24 MLK-17978[IMX8QXP B0] Add a buffer null flag to ensure the buffer is not
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>
2019-02-12 10:31:10 +08:00
5b63e353a0 MLK-17975[IMX8QXP B0] Modify buffer status management and delete some
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>
2019-02-12 10:31:09 +08:00
879063b721 MLK-17974[IMX8QXP B0] Add judgement for find_buffer_id to avoid read
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>
2019-02-12 10:31:09 +08:00
84c28ad555 MLK-17967[IMX8QXP B0] Judge the buffer status when queue buffer
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>
2019-02-12 10:31:08 +08:00
996aa46734 MLK-17963[IMX8QXP B0] Send stop command to stop vpu firmware when do close
send VID_API_CMD_STOP to stop vpu firmware when do close action

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:08 +08:00
a6974c4157 MLK-17946[IMX8QXP B0] Change VPU_PIX_FMT_ASP to V4L2_PIX_FMT_MPEG4
Change VPU_PIX_FMT_ASP to V4L2_PIX_FMT_MPEG4 for vpu b0 encoder and
decoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:31:08 +08:00
30f2885b10 MLK-17945[IMX8QXP B0] Deal with the case that firmware download fails
Deal with the case that vpu firmware download fails, release the context
data

Signed-off-by: nxa13443 <chaofan.huang@nxp.com>
2019-02-12 10:31:07 +08:00