Commit Graph

636 Commits

Author SHA1 Message Date
Zhou Peng
90192c5d29 LF-15731: mxc: vpu: wave6: no copyright in one header file
Add copyright for file 'drivers/mxc/vpu/wave6/wave6-trace.h'

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-07-08 20:00:06 +08:00
Jiyu Yang
b1d8a6dd8b LF-4656-1 gpu: disable systrace by default
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>
2025-06-20 11:26:52 +08:00
Jason Liu
ab72b4936f Revert "LF-14286-2: mxc: vpu: wave6: remove the second parameter in __assign_str()"
This reverts commit 55c1e61714.

This commit breaks the build and no need for 6.6 kernel

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-20 11:01:15 +08:00
Zhou Peng
55c1e61714 LF-14286-2: mxc: vpu: wave6: remove the second parameter in __assign_str()
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>
2025-04-22 17:26:58 +08:00
Zhou Peng
a792be88ba MA-23263: mxc: vpu: wave6: Allow 2x2 cropping size for the encoder.
enhance crop feature with 2x2 alignment

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:44 +08:00
Zhou Peng
8e8c10515d LF-14462: mxc: vpu: wave6: Add 'identical size ranges' feature for vpu encoder
Increase W6_MAX_ENC_PIC_HEIGHT from 2304 to 4096

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:34 +08:00
Ming Qian
b33d9ef0f0 MA-23237-2: mxc: vpu: wave6: Support decoding size up to 4096x4096
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>
2025-04-22 17:26:23 +08:00
Ming Qian
d60f271ccc MA-23268-3: mxc: vpu: wave6: Handle colorspace change
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>
2025-04-22 17:26:12 +08:00
Ming Qian
e88de905f5 CARPL-471: mxc: vpu: wave6: Guarantee vpu power state in requiring work
In requiring work, driver need to access register, if it's scheduled too
late, and the instance has been destroyed due to timeout, then it will
led to kernel panic.

====== V4L2DEC: 1.24.0 build on Jul 24 2024 02:25:45. ======
[video] on_pad_added: Found v4l2h264dec element
[  170.658267] SError Interrupt on CPU0, code 0x00000000be000011 – SError
[  170.658279] CPU: 0 PID: 110 Comm: irq/204-vpu_irq Not tainted 6.6.36-lts-next-g5348b0336fb3-dirty #1
[  170.658284] Hardware name: NXP i.MX95 19X19 board (DT)
[  170.658287] pstate: 60400009 (nZCv daif +PAN UAO -TCO -DIT -SSBS BTYPE=-)
[  170.658292] pc : wave6_vpu_ctrl_require_buffer+0x5c/0x150
[  170.658308] lr : wave6_vpu_ctrl_require_buffer+0x118/0x150
[  170.658313] sp : ffff80008398bd20
[  170.658314] x29: ffff80008398bd30 x28: 0000000000000000 x27: 0000000000000000
[  170.658323] x26: ffff8000800f5758 x25: ffff8000800f31c4 x24: 0000000000000000
[  170.658329] x23: ffff800083363010 x22: ffff000081217e80 x21: ffff800083363000
[  170.658334] x20: ffff000081268c80 x19: ffff000081268e10 x18: 0000000000000001
[  170.658340] x17: ffff0003fdfffb10 x16: 0000000000000100 x15: 0000000000000000
[  170.658345] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000352f2f
[  170.658350] x11: 0000000000181000 x10: ffff80009fe01000 x9 : 0000000000000000
[  170.658356] x8 : ffff80008984d000 x7 : 0000000000000000 x6 : 000000000000003f
[  170.658361] x5 : 0000000000000040 x4 : 0000000000000000 x3 : ffff80008106bcf8
[  170.658366] x2 : 0000000000000000 x1 : ffff800084b305f4 x0 : ffff800084b30000
[  170.658374] Kernel panic - not syncing: Asynchronous SError Interrupt
[  170.658376] CPU: 0 PID: 110 Comm: irq/204-vpu_irq Not tainted 6.6.36-lts-next-g5348b0336fb3-dirty #1
[  170.658380] Hardware name: NXP i.MX95 19X19 board (DT)
[  170.658383] Call trace:
[  170.658385]  dump_backtrace+0x90/0xe8
[  170.658395]  show_stack+0x18/0x24
[  170.658400]  dump_stack_lvl+0x48/0x60
[  170.658408]  dump_stack+0x18/0x24
[  170.658413]  panic+0x324/0x380
[  170.658419]  nmi_panic+0x8c/0x90
[  170.658423]  arm64_serror_panic+0x6c/0x78
[  170.658427]  arm64_is_fatal_ras_serror+0x3c/0xac
[  170.658432]  do_serror+0x5c/0x70
[  170.658435]  el1h_64_error_handler+0x30/0x48
[  170.658441]  el1h_64_error+0x64/0x68
[  170.658445]  wave6_vpu_ctrl_require_buffer+0x5c/0x150
[  170.658450]  wave6_vpu_irq_thread+0x68/0x114
[  170.658454]  irq_thread_fn+0x2c/0xa8
[  170.658460]  irq_thread+0x160/0x248
[  170.658466]  kthread+0x110/0x114
[  170.658471]  ret_from_fork+0x10/0x20
[  170.658477] SMP: stopping secondary CPUs
[  170.658486] Kernel Offset: disabled
[  170.658487] CPU features: 0x0,c0000000,40028143,1000721b
[  170.658491] Memory Limit: none
[  170.873278] {}{}[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]{}{}

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>
2025-04-22 17:25:22 +08:00
Ming Qian
31699a5f0b CARPL-467-2: mxc: vpu: wave6: Preallocate some work buffer
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>
2025-04-22 17:25:11 +08:00
Ming Qian
ec0d4d6468 CARPL-467-1: mxc: vpu: wave6: Add delay in read_poll_timeout
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>
2025-04-22 17:24:59 +08:00
Ming Qian
25da9355ba LF-14286: mxc: vpu: wave6: update to driver v1.3.11
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>
2025-04-22 17:24:43 +08:00
Liu Ying
d4c4988333 LF-12723 mxc IPUv3: device: Set ipu_task_thread affinity properly
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>
2024-11-11 14:12:41 +08:00
Ming Qian
c775386112 LF-13169-2: Revert "LF-13169: mxc: vpu: hantro_v4l2: avoid pollerr before sequence header parsed"
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>
2024-10-21 14:46:19 +09:00
Ming Qian
0e79bc1aef LF-13695: mxc: vpu: hantro_v4l2: decoder support display delay
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>
2024-10-17 11:45:44 +09:00
Ming Qian
d95ba73844 LF-13169: mxc: vpu: hantro_v4l2: avoid pollerr before sequence header parsed
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>
2024-10-10 18:29:24 +09:00
Nas Chung
c39e8bb6b3 LF-13473-5: mxc: vpu: wave6: Prevent load firmware in delete module.
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>
2024-10-10 18:29:24 +09:00
Ming Qian
5862ed2020 LF-13473-4: mxc: vpu: wave6: Put power domain before wait done
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>
2024-10-10 18:29:24 +09:00
Ming Qian
c15a1c148d LF-13473-3: mxc: vpu: wave6: Ensure power suppliers be suspended before detach them
The power suppliers are always requested to suspend asynchronously,
dev_pm_domain_detach_list() requires the caller to ensure proper
synchronization of this function with power management callbacks.
otherwise the detach may led to kernel panic, like below:

[ 1457.107934] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000040
[ 1457.116777] Mem abort info:
[ 1457.119589]   ESR = 0x0000000096000004
[ 1457.123358]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 1457.128692]   SET = 0, FnV = 0
[ 1457.131764]   EA = 0, S1PTW = 0
[ 1457.134920]   FSC = 0x04: level 0 translation fault
[ 1457.139812] Data abort info:
[ 1457.142707]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 1457.148196]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 1457.153256]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 1457.158563] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001138b6000
[ 1457.165000] [0000000000000040] pgd=0000000000000000, p4d=0000000000000000
[ 1457.171792] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[ 1457.178045] Modules linked in: v4l2_jpeg wave6_vpu_ctrl(-) [last unloaded: mxc_jpeg_encdec]
[ 1457.186383] CPU: 0 PID: 51938 Comm: kworker/0:3 Not tainted 6.6.36-gd23d64eea511 #66
[ 1457.194112] Hardware name: NXP i.MX95 19X19 board (DT)
[ 1457.199236] Workqueue: pm pm_runtime_work
[ 1457.203247] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 1457.210188] pc : genpd_runtime_suspend+0x20/0x290
[ 1457.214886] lr : __rpm_callback+0x48/0x1d8
[ 1457.218968] sp : ffff80008250bc50
[ 1457.222270] x29: ffff80008250bc50 x28: 0000000000000000 x27: 0000000000000000
[ 1457.229394] x26: 0000000000000000 x25: 0000000000000008 x24: 00000000000f4240
[ 1457.236518] x23: 0000000000000000 x22: ffff00008590f0e4 x21: 0000000000000008
[ 1457.243642] x20: ffff80008099c434 x19: ffff00008590f000 x18: ffffffffffffffff
[ 1457.250766] x17: 5300326563697665 x16: 645f676e696c6f6f x15: 63343a6d726f6674
[ 1457.257890] x14: 0000000000000004 x13: 00000000000003a4 x12: 0000000000000002
[ 1457.265014] x11: 0000000000000000 x10: 0000000000000a60 x9 : ffff80008250bbb0
[ 1457.272138] x8 : ffff000092937200 x7 : ffff0003fdf6af80 x6 : 0000000000000000
[ 1457.279262] x5 : 00000000410fd050 x4 : 0000000000200000 x3 : 0000000000000000
[ 1457.286386] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00008590f000
[ 1457.293510] Call trace:
[ 1457.295946]  genpd_runtime_suspend+0x20/0x290
[ 1457.300296]  __rpm_callback+0x48/0x1d8
[ 1457.304038]  rpm_callback+0x6c/0x78
[ 1457.307515]  rpm_suspend+0x10c/0x570
[ 1457.311077]  pm_runtime_work+0xc4/0xc8
[ 1457.314813]  process_one_work+0x138/0x248
[ 1457.318816]  worker_thread+0x320/0x438
[ 1457.322552]  kthread+0x110/0x114
[ 1457.325767]  ret_from_fork+0x10/0x20

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-10-10 18:29:24 +09:00
Ming Qian
04e192941a LF-13473-2: mxc: vpu: wave6: Release video device before othre resource
need to register video device after other resource is ready, and
release the video device before other related resource, otherwise we may
meet oops in open() or realse() file ops. just like below:

[ 1613.145043] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000218
[ 1613.153833] Mem abort info:
[ 1613.156613]   ESR = 0x0000000096000004
[ 1613.160348]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 1613.165643]   SET = 0, FnV = 0
[ 1613.168685]   EA = 0, S1PTW = 0
[ 1613.171814]   FSC = 0x04: level 0 translation fault
[ 1613.176676] Data abort info:
[ 1613.179544]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 1613.185013]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 1613.190048]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 1613.195351] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000105c2a000
[ 1613.201774] [0000000000000218] pgd=0000000000000000, p4d=0000000000000000
[ 1613.208553] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[ 1613.214801] Modules linked in: v4l2_jpeg wave6(+) wave6_vpu_ctrl [last unloaded: v4l2_jpeg]
[ 1613.223140] CPU: 0 PID: 99207 Comm: v4l_id Not tainted 6.6.36-gd23d64eea511 #66
[ 1613.230435] Hardware name: NXP i.MX95 19X19 board (DT)
[ 1613.235558] pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 1613.242508] pc : _raw_spin_lock_irqsave+0x34/0x8c
[ 1613.247205] lr : v4l2_m2m_cancel_job+0x3c/0x190
[ 1613.251729] sp : ffff800083d2bcb0
[ 1613.255031] x29: ffff800083d2bcb0 x28: ffff000084641d80 x27: 0000000000000000
[ 1613.262155] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[ 1613.269279] x23: ffff00008077c160 x22: ffff00008319d780 x21: 0000000000000000
[ 1613.276403] x20: 0000000000000218 x19: 0000000000000000 x18: 0000000000000000
[ 1613.283527] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[ 1613.290651] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[ 1613.297775] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
[ 1613.304899] x8 : ffff800083d2bd88 x7 : 0000000000000000 x6 : 000000000000003f
[ 1613.312023] x5 : ffff00008558bad0 x4 : ffff000084641d80 x3 : 0000000000000000
[ 1613.319156] x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000218
[ 1613.326280] Call trace:
[ 1613.328722]  _raw_spin_lock_irqsave+0x34/0x8c
[ 1613.333066]  v4l2_m2m_cancel_job+0x3c/0x190
[ 1613.337234]  v4l2_m2m_ctx_release+0x18/0x40
[ 1613.341403]  wave6_vpu_dec_release+0x24/0xe4 [wave6]
[ 1613.346369]  v4l2_release+0xe4/0xec
[ 1613.349853]  __fput+0xb4/0x274
[ 1613.352904]  __fput_sync+0x50/0x5c
[ 1613.356292]  __arm64_sys_close+0x38/0x7c
[ 1613.360201]  invoke_syscall+0x48/0x114
[ 1613.363945]  el0_svc_common.constprop.0+0xc0/0xe0
[ 1613.368642]  do_el0_svc+0x1c/0x28
[ 1613.371944]  el0_svc+0x40/0xe4
[ 1613.374995]  el0t_64_sync_handler+0x120/0x12c
[ 1613.379345]  el0t_64_sync+0x190/0x194
[ 1613.382998] Code: b9000841 d503201f 52800001 52800022 (88e17c02)
[ 1613.389079] ---[ end trace 0000000000000000 ]---
[ 1613.393681] note: v4l_id[99207] exited with irqs disabled
[ 1613.399141] note: v4l_id[99207] exited with preempt_count 1

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-10-10 18:29:23 +09:00
Ming Qian
04024cdebe LF-13473-1: mxc: vpu: wave6: Set video drvdata before register it
the video drvdata should be set before the video device is registered,
otherwise video_drvdata() may return NULL in the open() file ops, and led
to oops like below:

[  310.000223] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000080
[  310.009051] Mem abort info:
[  310.011888]   ESR = 0x0000000096000004
[  310.014888] vpu 4c480000.vpu: wave6_vpu_dec_release: [0] release
[  310.016036]   EC = 0x25: DABT (current EL), IL = 32 bits
[  310.027084]   SET = 0, FnV = 0
[  310.030248]   EA = 0, S1PTW = 0
[  310.033419]   FSC = 0x04: level 0 translation fault
[  310.038377] Data abort info:
[  310.041269]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[  310.046749]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[  310.051805]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[  310.057115] user pgtable: 4k pages, 48-bit VAs, pgdp=000000010a12d000
[  310.063553] [0000000000000080] pgd=0000000000000000, p4d=0000000000000000
[  310.070340] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[  310.076592] Modules linked in: wave6 wave6_vpu_ctrl [last unloaded: v4l2_jpeg]
[  310.076604] CPU: 5 PID: 18156 Comm: v4l_id Not tainted 6.6.36-gd23d64eea511 #66
[  310.076610] Hardware name: NXP i.MX95 19X19 board (DT)
[  310.096220] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  310.096225] pc : wave6_vpu_open_enc+0x7c/0x7f0 [wave6]
[  310.108292] lr : wave6_vpu_open_enc+0x7c/0x7f0 [wave6]
[  310.108306] sp : ffff800087fcba60
[  310.108308] x29: ffff800087fcba60 x28: ffff0000974e0000 x27: ffff800087fcbc40
[  310.108316] x26: 0000000000000000 x25: 0000000000020100 x24: 0000000000000000
[  310.130973] x23: ffff000084f86500 x22: 0000000000000001 x21: ffff000097a94000
[  310.130980] x20: ffff000097a94090 x19: ffff80007a2b5e30 x18: 0000000000000001
[  310.130987] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  310.130993] x14: 0000000000000000 x13: ffff0000808ec025 x12: 00000000003523a0
[  310.131000] x11: 0000000000000000 x10: ffff0003fdffc6f0 x9 : 0000000000000000
[  310.131006] x8 : 0000000000040dc0 x7 : 0000000000000006 x6 : ffff80037c27c000
[  310.131012] x5 : ffff800087fcb9e0 x4 : 00000000ffffffff x3 : ffff00009770c4a0
[  310.131019] x2 : ffff00009770c080 x1 : ffff0000974e0000 x0 : 0000000100000000
[  310.131026] Call trace:
[  310.131028]  wave6_vpu_open_enc+0x7c/0x7f0 [wave6]
[  310.195167]  v4l2_open+0x7c/0x11c
[  310.195178]  chrdev_open+0xbc/0x208

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-10-10 18:29:23 +09:00
TaoJiang
820ff45096 LF-13605: sync bounce buffer
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>
2024-10-08 14:30:56 +05:30
Guangliu Ding
a330624467 MGS-7834 [#imx-3270] refine runtime pm feature 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
request/release high bus freq when GPU work/idle.

Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
2024-10-08 14:18:35 +08:00
Guangliu Ding
5e2120623f LF-13259 [#imx-3270] Revert "MGS-7591-2 [#imx-3270] modify runtime pm in gpu subsystem"
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>
2024-08-22 16:15:10 +08:00
jiajia Qian
d9cc39a418 MGS-7802 [#imx-3183] 0027-CL939971-KERNEL-SPACE-6411_nxp-EGL-Add-support-for-E
Add support for
 "EGL_EXT_device_enumeration" and "EGL_EXT_platform_device".

Signed-off-by: jiajia Qian <jiajia.qian@nxp.com>
2024-07-30 14:10:59 +08:00
jiajia Qian
c90ad4765b MGS-7781 [#imx-2976] 0094-KERNEL-SPACE-Update-gc_feature_database.h-to-929381
Update gc_feature_database.h to 929381

Signed-off-by: jiajia Qian <jiajia.qian@nxp.com>
2024-07-30 14:10:59 +08:00
Yuan Tian
43d406ef0d MGS-7676 [#imx-2976] 0072-KERNEL-SPACE-Update-gc_feature_database.h-to-891778
Update gc_feature_database.h to 891778

Signed-off-by: Yuan Tian <yuan.tian@nxp.com>
2024-07-30 14:10:58 +08:00
Ming Qian
c81f76818d MA-22670: mxc: vpu: wave6: decoder report correct color info
Fix a mistake that decoder always report default color info.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-07-23 14:21:32 +09:00
Ming Qian
33494653cd LF-12975-3: mxc: vpu: wave6: improve wave6 vpu pause
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>
2024-07-22 14:55:15 +09:00
Ming Qian
820124db12 LF-12975-2: mxc: vpu: wave6: init seq in decoder's m2m job instead of workqueue
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>
2024-07-22 14:55:09 +09:00
Ming Qian
76955a8b9f LF-12975-1: mxc: vpu: wave6: fix a bug that driver may clear all buffers after sleep
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>
2024-07-22 14:55:04 +09:00
TaoJiang
857084dff4 LF-12936: arm64: vpu: wave6: slove wait loading fw timeout
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>
2024-07-17 11:35:22 +05:30
Hui Wang
89c1f41cc2 MA-22433 [#imx-3183] 0005-CL893434-KERNEL-SPACE-22Q2-IMX-3201-add-data-for-gpu
CL893434 [KERNEL SPACE] [22Q2][IMX-3201]: add data for gpu_work_period. [Ying.Zhang]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Hui Wang <hui.wang_7@nxp.com>
2024-07-17 15:38:27 +08:00
Hui Wang
5b082625a7 MA-22404 [#imx-3183] 0058-CL918820-KERNEL-SPACE-NXP-Fix-unmapped-address-issue
CL918820 [KERNEL SPACE] [NXP]: Fix unmapped address issue when wrapUserMemory. [Shiheng.Zhou]

Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Hui Wang <hui.wang_7@nxp.com>
2024-07-17 15:38:27 +08:00
TaoJiang
6f03c84a8c LF-12900: vpu: iwave6: Separated encoder parameter for each codec
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>
2024-07-15 15:12:44 +05:30
TaoJiang
256ca5b4b9 MMFMWK-9397: arm64: wave6: remove level interface
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>
2024-07-15 10:55:40 +05:30
Ming Qian
333d432542 LF-12867: mxc: vpu: wave6: Don't register too many frame buffer one time
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>
2024-07-15 11:33:49 +09:00
Ming Qian
106b8dfd59 LF-12866-2: mxc: vpu: wave6: Get clk rate for each vpu job
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>
2024-07-15 11:33:49 +09:00
Mihai Despotovici
917c91a786 LF-12523: vpu: wave6: passive cooling solve checkpatch errors
Signed-off-by: Mihai Despotovici <mihai.despotovici@nxp.com>
2024-07-04 12:13:58 +03:00
Mihai Despotovici
cb21a45f1d LF-12523: vpu: wave6: add passive cooling
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>
2024-07-04 10:21:25 +03:00
Mihai Despotovici
22c26a77e8 LF-12523: vpu: wave6: Add pause support for the VPU entities
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>
2024-07-04 10:21:25 +03:00
TaoJiang
038bfb6ffb LF-12805: vpu: wave6: Add profile/level v4l2 ctrls for decoder
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>
2024-07-03 07:24:16 +05:30
Ming Qian
b491229a4e LF-12695: mxc: vpu: wave6: Report the average QP of current encoded frame
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>
2024-07-02 10:08:01 +09:00
Zhou Peng
392ef2705b LF-12605: mxc: vpu: wave6: update to driver v1.3.10
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>
2024-07-02 10:07:57 +09:00
Ming Qian
166bdb2afd LF-12804: mxc: vpu: hantro_v4l2: filter out unapplicable ctrl
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>
2024-07-02 10:07:57 +09:00
Ming Qian
09840a7365 LF-12740-2: mxc: vpu: hantro_v4l2: fix some coverity issues
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>
2024-07-02 10:07:56 +09:00
Ming Qian
89132a55ab LF-12740: mxc: vpu: hantro_v4l2: 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-07-02 10:07:55 +09:00
Ming Qian
de80eb0b4d LF-12696: mxc: vpu: hantro_v4l2: Report the average QP of current encoded frame
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>
2024-07-02 10:07:54 +09:00
Ming Qian
f59f640060 MA-22424-4: mxc: vpu: 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:53 +09:00
Ming Qian
0babf9a287 MA-22424-3: mxc: vpu: hantro_845: 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