summaryrefslogtreecommitdiff
path: root/drivers/mxc/vpu_malone/vpu_b0.h
AgeCommit message (Collapse)Author
2020-03-24MLK-23220:mxc:vpu_malone:kfifo_alloc failure in VPU driver when memory fragmentMing Qian
Suggest to use vmalloc for fifo entity. Then use kfifo_init to init the fifo structure. Then we do not have to require contiguous memory from buddy, especially in a high pressure of memory resource. Signed-off-by: Ming Qian <ming.qian@nxp.com> (cherry picked from commit 0cd3c661b95ecb273da5ee76fe7353ab7abd38c9)
2020-01-22MLK-23263 mxc: vpu_malone: correct vpu decoder used bits of fuseShijie Qin
Malone decoder used bits of fuse are 14-15 bits Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 8d34c1d1ce31048316da88448f8eecbed885fc44)
2019-12-06LF-365 [8QM_MEK/8QXP_MEK]mxc:vpu_malone: need skip tsm when skip not decoded ↵Shijie Qin
frame - If frame ID is MEDIA_PLAYER_SKIPPED_FRAME_ID, need skip this frame, also need skip its tsm at the same time. - Fixed coverity issue: CID 6344236 (#2 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING). - Remove two deaded code about ctx pointer check. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Acked-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 3cc1c455699e456c11118f3ed60b7fc85f1fd61b)
2019-10-31MLK-22769 VPU Decoder: unify code between 4.19 and 5.xShijie Qin
- Separate sc and mu contents to vpu_mu.h/vpu_mu.c - Separate pm_domain contents to vpu_pm.h/vpu_pm.c It not necessary on 4.19, just create API for unify 5.4 - Add kfifo for better hold received mu message - Sync v4l2 change Remove vidioc_enum_fmt_vid_cap_mplane from 5.3.0 Remove v4l2_ioctl_g_crop(), v4l2_ioctl_g_selection could compatible with it from 4.14 or earlier vb2_qbuf() api changed from 4.20.0 Need set devices_caps for video_device when create a video_device - Use ktime_get_real_ts64() replace do_gettimeofday() Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 141fcadc981e7213eeb535bbaf7ad66ed97f11a1)
2019-10-24MLK-22840:VPU Decoder: improve g_fmt/s_fmt of capture portming_qian
refine code to make it more clear Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 8e694ece0711d53339feacd22cbe99560b96957f)
2019-10-23MLK-22822:VPU Encoder: check the stream buffer free space before encodeming_qian
frame If the free space of stream buffer is not enough for one frame, vpu may overwrite the data or hang. so check before encode frame can avoid it. Add new ctrl V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE, user can use this ctrl to set the coded picture buffer size. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 1af0b35c6bfffa57e27f0a39c8b040b93d973278)
2019-10-17MLK-22760:VPU Decoder:improve the start commandming_qian
1. the start command is mixed with transfer data, separate them and make code more clear 2. some condition of start_code_bypass is missing. 3. config the pStreamBuffDesc only before send start command Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 775033eb3dcba27a2b7093caccbc81c1df55ba46)
2019-10-15MLK-22753: VPU Decoder: fix stop timeout caused by waiting res changeming_qian
If firmware report sequence header twice, and the user don't support the format, such as 10-bit NV12, user may close vpu decoder directly, it will send stop cmd. but when driver receive the second sequence header event, it may waiting for resolution change done, it'll block the stop command, and cause it timeout. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 9e1d28861a6f89b9f25641131f8db1ef17b81d3a)
2019-09-19MLK-22606 VPU Decoder: refine decode performance infoShijie Qin
1. change to use list record performance info for better trace each time-point and not limited to a fixed flow. 2. add total time from open device to each time-point. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 1ac0e3d7654f11f3e4f0fbbda941c765bc8f3098)
2019-09-11MMFMWK-8552: fix hang when do seek for resolution change streamming_qian
driver tell seek and res change by the status of output stream. if res change is not handled properly, the stream may hang. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 86163d3eab3760f9659c7a58ff4cdf1a0a58a810)
2019-08-30MLK-22526: VPU: synchronize sending message to MUming_qian
use a spinlock to synchronize sending message to MU Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit bba0b1cfa90594e750784d653b1cd4aa490fdbff)
2019-08-30MLK-22519-2 VPU Decoder: remove *ctrls[V4L2_MAX_CTRLS] from vpu_ctxShijie Qin
*ctrls[V4L2_MAX_CTRLS] is not actually used, and it is easy to cause out-of-bound when add v4l2_ctrl. Hence remove it. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 518fc3ff7a943fc3c25ec37a6409a56719dbe9ad)
2019-08-30MLK-22519-1 VPU Decoder: separate setting start_code_bypass and ↵Shijie Qin
stream_input_mode There is no dependency between start_code_bypass and stream_input_mode, should be set separately. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 6afe7f56151e00e8b5df1ce3c0cc594bd06c3b3b)
2019-08-23MLK-22314-3 VPU Decoder: modify show performance measureShijie Qin
1. start timer from open device; 2. add the interval from open device to feed first data and to send start cmd; 3. In order to reduce the time deviation of print log, use device_attribute file to show performance info. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit 6320f941dc32b86b43c96ecdb1b3ea866d073372)
2019-08-19MLK-22206-2 VPU Decoder: modify vpu log print methodShijie Qin
Move LVL_WARN/LVL_EVENT/LVL_INFO one bit to the left to convenient for adjust log level, and leave 4th position to reserved. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit e15131ed0b07615e18383a2c2a1988ed79327719)
2019-08-16MLK-22420 VPU Decoder: change AVS eos padding data, correct chroma sizeShijie Qin
1. Change AVS format EOS_PADDING_TYPE to EOS_GENERIC_MPEG to align with firmware 2. chroma size shall also be 1/2 luma size for interlaced clips Signed-off-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 73cc86305676ce34d0850db83d8079ac240c093c)
2019-08-05MLK-22164-2 VPU Decoder: check input frame type before update to ring bufferShijie Qin
Previously, only process for RV format, other formats should also be treated in the same way. Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com> (cherry picked from commit e57e6b4924f7f31bed5b05123e92795fa68273ae)
2019-08-02MLK-22370: VPU Decoder: export firmware dbglog using raw data instead ofming_qian
string we can use the debug tool analyze the raw dbglog. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> (cherry picked from commit 9e18d1e319cd5c8c9c223106130ba0d195462061)
2019-07-26MLK-22314 VPU Decoder: add driver param to show decode performanceShijie Qin
module_param(vpu_show_perf_ena, int, 0644); MODULE_PARM_DESC(vpu_show_perf_ena, "enable show vpu decode performance(0-1)"); module_param(vpu_show_perf_idx, int, 0644); MODULE_PARM_DESC(vpu_show_perf_idx, "show performance of which instance(bit N to mask instance N)"); module_param(vpu_show_perf_ent, int, 0644); MODULE_PARM_DESC(vpu_show_perf_ent, "show performance of which event(1: decoded, 2: ready)"); Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com> (cherry picked from commit ca7106d6994b5877f8b7f37f480d889b4acb93fe)
2019-07-26MLK-22313: VPU Decoder: support rv and divx according firmware versionming_qian
1.firmware decide whether it support rv and divx. if firmware don't support, driver will disable these formats. 2. update copyright description Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
2019-07-12MLK-22250: VPU Decoder: get seq info from event data instead of rpcming_qian
memory There is rick getting seq info from rpc It is also compatible with previous practices Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-07-05MLK-22206 VPU Decoder: modify vpu log print methodShijie Qin
vpu error log modify to non-maskable VPU_WARN / VPU_EVENT / VPU_INFO info unified use bit map method Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com>
2019-07-04MLK-22165: VPU Decoder: ignore the invalid timestamp of codec dataming_qian
To ensure the first timestamp after seek is valid, the timestamp of codec data should be ignore, and merge its size to the next frame. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-27MLK-22037-2 VPU Decoder: the resolution of g_fmt may be incorrectShijie Qin
As JPEG format max support resolution is 8188x8188,so modify VPU_DEC_MAX_WIDTH / VPU_DEC_MAX_HEIGTH from 4096x4096 to 8188x8188 Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: ming_qian <ming.qian@nxp.com>
2019-06-27MLK-22097: VPU Decoder: speed up firmware boot after suspendming_qian
If there is no any decode instance, after suspend, firmware will boot again, and before boot, it will cleanup memory, the memory is large for mu, so it cost a lot of time. If cpu cleanup this memory, and firmware skip this step, the boot time can be greatly reduced. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-25MLK-22081: VPU Decoder: reset decoder after abort in certain case toming_qian
avoid vpu hang If abort cmd is sent too early, firmware may hang, and firmware can't fix it easily. So driver can reset the firmware to avoid hang. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-20MLK-22037: VPU Decoder: the resolution of g_fmt may be incorrectming_qian
sometime firmware may report wrong sequence info, invalid resolution. getting and setting seqinfo may in the same time, it's a risk Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-18MLK-22029:VPU Decoder: synchronize certain commands and eventsming_qian
Firmware requires that certain commands and events not be interrupted, but firmware didn't implement it, so it needs driver to ensure that they are sequenced correctly for the FW. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-14MLK-22006: VPU Decoder: support to find certain pattern from input dataming_qian
Sometimes for debug, we want to check the input data whether include certain pattern, for example, the sequence header. Driver implement this feature for debug Fix some typo. Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2019-06-12MLK-21989: VPU Decoder: avoid crash after vpu decoder hangming_qian
If vpu is hang, driver won't really release the instance when v4l2_release, but driver will release queue and buffer, the sysfs device instance*_buffer isn't removed. when we try to access the instance*_buffer in such case, kernel crash will occur. Driver release queue and buffer when we really release the instance, and the crash can be avoided Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-30MLK-21888: VPU Decoder: release frame when resolution changeming_qian
driver may alloc frame after firmware send res_change event, but before driver receive the event. the frame buffer status maybe incorrect in this case. So release all the frames when driver receive the res_change event. remove some unused code show more debug info Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
2019-05-23MLK-21811: VPU Decoder: allocate mbi buffer when requestedming_qian
1. allocate mbi buffer when requested 2. don't block when receive request frame event Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-22MLK-21248-2 VPU Decoder: support adaptive playback in driverShijie Qin
add mutex lock when send abort/stop cmd to firmware, avoid twice abort cmd send at the same time in streamoff and reset. Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-05-22MLK-21794 VPU Decoder: add new v4l2 dec event for report HW decode errorShijie Qin
1. add new v4l2 dec event for report HW decode error #define V4L2_EVENT_DECODE_ERROR (V4L2_EVENT_PRIVATE_START + 1) 2. refine define of V4L2_EVENT_SKIP and IMX_V4L2_DEC_CMD_RESET #define V4L2_EVENT_SKIP (V4L2_EVENT_PRIVATE_START + 2) #define IMX_V4L2_DEC_CMD_START (0x09000000) #define IMX_V4L2_DEC_CMD_RESET (IMX_V4L2_DEC_CMD_START +1) Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-05-21MLK-21798: VPU Decoder: dump firmware log using debugfs instead of sysfsming_qian
The size of sysfs is limited to PAGE_SIZE. But there is no limit if using debugfs. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-21MLK-21778: VPU Decoder: check vb2 buffer is changedming_qian
1. check vb2 buffer is changed 2. avoid duplicate qbuf with same index 3. add some debug log Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-20MLK-21774: VPU Decoder: avoid request frame buffer after abortming_qian
firmware may restart request frame buffer after send event STR_BUF_RST to driver. So frame buffer may be requested before driver clear queue. It's not safe. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-17MLK-21757 VPU Decoder: move send abort cmd to firmwareShijie Qin
from output port to capture port move send abort cmd to firmware from output port to capture port Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-05-17MLK-21763:VPU Decoder: fix frame buffer status may be incorrect afterming_qian
reqbufs if driver didn't receive the frame release event. and user execute streamoff and reqbufs, all of frames are new, and should set status to alloc. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-17MLK-21655: VPU Decoder: driver supply an interface to get the firmwareming_qian
log get the firmware log: cat /sys/devices/platform/2c000000.vpu_decoder/fwlog Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-05-16MLK-21248 VPU Decoder: support adaptive playback in driverShijie Qin
--add a new v4l2 dec cmd add a new v4l2 dec cmd support reconfig setting #define IMX_V4L2_DEC_CMD_RESET (5) extract independent function for send ABORT/STOP cmd to firmware Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-05-10MLK-21684 VPU Decoder: add new v4l2_g_ctrl to supplyShijie Qin
color aspect info #define V4L2_CID_USER_FRAME_COLORDESC (V4L2_CID_USER_BASE + 0x1104) #define V4L2_CID_USER_FRAME_TRANSFERCHARS (V4L2_CID_USER_BASE + 0x1105) #define V4L2_CID_USER_FRAME_MATRIXCOEFFS (V4L2_CID_USER_BASE + 0x1106) #define V4L2_CID_USER_FRAME_FULLRANGE (V4L2_CID_USER_BASE + 0x1107) #define V4L2_CID_USER_FRAME_VUIPRESENT (V4L2_CID_USER_BASE + 0x1108) refine code of v4l2 contrl function Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-04-30MLK-21589 VPU Decoder: implement insert decode header ofShijie Qin
RV format for Amphion decoder Insert sequence header, frame header and slice header for input buffer of RV format. Include rv8, rv9 and rv10, the header of rv9 and rv10 are the same. Extract an independent punction for copy buffer to ring stream buffer. Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-04-24MLK-21523: VPU Decoder: add timestamp thresholdming_qian
add timestamp threshold add bitstream low threshold add bitstream high threshold use the timestamp threshold or bitstream high threshold to control the speed of input. To avoid hang, you can set bitstream low threshold to a proper value. When fifo low event is received, driver will copy data to stream buffer. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-04-24MLK-21522: VPU Decoder: fix the api of tsm is not thread safeming_qian
the api of tsm is not thread safe. but in driver context, it's multithread. add a lock to protect the api Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-04-23MLK-21521 VPU Decoder: add new v4l2_s_contrl for contrl decode frame disable ↵Shijie Qin
reorder #define V4L2_CID_USER_FRAME_DIS_REORDER (V4L2_CID_USER_BASE + 0x1300) cfg.ops = &vpu_custom_ctrl_ops; cfg.id = V4L2_CID_USER_FRAME_DIS_REORDER; cfg.name = "frame disable reoder ctrl"; cfg.min = 0; cfg.max = 1; cfg.step = 1; cfg.def = 0; cfg.type = V4L2_CTRL_TYPE_BOOLEAN; Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-04-18MLK-21442: VPU Decoder: could not handle timestamp with start offsetming_qian
add some nxp buf flags: CODECCONFIG and TIMESTAMP_INVALID if TIMESTAMP_INVALID is enabled, drop the timestamp. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-04-11MLK-21437 VPU Decoder: add new v4l2_s_ctrl for adjust vpu_frm_depthShijie Qin
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
2019-04-11MLK-21427: VPU Decoder: more subdivide logming_qian
1. keep the original four log level 2. add several bitmap to represent some particular log Almost all of the log level are LVL_INFO, so it's hard to get certain information. Signed-off-by: ming_qian <ming.qian@nxp.com>
2019-04-11MLK-21087: [i.MX8QXP/VPU]: Integrate timestamp manager into driverming_qian
1.integrate manager into vpu malone 2.implement get and set frame interval 3.parse frame rate reported by firmware 4.calculate consumed bytesused by uPicEndAddr Signed-off-by: ming_qian <ming.qian@nxp.com>