fix potential compiler issue on many platforms:
error: macro "__assign_str" passed 2 arguments, but takes just 1
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
The wave6 decoder support identical size ranges horizontally as
vertically.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
When colorspace change, but size is not changed, firmware still trigger
a source chagne event.
1. Implement decoder start cmd.
2. Report V4L2_EVENT_SRC_CH_COLORSPACE if only colorspace change
3. Don't do buffer allocation again if only colorspace change
4. Use macro to magic number 32
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Firmware may require work buffer in handling create_instance,
that dma_alloc_coherent with GFP_KERNEL may spend too much
time, that may led to CREATE_INSTANCE timeout, then fail the
pipeline.
So just preallocate some work buffers, to reduce the probability of
timeout
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Make delay interval in read_poll_timeout, take the initiative to
yield the scheduling.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
update wave6 v4l2 driver to v1.3.11,
and fix the following issues:
1. NXPSEU-377: solve encoder rc issue
2. reduce the required sram size from 96K to 82K
and retain the following changes:
1. fix compile errors
2. LF-11686-9: mxc: vpu: wave6: report the firmware git sha code
3. LF-10942-1: mxc: vpu: wave6: add a debugfs to get the firmware log
4. LF-10942-2: mxc: vpu: wave6: support to reload firmware
5. LF-13605: sync bounce buffer
6. LF-13681: arm64: virtio video: adjust 6.12 version
7. increase some error log levels
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Don't load vpu firmware if just rmmod after insmod.
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Ensure the loading firmware work has put power domain in wait boot done,
then it won't cause some asynchronous problems.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
VPU did not support 4G+ address, and IOMMU not enable now.
So in XEN, swiotlb was used in dom0 VPU driver.
Need add dma_sync_xxx for bounce buffer.
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
driver use v4l2_m2m_suspend to pause vpu jobs, and it may be called in
different context besides the real suspend. To avoid mutual influence,
we implement a wave6_vpu_pause to handle the pause function.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
if we keep the workqueue, before suspend, we need to freeze the
workqueue job manually.
if we move the parsing sequencee header to the v4l2 m2m job, then
the v4l2_m2m_suspend will help handle it.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
1. sleep without power off, the cur_pc is not zero, driver will boot
done directly, without wakeup cmd. in this case, we should not clear
the work buffers.
2. remove the GLOBAL_WR register, there is only 1 vpu-ctrl device to
manage the firmware loading.
3. add some debug log
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
waiting and loading firmware are asynchronous.
and loading process is called in default worker kernel thread.
waiting process may timeout due to scheduling delays,
especially just waking up from system sleep.
(phylink change,kauditd...)
so use 'wait event + longterm timeout + interruptible + freezeble'
but not 'read_poll_timeout'
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: MingQian <ming.qian@nxp.com>
if using hevc format and setting 5_0 level,
the actural level of encoded stream is 3_0.
the root cause is when open device,the default level is set.
set hevc format first and then set avc format.
the default level of avc format is 50 which equal to 3_0 level for hevc.
when userspace set level of hevc again, the value is not changed.
so driver will use the error value
Separated encoder parameters by codec to prevent
default values of some parameters from being overwritten.
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: MingQian <ming.qian@nxp.com>
For 4k decoding in our board, the performance can reach higher level than
which marked in datasheet.
So removing level interface of decoder is reasonable.
Otherwise, We can not ensure that the encoder will not use a large level
when encoding with a small bitrate or resolution.
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: MingQian <ming.qian@nxp.com>
The number of registered frame buffer should not exceed the firmware
limitation. The maximum fb number that firmware can support is 31.
Don't register too many frame buffer one time.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
In LF-12523, the wave6 vpu has enabled the thermal cooling, that means
the vpu clk rate may be changed. but it won't be changed during one
encoding or decoding task.
we can get clk rate for every encoding or decoding task.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Add support for Wave6 VPU passive cooling using dynamic frequency scaling.
Signed-off-by: Mihai Despotovici <mihai.despotovici@nxp.comn>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Nas Chung <nas.chung@chipsnmedia.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Mihai Despotovici <mihai.despotovici@nxp.comn>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Nas Chung <nas.chung@chipsnmedia.com>
Support profile and level v4l2 controls for decoder.
These controls can be used by host for reference.
The control values are updated by decoder driver after parsing header.
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: MingQian <ming.qian@nxp.com>
Report the average QP value of current encoded frame via the control
V4L2_CID_MPEG_VIDEO_AVERAGE_QP, the value applies to the last dequeued
capture buffer.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
update wave6 v4l2 driver to v1.3.10, and the following patch is still
retained
LF-10673: mxc: vpu: wave6: add fps statistics
LF-11686-5: NXPSEU-267: mxc: vpu: wave6: support sei recovery flag
LF-11686-9: mxc: vpu: wave6: report the firmware git sha code
LF-10942-1: NXPSEU-269: mxc: vpu: wave6: add a debugfs to get the
firmware log
LF-10942-2: mxc: vpu: wave6: support to reload firmware
fix some coverity issues in v1.3.10
increase some error log levels
fix some coding style in wave6-hw.c
Fix some issues based on v1.3.10
NXPSEU-310: add compatible firmware version
NXPSEU-308: Fix some coverity issues.
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
We use the src_buffered to indicate the drain flag, but if output
streamoff is called during drain, but before eso, then the src_buffered
may be not cleared. after output streamon again, driver may trigger an
eos directly, that's not the expected result.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
add a module parameter to make driver reload firmware without reboot,
it's just for debugging.
Based on wave6 v4l2 driver v1.3.9
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
driver add a debugfs to get firmware log, add a module parameter to
enable the log
Based on wave6 v4l2 driver v1.3.9
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
chipsnmedia use svn to manage the firmware code, so the git sha code is
only valid for nxp released firmware.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
call pm_runtime_put_sync() if fail to try boot.
enhance some error handling in suspend and resume.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
fix some bug in current multi vm supporting, the final multi-vm solution
is to be decided
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
call wave6_vpu_return_buffers() in the end of stop_streaming()
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
only align capture width to 32, otherwise it may fail some cts testcase
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
the max code buffer is supported up to 4M, and make sure there is extra
256K buffer for bss and stack and other sections
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
wait until the state is changed to W6_VCPU_BOOT_TIMEOUT, the register
W6_VCPU_CUR_PC just means the firmware is running, doesn't mean it has
finish the initialization.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
1.add total frames and frame cycle stastics.
2.calculate to fps
3.add this function for gstreamer performance test
4.add divide 0 protection
Based on wave6 v4l2 driver v1.3.9
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
update wave6 v4l2 driver to 1.3.9, the following patches are not
included in it, need to reapply again:
NXPSEU-262: mxc: vpu: wave6: improve code buffer size checking and remap
NXPSEU-261: mxc: vpu: wave6: fix a synchronization problem in wait done
LF-10942-2: mxc: vpu: wave6: support to reload firmware
LF-10942-1: mxc: vpu: wave6: add a debugfs to get the firmware log
LF-10673: mxc: vpu: wave6: add fps statistics
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
update wave6 v4l2 driver to 1.3.8, the following patches are not
included in it, need to reapply again:
LF-11135: mxc: vpu: wave6: decoder report error once firmware report
LF-11095-2: mxc: vpu: wave6: check pointer before reference it
LF-11110: mxc: vpu: wave6: correct the maximum resolution of decoder
LF-11095: mxc: vpu: wave6: decoder initialize default uv data for yuv400
LF-11053: mxc: vpu: wave6: handle decoding error
LF-10942-2: mxc: vpu: wave6: support to reload firmware
LF-10942-1: mxc: vpu: wave6: add a debugfs to get the firmware log
LF-10673-2: arm64: vpu: wave6: add fps statistics
LF-10673: arm64: vpu: wave6: add fps statistics
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Set conformance window encoder parameter if host set CROP region.
Report correct CROP region through g_selection().
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
Tested-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
The error reason of init_seq may be a bitmask, it may report not support
and other error in the same time. driver may ignore the not support
error if the error_reason is not equal to WAVE6_SYSERR_NOT_SUPPORT.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>