this was introduced in MGS-6394 imx-2620, to support trace-cmd
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
(cherry picked from commit 05c19f3b781dc0101275a3f5707492f66f4ee8e8)
Change-Id: Ibd70ff1c8d8efad998ca21b5c88df2fc54ed4c16
Reviewed-by: jiajia Qian <jiajia.qian@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
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>
The ipu_task_thread thread ran by kthread_run() could be excuted
before kthread_run() returns especially when 'nosmp' or 'maxcpus=1'
kernel bootup parameters are used. So, in this case, the thread[0]
or thread[1] entries in struct ipu_soc are not yet set before
ipu_task_thread() references them to set thread affinity, hence a
NULL pointer de-referencing issue happens. Fix this by referencing
*current* task in ipu_task_thread() instead of the uninitialized
thread[0] or thread[1] entries.
This fixes an old bug introduced by the below commit in linux-imx:
commit 0d36f8226d22 ("ENGR00175724-2 IPU: change ipu_device thread
process mode to interrupt mode.")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
This reverts commit d95ba73844.
This workaround may fail some android case, the proper solution is that
parse drop the first Non-I frame in the beginning.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Use v4l2 ctrl V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE and
V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY to instead of private ctrl id
V4L2_CID_DIS_REORDER.
The range of V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY is [0, 0]
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
v4l2 m2m will report pollerr if both queue are off or empty,
before sequence header parsed, it's likely that the capture queue is not
on, if the first buffer doesn't contain sequence header, the output
queue may be empty if the buffer is consumed before more buffers queued,
then report pollerr and exit unexpectedly.
The beffer solution is that the parser can drop the non-I frames before
the first IDR frame.
This patch is a workaround only for hantro v4l2, as the driver implement
its own poll callback. that driver only report pollerr for both queue
empty case after the initial sequence header parsed.
Tested-by: Hou Qi <qi.hou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@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>
Boards with gpu subsystem, such as 8MP, have gpu device and gpu2d,
gpu3d sub-devices. gpu2d and gpu3d devices have enabled runtime pm
while gpu device not. But gpu runtime pm suspend and resume callbacks
are binded to gpu device, which leads to gpu runtime pm callback
not working.
So we enable runtime pm of gpu device in gpu subsystem to
request/release high bus freq when GPU work/idle.
Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
It's wrong to request/release high bus freq when GPU probe/remove.
Instead, we need to request/release high bus freq when GPU work/idle.
So we revert this patch to avoid ddrc freq can't enter low bus mode.
This reverts commit c413b53ce5.
Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
Reviewed-by: Jacky Bai <jacky.bai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@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>
some ctrl is only applicable for certain format, if the format is not
supported by vpu hardware, just filter out it.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
there are some coverity issues found in hantro_v4l2, try to fix them
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@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>
To support 32bit application, we should use fixed-length types in ioctl
parameters, specifically avoid using the type long and unsigned long.
remove some unused ioctl cmd.
clear some building warning.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
To support 32bit application, we should use fixed-length types in ioctl
parameters, specifically avoid using the type long and unsigned long.
remove some unused ioctl cmd.
clear some building warning.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>