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>
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 fix this issue.
Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
when reschange_notified is set, driver will prevent to stream on capture
queue, it likely make the both queue disable case in seek, can report
pollerr unexpectedly.
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>
Fix IMX-3262
GPU hang while the vertex data count is very large in 8mm through splitting
large vertex data draw call.
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
For v4l2 m2m device, there has to be at least one buffer queued on each
queued_list, which means either in driver already or waiting for driver
to claim it and start processing.
hantro_v4l2 is m2m device, but it don't use the v4l2 m2m framework
directly, so just keep it consistent with v4l2 m2m poll. report pollerr
if output queue is empty and capture queue is empry or off.
Tested-by: Xu Mao <mao.xu@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
CL864414 [KERNEL SPACE] [22Q2][IMX-3201]: Simply create a new tracepoint
gpu_work_period to pass Android-14 CTS case GpuWorkTracePointTest. [Ying.Zhang]
This pick VSI
0013-CL864414-KERNEL-SPACE-22Q2-IMX-3201-Simply-create-a-.patch
0018-Fix-license.patch
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
[NXP]: Add a macro of
gcdDISABLE_RS_CLOCK_GATING. By Shiheng.Zhou
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
[6.4.11_NXP]: Fix cl815168.
Move two function declarations out of marco gcdENABLE_TRUST_APPLICATION's
control. [Ying.Zhang]
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
22Q2_NXP: Reallocate virtual
node when weston import capture only process node and don't fill page table
for contigourous pool when enable capture only mode.
Signed-off-by: IPD_SCM_CN <IPD_SCM_CN@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
Few users use the fixed qp mode
open frame level rate control feature by default
default rc mode is CBR
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
ktime_get_real_ts64 can jump backwards due to a leap second update,
NTP adjustment settimeofday() operation from user space.
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
Reviewed-by: Guangliu Ding <guangliu.ding@nxp.com>
Reviewed-by: Yuan Tian <yuan.tian@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>
For the first source change event, set last flag too, as android may
streamon capture before the first source change event. This allows users
to handle source change with consistent behavior
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
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>
Patches for imx-3234 caused vulkan sascha hang regression.
Disable USC reset to fix this regression.
The original fix for imx-3234 will be disabled accordingly.
Fixes: 39df2d1bf8 ("MGS-7524 [#imx-3234] 0004-CL747890-KERNEL-SPACE-6.4.11_22Q2_NXP-Support-USC-lo")
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com>
Tested-by: Yuan Tian <yuan.tian@nxp.com>
This commit fixes the issue that frequency modulation function
cannot be achieved on 8MP.
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
Reviewed by: Guangliu Ding <guangliu.ding@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>
[NXP]: Fix the issue about the
frequency can not be turned. By Shiheng.Zhou
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
[NXP]: Fix the issue that Scale
could not be modulated. By Shiheng.Zhou
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
Avoid kernel panic in wave6_vpu_dec_give_command(), that it may
reference the pointer without checking whether it is NULL.
Besides, fix some coverity isseus introduced by this patch.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Confirmed with chipsnmedia, the maximum resolution of decoder is
4096x2304, not 4096x4096.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
For H264 high prifile yuv400, vpu only write the y data to buffer, won't
write the uv data, but 0 is not the wanted default value, it will make
the image looks green. The wanted default value is 0x80, and it can
make the image looks good.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
driver use request_firmware_nowait() to load firmware asynchronously, if
we remove the vpu module too early, just in loading firmware, then it
may led to kernel panic in loading firmware as some resources has been
freed.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
firmware may report error when it detects error in decoding frame. but
the frame_decoded_flag still may be set, driver may handing the error as
normal decoded frame, then it may led to some unexpected issue.
driver need to check the decoding result before than the
frame_decoded_flag.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Use blit engine and secuirty feature to determine i.MX8MQ/QXP GPU type,
Both chips have CVE-2023-4969 security issue as they support OpenCL local memory with on-chip USC memory.
Fixed this security issue by toggling the GPU security mode to trigger a USC reset during GPU context switch,
VSI validated the second OpenCL process can only read 0s from the USC memory after context switch.
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
VIP doesn't support switch security mode, so remove the switch when it is VIP core.
Signed-off-by: Zhe Pan <zhe.pan@vivantecorp.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
if some display buffer is released by firmware, but it's never used,
we can recycle it directly.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
It's just a protection, the aim is to avoid potential risks that users
do not follow the correct process, for example, user open decoder video
device, and just call streamon(capture) and streamoff(capture), it may
led to kernel panic.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
if firmware is hang, the sleep cmd will fail, we need to set state to
off, then we can reload firmware when power on next time.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Driver will try to initiate a drain of capture queue in dynamic
resolution change, but if user has started drain before that, driver may
clear the drain flag in handling source change, and it may led to
pipeline hang.
We should not clear the drain flag and set eos in handling source
change.
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.
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
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
In some case, the capture buffer may be released directly, but not
displayed, for example, there is CRA frame with
no_output_of_prior_pics_flag set to 1, then firmware will discard all
the remaining dpbs.
Current driver doesn't handle these buffer, the result is these buffer
won't be used any more, then the pipeline may be stalled due to there is
no available capture buffer.
Return these buffers can avoid pipeline hang.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
record and show the error buffer number, enhance the debugging capabilities
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
record the processed buffer number, and show it through the debugfs, if
pipeline hangs, we can simply determine if the problem is with the
driver or the application or the firmware.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
share sram across vms, move the sram node to vpu-ctrl, then different
can get the same sram address.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
wait vcpu boot done after power on, before any operations of encoder or
decoder.
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
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
1.set consumed field before send ENCODE command to VPU
2.optimize some kfree warning
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
Meet kernel NULL pointer dereference in _PutPower.
It is caused by releasing gpu_cooling_device (null pointer) on
7ULP/8ULP while gpu_cooling_device not supported on the two boards.
So we add a null pointer check to gpu_cooling_device.
Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
Signed-off-by: Dandan Sun <dandan.sun@nxp.com>
If streamoff is not called, v4l2_m2m_ctx_release() will call the
stop_streaming callback, and it should be called before instance
destroyed.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
add a debug module parameter to enable some debug log.
add a debugfs for each instance.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
enable runtime pm when creating instance and disable pm runtime when
destroying instance
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
for ls1028a, considering the unsupported GPU frequency adjustment
feature in the current "devfreq_cooling.c" driver, replacing it with
an improved solution within the "gc_hal_kernel_platform_imx.c" GPU
driver became necessary.
in this patch, GPU register as a cooling devices, thermal framework
will auto bind it.
Signed-off-by: Dandan Sun <dandan.sun@nxp.com>
Reviewed by: Guangliu Ding <guangliu.ding@nxp.com>
for imx6 and imx8, considering the unsupported GPU frequency adjustment
feature in the current "devfreq_cooling.c" driver, replacing it with
an improved solution within the "gc_hal_kernel_platform_imx.c" GPU
driver became necessary.
in this patch, GPU register as a cooling devices, thermal framework
will auto bind it.
Signed-off-by: Dandan Sun <dandan.sun@nxp.com>
Reviewed by: Guangliu Ding <guangliu.ding@nxp.com>
imx device cooling driver device_cooling.c is removed, so replace the
expired config CONFIG_DEVICE_THERMAL(device_cooling.c) with the
current used one CONFIG_DEVFREQ_THERMAL(devfreq_cooling.c).
Signed-off-by: Dandan Sun <dandan.sun@nxp.com>
Reviewed by: Guangliu Ding <guangliu.ding@nxp.com>
1.set default value as 30
2.solve rtsp stream can not parser issue
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
1.add ioctl & set open param
2.default value is 1.
3.solve RTSP issue.
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
Firmware can't handle multi cmds in the same time, so driver need to
pause other instance when init_seq
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>