Commit Graph

636 Commits

Author SHA1 Message Date
Ming Qian
b305ce6758 MA-22424-2: mxc: vpu: vc8000e: Use fixed-length types in ioctl parameters
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>
2024-07-02 10:07:52 +09:00
Ming Qian
08d3e59a62 MA-22424-1: mxc: vpu: h1: Use fixed-length types in ioctl parameters
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>
2024-07-02 10:07:51 +09:00
Guangliu Ding
c413b53ce5 MGS-7591-2 [#imx-3270] modify runtime pm in gpu subsystem
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>
2024-07-01 15:58:54 +08:00
Ming Qian
8930b85188 MMFMWK-9372: mxc: vpu: hantro_v4l2: Filter out pollerr in source change
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>
2024-04-28 18:03:22 +09:00
Yuan Tian
e07bf23ca7 MGS-7676 [#imx-2976] 0068-CL891407-KERNEL-SPACE-6.4.11_22Q2_NXP-Limit-the-chip
6.4.11_22Q2_NXP: Limit the chip
 range who supports USC reset function.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-23 15:02:29 +08:00
Yuan Tian
ec73ad3a61 MGS-7676 [#imx-2976] 0034-IMX-3262-CL880253-KERNEL-SPACE-6.4.11-Fix-IMX-3262-G
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>
2024-04-23 15:02:19 +08:00
Yuan Tian
0c39e5ed92 MGS-7676 [#imx-2976] 0013-KERNEL-SPACE-Update-copyright
Update copyright

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-23 15:00:32 +08:00
Ming Qian
fb4dfa9c07 MA-22342: mxc: vpu: hantro_v4l2: report pollerr if both queue are empty
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>
2024-04-23 11:07:33 +09:00
Yuan Tian
0be37d9a9c MGS-7408 [#imx-2976] 0111-CL744345-KERNEL-SPACE-22Q2_NXP-Use-of-EXTRA_CFLAGS-is-
22Q2_NXP: Use of EXTRA_CFLAGS is
 deprecated, use ccflags-y instead

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:20:53 +08:00
IPD_SCM_CN
fdd5b88545 LF-11244-6 [#imx-3234] Pass local memory usage to kernel
CL884364 Pass local memory usage to kernel

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:49 +08:00
IPD_SCM_CN
e7ad8b7c61 LF-11244-5 [#imx-3234] Only need to switch security mode between different processes
CL864472 Only need to switch security mode between different processes.

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:49 +08:00
Yuan Tian
90e63eb75d LF-11244-4 [#imx-3234] bugfix/CVE-2023-4969 becomes invalid
Revert "MGS-7524 [#imx-3234] Enable USC reset when reconstruct context"

This reverts commit 609426ade13312a8072313143fcde64aaf4065c3.

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:49 +08:00
IPD_SCM_CN
99713abba4 LF-11244-3 [#imx-3234] Refine switch security mode
CL851741 Refine switch security mode.

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:49 +08:00
Yuan Tian
6911967952 LF-11244-2 [#imx-3234] Fix CVE 2023 4969 hang regression
shelved patch 823948

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:48 +08:00
Yuan Tian
dee119a7ec LF-11244-1 [#imx-3234] Enable USC reset
Revert "LF-11244 [#ccc] GPU hang in vulkan sascha stress test"

This reverts commit 06d6875852b3190dabfdee06e028113e14f2b9d2.

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:48 +08:00
Jessie Hao
f87ef1b7f1 MA-22201 [#imx-3183] 0013-CL864414-KERNEL-SPACE-22Q2-IMX-3201-Simply-create-a
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>
2024-04-22 12:11:48 +08:00
Guangliu Ding
2946afdd45 MGS-7591 [#imx-3270] Modify CONFIG_PM_RUNTIME version usage issues
Modify CONFIG_PM_RUNTIME version usage issues.

Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
2024-04-22 12:11:48 +08:00
Yuan Tian
2a89b27d7d MGS-7613 [#imx-2976] 0181-KERNEL-SPACE-Update-gc_feature_database.h-to-850347
Update gc_feature_database.h to 850347

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:48 +08:00
Yuan Tian
caacf9c38b MGS-7613 [#imx-2976] 0169-CL844508-KERNEL-SPACE-NXP-Add-a-macro-of-gcdDISABLE_
[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>
2024-04-22 12:11:48 +08:00
Yuan Tian
b7d72a3db5 MGS-7613 [#imx-2976] 0165-CL842730-KERNEL-SPACE-6.4.11_NXP-Fix-cl815168.-Move-
[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>
2024-04-22 12:11:47 +08:00
Yuan Tian
0271a8fba8 MGS-7613 [#imx-2976] 0162-CL834614-KERNEL-SPACE-22Q2_NXP-Fix-remain-build-erro
[22Q2_NXP]: Fix remain build
 errors with kernel 6.7 when turn on -Wmissing-declarations &
 -Wmissing-prototypes. [Ying.Zhang]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:47 +08:00
Yuan Tian
a430245698 MGS-7613 [#imx-2976] 0119-KERNEL-SPACE-Update-gc_feature_database.h-to-815454
Update gc_feature_database.h to 815454

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:47 +08:00
Yuan Tian
02e6aa02c6 MGS-7613 [#imx-2976] 0103-KERNEL-SPACE-Fix-license
[KERNEL SPACE]Fix license

Signed-off-by: IPD_SCM_CN <IPD_SCM_CN@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:47 +08:00
Yuan Tian
7af42808bc MGS-7592 [#imx-3183] 0110-CL804117-KERNEL-SPACE-22Q2_NXP-Reallocate-virtual-no
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>
2024-04-22 12:11:47 +08:00
Yuan Tian
8cb3566d5d MGS-7592 [#imx-3183] 0100-CL819842-KERNEL-SPACE-NXP-Fix-the-issue-that-videos-
[NXP]: Fix the issue that
 videos loop paly meet stuck. By Shiheng.Zhou

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:46 +08:00
Yuan Tian
6ef9702e3f MGS-7592 [#imx-3183] 0097-CL815454-KERNEL-SPACE-NXP-Fix-qnx-build-errors-in-cl
[NXP]: Fix qnx build errors
 in cl815868 and remove some useless extern function declarations.
 [Ying.Zhang]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:46 +08:00
Yuan Tian
800e35c319 MGS-7592 [#imx-3183] 0096-CL815168-USER-SPACE-NXP-Fix-build-break-when-turn-on
[NXP]: Fix build break when
 turn on -Wmissing-declarations & -Wmissing-prototypes. [Ying.Zhang]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:46 +08:00
Yuan Tian
d604f75a77 MGS-7592 [#imx-3183] 0095-CL815168-KERNEL-SPACE-NXP-Fix-build-break-when-turn-
[NXP]: Fix build break when turn on
 -Wmissing-declarations & -Wmissing-prototypes. [Ying.Zhang]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:46 +08:00
Yuan Tian
1447fef383 MGS-7538 [#imx-3183] 0089-CL797373-KERNEL-SPACE-NXP-Add-the-hardware-info.-By-
[NXP]: Add the hardware info. By
 Shiheng.Zhou

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-04-22 12:11:46 +08:00
TaoJiang
79db63ad79 LF-11969: vpu: hantro: open frame rc by default
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>
2024-04-11 12:07:26 +05:30
TaoJiang
d4e40d1a51 LF11696: vpu: wave6: open frame rc by default
Ae hope to open frame level rate control feature by default

Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
2024-04-11 11:47:14 +05:30
Jiyu Yang
cb2961c0e8 MGS-7209 [#imx-3281] fix ktime_get_real_ts64 improper usage
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>
2024-04-07 18:59:37 +09:00
Ming Qian
97d65c042c MA-22235: NXPSEU-280: mxc: vpu: wave6: clear drain flag in output streamoff
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>
2024-04-01 17:12:25 +09:00
Ming Qian
10e15f2b29 LF-11768: NXPSEU-269: mxc: vpu: wave6: report performance statistics
report performance statistics via debugfs.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-04-01 17:12:23 +09:00
Ming Qian
d504a383c1 LF-10942-2: mxc: vpu: wave6: support to reload firmware
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>
2024-04-01 17:12:23 +09:00
Ming Qian
e8ac7f0ae1 LF-10942-1: NXPSEU-269: mxc: vpu: wave6: add a debugfs to get the firmware log
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>
2024-04-01 17:12:14 +09:00
Ming Qian
bfc53e60f7 LF-11686-9: mxc: vpu: wave6: report the firmware git sha code
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>
2024-04-01 17:11:23 +09:00
Ming Qian
cb6fbbb069 LF-11686-8: NXPSEU-261-3: mxc: vpu: wave6: power off if boot fail
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>
2024-04-01 17:11:22 +09:00
Ming Qian
2c21037cc5 LF-11686-7: NXPSEU-261-2: mxc: vpu: wave6: fix some bug in multi vm
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>
2024-04-01 17:11:22 +09:00
Ming Qian
09fb53d628 LF-11686-6: NXPSEU-269-2: mxc: vpu: wave6: return buffers after job finished
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>
2024-04-01 17:11:21 +09:00
Ming Qian
6790f77577 LF-11686-5: NXPSEU-267: mxc: vpu: wave6: support sei recovery flag
support the recovery I frame, otherwise it may be skipped.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-04-01 17:11:21 +09:00
Ming Qian
02c03653cc LF-11686-4: NXPSEU-265: mxc: vpu: wave6: decoder output don't align width to 32
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>
2024-04-01 17:11:11 +09:00
Ming Qian
b561652068 LF-11686-3: NXPSEU-262: mxc: vpu: wave6: improve code buffer size checking and remap
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>
2024-04-01 16:58:19 +09:00
Ming Qian
21b92a1ed6 LF-11686-2: NXPSEU-261: mxc: vpu: wave6: fix a synchronization problem in wait done
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>
2024-04-01 16:58:19 +09:00
TaoJiang
eea80a2358 LF-10673: mxc: vpu: wave6: add fps statistics
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>
2024-04-01 16:58:18 +09:00
Ming Qian
7e37cd53d1 LF-11686: mxc: vpu: wave6: update wave6 v4l2 driver 1.3.9
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>
2024-04-01 16:58:16 +09:00
Ming Qian
a194f6de11 LF-11273: mxc: vpu: wave6: update wave6 v4l2 driver 1.3.8
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>
2024-04-01 16:58:13 +09:00
Ming Qian
3f7cb17fe9 LF-11467: mxc: vpu: hantro_v4l2: set last flag in source change event
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>
2024-04-01 15:21:34 +09:00
TaoJiang
b3aba8ebb7 LF-11398: arm64: vpu: wave6: encoder add crop function
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>
2024-01-25 18:17:01 +08:00
Yuan Tian
1c7edd20b6 LF-11244 [#ccc] GPU hang in vulkan sascha stress test
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>
2024-01-25 16:04:40 +08:00
Yuan Tian
0ab9c2c64d MGS-7538 [#imx-3183] fix shader clk update failure on 8MP
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>
2024-01-17 16:54:38 +08:00
Ming Qian
feee11ecde LF-11135: mxc: vpu: wave6: decoder report error once firmware report unsupport in init_seq
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>
2023-12-27 14:26:04 +09:00
Yuan Tian
97b64729ee MGS-7532 [#imx-3183] 0075-CL792113-KERNEL-SPACE-NXP-Fix-the-issue-about-the-fr
[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>
2023-12-25 11:00:19 +08:00
Yuan Tian
9a783570ce MGS-7532 [#imx-3183] 0072-CL791100-KERNEL-SPACE-22Q2-22Q2_NXP-Set-gpu_class-gc
22Q2 & 22Q2_NXP:Set gpu_class =
 gcvNULL after class_destroy.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-25 11:00:16 +08:00
Yuan Tian
58ef240c56 MGS-7532 [#imx-3183] 0071-CL790725-KERNEL-SPACE-NXP-Fix-the-issue-that-Scale-c
[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>
2023-12-25 11:00:13 +08:00
Yuan Tian
5084a8f8cc MGS-7532 [#imx-3183] 0058-CL779023-KERNEL-SPACE-Merging-CL675236-Fix-build-for
Merging CL675236: Fix build for linux 6.3 [Luca.Wei]

//SW/Rel5x/dev6.4.x/projects.dev/hal/os/linux/kernel/allocator/default/...

to //SW/Rel5x/dev6.4.x/projects.dev_6.4.11_22Q2_NXP/hal/os/linux/kernel/allocator/default/...

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-25 11:00:01 +08:00
Ming Qian
7f9355cf56 LF-11095-2: mxc: vpu: wave6: check pointer before reference it
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>
2023-12-25 11:34:03 +09:00
Ming Qian
1af18ce34a LF-11110: mxc: vpu: wave6: correct the maximum resolution of decoder
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>
2023-12-22 16:02:05 +09:00
Ming Qian
1972417ab5 LF-11095: mxc: vpu: wave6: decoder initialize default uv data for yuv400
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>
2023-12-21 15:50:47 +09:00
Ming Qian
3ee7030847 LF-11077: mxc: vpu: wave6: fix kernel panic in removing vpu module
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>
2023-12-20 11:48:25 +09:00
Ming Qian
69e57193ce LF-11053: mxc: vpu: wave6: handle decoding error
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>
2023-12-19 19:03:38 +09:00
Xianzhong Li
6226a5eae6 MGS-7524 [#imx-3234] Enable USC reset when reconstruct context
Delta state is necessary to reconstruct context after switch

Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
2023-12-17 19:50:05 +08:00
Xianzhong Li
ee6389a7cf MGS-7524 [#imx-3234] Enable USC reset for i.MX8MQ/QXP GPU only
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>
2023-12-17 19:50:05 +08:00
Yuan Tian
57d547ac24 MGS-7524 [#imx-3234] 0018-MGS-7466-imx-3183-IMX-3234-GPU-Security-Issue-regression
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>
2023-12-17 19:50:04 +08:00
Yuan Tian
a3ecc40599 MGS-7524 [#imx-3234] 0017-CL754846-KERNEL-SPACE-6.4.x-6.4.11_NXP-Correct-cl753
6.4.x/6.4.11_NXP: Correct
 cl753480. Fix the power management option query.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-17 19:50:04 +08:00
Yuan Tian
a5f9f8f3a8 MGS-7524 [#imx-3234] 0013-CL753480-KERNEL-SPACE-6.4.x-6.4.11_NXP-Addon-fix-for
6.4.x/6.4.11_NXP: Addon fix for
 cl745295, cl747890.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-17 19:50:04 +08:00
Yuan Tian
4ce2bea05a MGS-7524 [#imx-3234] 0012-CL753471-KERNEL-SPACE-6.4.x-6.4.11_NXP-Disable-reset
6.4.x/6.4.11_NXP: Disable reset
 USC when context switch.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-17 19:50:04 +08:00
Yuan Tian
39df2d1bf8 MGS-7524 [#imx-3234] 0004-CL747890-KERNEL-SPACE-6.4.11_22Q2_NXP-Support-USC-lo
6.4.11_22Q2_NXP: Support USC
 local memory reset by switch security mode.

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2023-12-17 19:50:04 +08:00
Ming Qian
6d38315d47 LF-11019: mxc: vpu: wave6: fix coverity issues
fix some issue reported by coverity scan, such as:
1. Uninitialized scalar variable
2. Out-of-bounds read
3. Negative array index read
4. Forward NULL
5. NULL returns
6. Pass by value
7. Reverse INULL

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2023-12-15 16:25:10 +09:00
Ming Qian
a3ef8ea949 LF-10926-2: mxc: vpu: wave6: recycle the unused capture buffer
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>
2023-12-14 18:52:53 +09:00
Ming Qian
734d4403b5 LF-10972-2: mxc: vpu: wave6: check instance state in stop_streaming()
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>
2023-12-14 18:08:34 +09:00
Ming Qian
6ed435f5ea LF-10794-8: mxc: vpu: wave6: set vpu state to off if fail to sleep firmware
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>
2023-12-14 17:40:09 +09:00
Ming Qian
a00dc5924e LF-10972: mxc: vpu: wave6: don't clear drain flag in handling source change
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>
2023-12-13 14:38:32 +09:00
Ming Qian
05d4d6d63d LF-10942-2: mxc: vpu: wave6: support to reload firmware
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>
2023-12-12 16:36:50 +09:00
Ming Qian
de00f64558 LF-10942-1: mxc: vpu: wave6: add a debugfs to get the firmware log
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>
2023-12-12 16:36:50 +09:00
Ming Qian
35a6006a0b LF-10926: mxc: vpu: wave6: return capture buffer which is released but not displayed
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>
2023-12-11 14:57:47 +09:00
Ming Qian
5ff7cfc027 LF-10923-2: mxc: vpu: wave6: record and show the error buffer number
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>
2023-12-11 14:57:47 +09:00
Ming Qian
6802044208 LF-10923-1: mxc: vpu: wave6: record and show the processed buffer number
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>
2023-12-11 14:57:46 +09:00
Ming Qian
43964add2c LF-10794-7: mxc: vpu: wave6: release firmware after loading firmware
release firmware after loading firmware, avoid memory leak

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2023-12-08 15:56:14 +09:00
Ming Qian
4c91b1ddee LF-10841-1: mxc: vpu: wave6: move sram to vpu-ctrl
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>
2023-12-07 16:31:56 +09:00
Guangliu Ding
6dbd8e63e9 LF-10537 [#imx-3251] Fix unused variable error in new thermal feature
Fix unused variable error in new thermal feature.

Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
2023-12-06 17:10:19 +08:00
TaoJiang
58efe0b503 LF-10858: arm64: vpu: wave6: solve YUV420M input error
test command:gst-launch-1.0 videotestsrc num-buffers=100 ! v4l2h264enc !
v4l2h264dec ! video/x-raw,format=I420 ! v4l2h264enc ! v4l2h264dec !
waylandsink

1.Gstreamer first select pixelformat as V4L2_PIX_FMT_YUV420M,
  then qbuf with 3 planes sharing 1 fd. Encoded file output is wrong.
2.driver need add data_offset when calculate dma adderss.

Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
2023-12-06 14:29:05 +05:30
Ming Qian
012e87144a LF-10794-6: mxc: vpu: wave6: wait vcpu boot done after power on
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>
2023-12-05 16:00:05 +09:00
TaoJiang
01026a378c LF-10673-2: arm64: vpu: wave6: add fps statistics
1.add divide 0 protection

Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
2023-12-04 12:07:11 +05:30
TaoJiang
5cea4dda7e LF-10673: arm64: vpu: wave6: add fps statistics
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>
2023-12-04 12:06:58 +05:30
TaoJiang
4a135e66d8 LF-10810: arm64: vpu: wave6: solve encoder timing issue
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>
2023-12-04 10:51:39 +05:30
Guangliu Ding
10d6cf83d5 MGS-7520 [#imx-3251] Add a null pointer check to gpu_cooling_device
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>
2023-12-01 17:29:58 +08:00
Ming Qian
36bffebd30 LF-10808: mxc: vpu: wave6: avoid init_seq in the same time for multi instance
Don't release lock for waiting init_seq done

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2023-12-01 18:17:29 +09:00
Ming Qian
500da13bc2 LF-10807: mxc: vpu: wave6: release queue before destroy instance
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>
2023-12-01 18:17:29 +09:00
Ming Qian
f9c70a0cde LF-10794-4: mxc: vpu: wave6: Enhanced debugging capabilities
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>
2023-12-01 15:29:13 +09:00
Ming Qian
2899957d5b LF-10794-3: mxc: vpu: wave6: enable runtime pm when creating instance
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>
2023-12-01 15:12:12 +09:00
Ming Qian
3c84075bde LF-10794-1: mxc: vpu: wave6: add vpu-ctrl
add vpu-ctrl to handle global region, and loading firmwware

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2023-12-01 15:12:12 +09:00
Guangliu Ding
cea5a71208 LF-10537 [#imx-3251] [layerscape] refine GPU frequency adjustment feature
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>
2023-11-29 17:04:05 +08:00
Dandan Sun
a517b970f8 LF-10537 [#imx-3251] [imx] refine GPU frequency adjustment feature
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>
2023-11-29 17:04:04 +08:00
Dandan Sun
6c14c05622 LF-10537 remove CONFIG_DEVICE_THERMAL in hantrodec.c
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>
2023-11-29 17:04:00 +08:00
TaoJiang
e1b6045694 lf-10564: arm64: vpu: wave6: set default GOP size
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>
2023-11-29 14:06:32 +05:30
TaoJiang
419b280d1a LF-10564: arm64: vpu: wave6: add repeat header function
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>
2023-11-24 15:23:07 +05:30
Ming Qian
8c9042b182 LF-10696: mxc: vpu: wave6: Pause other instance when init_seq
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>
2023-11-23 19:38:07 +09:00
Dong Aisheng
4ee7464398 Merge branch 'mxc/next' into next
* mxc/next: (519 commits)
  MGS-7343 [#nxp] fix the compile warning
  LF-10253: arm64: vpu : h1: solve encode hang
  MGS-7413 [#nxp] reorder the directory
  LF-10543-8: mxc: vpu: wave6: make sequence of decoder capture buffer monotonically increasing
  LF-10543-7: mxc: vpu: wave6: init seq in a separate task
  ...
2023-11-22 17:04:52 +08:00
Dong Aisheng
9261a8220a Merge remote-tracking branch 'origin/mxc/vpu' into mxc/next
* origin/mxc/vpu: (159 commits)
  LF-10253: arm64: vpu : h1: solve encode hang
  LF-10543-8: mxc: vpu: wave6: make sequence of decoder capture buffer monotonically increasing
  LF-10543-7: mxc: vpu: wave6: init seq in a separate task
  LF-10543-6: mxc: vpu: wave6: make reserved memory optional
  LF-10543-5: mxc: vpu: wave6: avoid firmware alloc fb fail
  ...
2023-11-22 17:04:26 +08:00