Age | Commit message (Collapse) | Author |
|
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)
|
|
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)
|
|
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)
|
|
- 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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
*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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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)
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
1. allocate mbi buffer when requested
2. don't block when receive request frame event
Signed-off-by: ming_qian <ming.qian@nxp.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
log
get the firmware log:
cat /sys/devices/platform/2c000000.vpu_decoder/fwlog
Signed-off-by: ming_qian <ming.qian@nxp.com>
|
|
--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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
|
|
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>
|
|
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>
|