Commit Graph

35866 Commits

Author SHA1 Message Date
Robert Chiras
3b2aeb9e87 LF-14443: media: imx8-isi: Fix tearing on 8QXP
When fixing the tearing on 8QM, I used the same value for 8QXP also, but
the ISI IP on 8QXP is a little bit different from 8QM, so revert back
the buf_active_reverse to its initial value of 'false'.

Fixes: 4dc2e71fee ("LF-13924: media: imx8-isi: Fix tearing of 8QM")

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-01-27 21:46:31 +08:00
Robert Chiras
b3cd39037c LF-13697-8: media/i2c: max9286: fix disable_streams
When a disable_streams is called with less streams than the currently
enabled ones, all the streams (from camera modules) stops sending data.
Also, when starting random individual cameras (not all at once), there
is no stream coming from the deserializer.
So, in order to fix this, start all the cameras at once, no matter the
streams are requested for enable.
Also, refactored the enable_streams/disable_streams, since they shared
the same similar code for enabling cameras.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-12-21 08:05:42 +08:00
Guoniu Zhou
d34044f29f LF-14245: media: ap1302: Fix kernel dump issue when do driver insmod/rmmod
Rename ap1302 firmware name to make ap1302 load firmware fail and
then do insmod/rmmod ap1302.ko, kernel will dump when insmod the
driver at second time.

The reason is that ap1302 driver will register device for its sensor,
but don't unregister them when driver module unload.

[   71.398737] sysfs: cannot create duplicate filename '/devices/platform/soc/42000000.bus/42530000.i2c/i2c-2/2-003c/2-003c-ar0144.0'
[   71.410559] CPU: 5 UID: 0 PID: 615 Comm: insmod Not tainted 6.12.3-g31e317b07e5e #149
[   71.418394] Hardware name: NXP i.MX95 19X19 board (DT)
[   71.423533] Call trace:
[   71.425976]  dump_backtrace.part.0+0xd4/0xe0
[   71.430265]  show_stack+0x18/0x30
[   71.433593]  dump_stack_lvl+0x60/0x80
[   71.437268]  dump_stack+0x18/0x24
[   71.440596]  sysfs_warn_dup+0x64/0x80
[   71.444270]  sysfs_create_dir_ns+0xf4/0x120
[   71.448465]  kobject_add_internal+0x98/0x260
[   71.452738]  kobject_add+0x9c/0x108
[   71.456230]  device_add+0xc4/0x7a0
[   71.459645]  device_register+0x20/0x30
[   71.463398]  ap1302_probe+0x350/0xf4c [ap1302]
[   71.467861]  i2c_device_probe+0x19c/0x350
[   71.471883]  really_probe+0xbc/0x2bc
[   71.475471]  __driver_probe_device+0x78/0x120
[   71.479839]  driver_probe_device+0x3c/0x154
[   71.484033]  __driver_attach+0x90/0x1a0
[   71.487881]  bus_for_each_dev+0x7c/0xe0
[   71.491729]  driver_attach+0x24/0x30
[   71.495317]  bus_add_driver+0xe4/0x208
[   71.499078]  driver_register+0x68/0x124
[   71.502927]  i2c_register_driver+0x48/0xcc
[   71.507026]  ap1302_i2c_driver_init+0x20/0x1000 [ap1302]
[   71.512356]  do_one_initcall+0x60/0x1d4
[   71.516195]  do_init_module+0x5c/0x21c
[   71.519957]  load_module+0x18c8/0x1ec0
[   71.523709]  init_module_from_file+0x88/0xcc
[   71.527982]  __arm64_sys_finit_module+0x1c0/0x324
[   71.532688]  invoke_syscall+0x48/0x104
[   71.536449]  el0_svc_common.constprop.0+0xc0/0xe0
[   71.541164]  do_el0_svc+0x1c/0x28
[   71.544492]  el0_svc+0x30/0xcc
[   71.547551]  el0t_64_sync_handler+0x120/0x12c
[   71.551910]  el0t_64_sync+0x190/0x194
[   71.555955] kobject: kobject_add_internal failed for 2-003c-ar0144.0 with -EEXIST, don't try to register things with the same name in the same directory.
[   71.569757] ap1302 2-003c: Failed to register device for sensor 0
[   71.575903] ------------[ cut here ]------------
[   71.580549] refcount_t: underflow; use-after-free.
[   71.585426] WARNING: CPU: 5 PID: 615 at lib/refcount.c:28 refcount_warn_saturate+0xf4/0x144
[   71.593807] Modules linked in: ap1302(+) [last unloaded: ap1302]
[   71.599842] CPU: 5 UID: 0 PID: 615 Comm: insmod Not tainted 6.12.3-g31e317b07e5e #149
[   71.607672] Hardware name: NXP i.MX95 19X19 board (DT)
[   71.612804] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   71.619771] pc : refcount_warn_saturate+0xf4/0x144
[   71.624572] lr : refcount_warn_saturate+0xf4/0x144
[   71.629374] sp : ffff800087e2b6e0
[   71.632684] x29: ffff800087e2b6e0 x28: 0000000000000000 x27: ffff800081cd8190
[   71.639843] x26: 0000000000000000 x25: 00000000ffffffef x24: ffff000081a66820
[   71.646993] x23: ffff000081456080 x22: ffff80007a227be0 x21: ffff000081456838
[   71.654143] x20: ffff000081456080 x19: ffff000081caa000 x18: 0000000000000006
[   71.661293] x17: 6920656d616e2065 x16: 0000000000000000 x15: ffff800087e2b29f
[   71.668443] x14: ffff800081fd4b28 x13: 2e656572662d7265 x12: 7466612d65737520
[   71.675593] x11: ffff800081fd4b28 x10: 00000000000002e7 x9 : ffff80008202cb28
[   71.682743] x8 : 0000000000017fe8 x7 : 00000000fffff000 x6 : ffff80008202cb28
[   71.689893] x5 : ffff0003fdfd4308 x4 : 0000000000000000 x3 : 0000000000000000
[   71.697043] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00009475e780
[   71.704194] Call trace:
[   71.706638]  refcount_warn_saturate+0xf4/0x144
[   71.711092]  kobject_put+0x110/0x120
[   71.714680]  put_device+0x14/0x30
[   71.718008]  ap1302_cleanup+0x38/0x80 [ap1302]
[   71.722480]  ap1302_probe+0xa60/0xf4c [ap1302]
[   71.726943]  i2c_device_probe+0x19c/0x350
[   71.730964]  really_probe+0xbc/0x2bc
[   71.734553]  __driver_probe_device+0x78/0x120
[   71.738920]  driver_probe_device+0x3c/0x154
[   71.743115]  __driver_attach+0x90/0x1a0
[   71.746963]  bus_for_each_dev+0x7c/0xe0
[   71.750811]  driver_attach+0x24/0x30
[   71.754399]  bus_add_driver+0xe4/0x208
[   71.758160]  driver_register+0x68/0x124
[   71.762008]  i2c_register_driver+0x48/0xcc
[   71.766116]  ap1302_i2c_driver_init+0x20/0x1000 [ap1302]
[   71.771446]  do_one_initcall+0x60/0x1d4
[   71.775294]  do_init_module+0x5c/0x21c
[   71.779056]  load_module+0x18c8/0x1ec0
[   71.782809]  init_module_from_file+0x88/0xcc
[   71.787081]  __arm64_sys_finit_module+0x1c0/0x324
[   71.791787]  invoke_syscall+0x48/0x104
[   71.795548]  el0_svc_common.constprop.0+0xc0/0xe0
[   71.800263]  do_el0_svc+0x1c/0x28
[   71.803591]  el0_svc+0x30/0xcc
[   71.806650]  el0t_64_sync_handler+0x120/0x12c
[   71.811010]  el0t_64_sync+0x190/0x194
[   71.814677] ---[ end trace 0000000000000000 ]---
[   71.819653] ap1302 2-003c: probe with driver ap1302 failed with error -17

Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-12-19 11:54:13 +08:00
Guoniu Zhou
efee984ffb LF-14224: media: ov5640: Implement V4L2 subdev .get_frame_desc callback
Implement V4L2 subdev .get_frame_desc callback for OV5640 driver to
fix bellow warning message from downstream subdev(imx8mq-mipi-csi2
in this case).

[ 1995.949885] imx8mq-mipi-csi2 2daf0000.csi: Remote sub-device on pad 1 should implement .get_frame_desc! Forcing VC = 0 and DT = 1e

Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-12-19 11:54:12 +08:00
Robert Chiras
c2c67c4468 LF-13948-7: media: imx8mq-mipi-csi2: add remote_pad
Currently, the remote_pad is not stored correctly, causing
get_frame_desc to be called on the wrong remote pad.
This patch stores the remote pad on either link_setup (if the link is
manually created) or on notify_bound, when the link will be
automatically created.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2024-12-18 19:37:21 +02:00
Robert Chiras
f4d9334b98 LF-13948-5: media: imx8mq-mipi-csi2: fix get_fmt with streams
Currently, the get_fmt does note care about the stream received on the
format, so it only set the format on stream 0. Fix this in order to be
able to set the format on all the exposed streams.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-18 14:29:52 +02:00
Robert Chiras
b0f17aa9e6 LF-13948-4: media/i2c: rdacm20: add get_frame_desc
Implement the get_frame_desc operation, in order to allow the camera
module to propagate the frame descriptor along the pipeline.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-18 14:29:52 +02:00
Robert Chiras
4f24f6b6d6 LF-13948-3: media/i2c: max9286: add support for streams
Add support for streams, so that each individual serializer connected to
this device will be represented as a stream on the source pad.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-18 14:29:52 +02:00
Laurentiu Palcu
a14906f040 LF-13948-2: media/i2c: rdacm20: add new controls to make libcamera happy
These controls are actually needed by libcamera. So, add them.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-18 14:29:52 +02:00
Laurentiu Palcu
8a7d09a664 LF-13948-1: media/i2c/rdacm20: add support for VIDIOC_SUBDEV_ENUM_FRAME_SIZE ioctl
Even though the current driver supports only one mode, add support for
the aforementioned ioctl so that userspace apps/libraries, like
libcamera, can use it.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-18 14:29:52 +02:00
Ming Qian
170abf74ca LF-13889-2: media: amphion: Add a frame flush mode for decoder
The amphion decoder will pre-parse 3 frames before decoding the first
frame. If we append a flush padding data after frame, the decoder
will finish parsing and start to decode when the flush data is parsed.
It can reduce the decoding latency.
In the past, we only enable this mode when the display delay is set to
0. But we still can enable this mode without changing the display order,
so we add a frame_flush_mode parameter to enable it.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-12-18 17:28:53 +09:00
Ming Qian
7dc9dcc4c7 LF-13889-1: media: amphion: Support display delay for Hevc format
The firmware v1.9.0 supports the display delay 0 for hevc format,
then driver can enable this feature

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-12-18 17:28:53 +09:00
Alice Yuan
4873c56a79 LF-14225-1: media: mipi csi: remove iMX8MM local mipi csi support
As the iMX8MM camera switch to community mipi csi, so drop local iMX8MM
mipi csi support.

Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-17 18:34:09 +08:00
Zhipeng Wang
7977ef2df2 MA-23229 media: imx-parallel-csi: Fix build error
error log:
drivers/media/platform/nxp/imx-parallel-csi.c:1002:44: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
 1002 |                 dev_err(dev, "Failed to get regs: %d\n", ret);

Change-Id: Ia0bcbbd7ee1aa1512ef557db8c2254291456bc5f
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
Reviewed-by: Alice Yuan <alice.yuan@nxp.com>
2024-12-17 18:43:55 +09:00
Laurentiu Palcu
a66027888c LF-14222-2 media/i2c: ox03c10: introduce standard controls
This adds standard controls for exposure, analogue gain and digital gain
which will temporarily work in parallel with the custom ones.
Eventually, the custom controls will be removed and only the standard
ones will be used.

The new controls, however, needs a complicated distribution function
that takes all 3 user provided values of exposure, analogue gain and
digital gain as inputs and computes the proper values that will be
written to the sensor registers.

In order to make this process a little more efficient and avoid writing
the same registers 3 times, add a caching mechanism that will avoid
writing a register if its value didn't change.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2024-12-17 08:03:15 +00:00
Laurentiu Palcu
890aa6fbbc LF-14222-1 media/i2c: ox03c10: add a few helper functions
Add group-hold helper functions for the exposure and gain setting
routines to prepare for the next patches where we need to be able to set
exposure and gains within one single group-hold.

Also, only use group-hold 0 for all operations since the controls are
serialized anyway.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2024-12-17 08:03:15 +00:00
Alice Yuan
c20750df6d LF-13978-2: media: staging/imx7: recovery csi bridge from base address change error
When csi bridge met error interrupt base address change error,
recovery the csi bridge from the error status and skip broken frames.

Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-17 14:30:36 +08:00
Guoniu.zhou
9f67847ab1 LF-13106: media: imx-csi-formatter: Fix kernel oops issue
Fix kernel oops issue when capture without pipeline setup, log
as bellow:

[   65.185151] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[   65.217211] CPU: 2 PID: 730 Comm: v4l2-ctl Not tainted 6.6.36-g7bb0a8c6ab3d #31
[   65.224506] Hardware name: NXP i.MX95 19X19 board (DT)
[   65.229635] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   65.236579] pc : formatter_subdev_enable_streams+0xb0/0x22c
[   65.242143] lr : formatter_subdev_enable_streams+0x188/0x22c
[   65.247794] sp : ffff80008576b940
[   65.251096] x29: ffff80008576b940 x28: ffff000085b3e180 x27: ffff0000806844b0
[   65.258220] x26: 0000000000000002 x25: ffff000080684480 x24: 0000000000000001
[   65.265344] x23: ffff000080f37010 x22: 0000000000000000 x21: ffff00008442cae0
[   65.272468] x20: ffff0000810e3498 x19: ffff0000810e3480 x18: ffffffffffffffff
[   65.279592] x17: 6d6920646c756f68 x16: 7320312064617020 x15: 6e6f206563697665
[   65.286724] x14: 642d627573206574 x13: ffff800082091528 x12: 000000000000081c
[   65.293848] x11: 00000000000002b4 x10: ffff8000820e9528 x9 : 0000000000000000
[   65.300972] x8 : ffff80008576b7e4 x7 : 0000000000000000 x6 : ffff000080f37190
[   65.308096] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[   65.315220] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff8000816e7000
[   65.322345] Call trace:
[   65.324781]  formatter_subdev_enable_streams+0xb0/0x22c
[   65.329997]  v4l2_subdev_enable_streams+0xe8/0x26c
[   65.334781]  mxc_isi_crossbar_enable_streams+0x12c/0x1d0
[   65.340085]  v4l2_subdev_enable_streams+0xe8/0x26c
[   65.344869]  mxc_isi_pipe_enable+0x204/0x2ac
[   65.349124]  mxc_isi_vb2_start_streaming+0xa0/0xe4
[   65.353908]  vb2_start_streaming+0x68/0x15c
[   65.358086]  vb2_core_streamon+0xf8/0x1bc
[   65.362081]  vb2_streamon+0x18/0x64
[   65.365565]  mxc_isi_video_streamon+0x28c/0x314
[   65.370080]  v4l_streamon+0x24/0x30
[   65.373564]  __video_do_ioctl+0x32c/0x3f8
[   65.377568]  video_usercopy+0x2c8/0x658
[   65.381399]  video_ioctl2+0x18/0x24
[   65.384883]  v4l2_ioctl+0x40/0x60
[   65.388194]  __arm64_sys_ioctl+0xac/0xf0
[   65.392111]  invoke_syscall+0x48/0x114
[   65.395855]  el0_svc_common.constprop.0+0xc0/0xe0
[   65.400552]  do_el0_svc+0x1c/0x28
[   65.403863]  el0_svc+0x40/0xe4
[   65.406914]  el0t_64_sync_handler+0x120/0x12c
[   65.411264]  el0t_64_sync+0x190/0x194
[   65.414916] Code: a8c57bfd d50323bf d65f03c0 f0004320 (39401085)
[   65.420998] ---[ end trace 0000000000000000 ]---

Reproduce step:
  Run command as bellow after system boot.
  $ v4l2-ctl -v width=1920,height=1080,pixelformat=YUYV --stream-mmap

The reason is that it will try to get data type index by searching map
between data type and its index when start capture, but the data type
is missing by default if no pipepline setup. So initialize the data type
to default value aligned to subdev format.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-12-13 10:09:11 +08:00
Aymen Sghaier
297c5cdd7e ILIE-23: media: nxp: neoisp: Add HDR inputs support
Current driver handles only input0 pad with its decompression block, and
hdr merge is unused.

This patch adds input1 pad handling and enables hdr merge block to offer
the ability of processing HDR sensors.

Reviewed-by: Alexi Birlinger <alexi.birlinger@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2024-12-12 19:36:52 +01:00
Aymen Sghaier
3436d9abb9 ILIE-173: media: nxp: neoisp: Add monochrome support
Current driver supports only raw Bayer input formats while hardware block
supports monochrome input as well.

This patch enables monochrome input support.

Reviewed-by: Alexi Birlinger <alexi.birlinger@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2024-12-12 19:29:30 +01:00
Alexi Birlinger
47595b5d7d ILIE-154: media: nxp: neoisp: Update try_fmt to adapt color space configuration
In try_fmt function the color space selection has been added
depending on the incoming configuration from user space.
It selects a valid colorspace by its name or a default one if
incoming configuration is not appropriate. Only default transfer
function, encoding and quantization are supported.

GCM unit uses the configuration from the color space to
define the related registers accordingly.

Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
Reviewed-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2024-12-12 09:58:07 +01:00
Jason Liu
e5260cd457 This is the 6.12.2 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdRpN0ACgkQONu9yGCS
 aT4gGQ//aGtoYKT8ddzsgUEDMiQIYtC28ysvD5MTEq/zZdbOEcSA8uvrlhVJ43i0
 3MK71u307hrmLpd7c4kUuxi5ljLHJysYAAWSo3qEF+MWitdZ/1gEKKai01ZVNbrb
 Zrglwexn4vMkRrXdAzKrM0QJza0LZOASKjFveLOH+UstqeL/PPF2m+9Z4zBdEo4D
 fEPRHlCD1uvxg7X8y6Cb9A/nfyADhOl4CTSQwOy1z2y1YUZGI4uOhDooyj4D+mVO
 vA9g1MQmeQIgwJIXhTkplN/tWPileAszSR1I/Iu/wRy9hrEaB4O+mmBgXXKUpSVS
 2fZawQxCW4x2GzVp93C2HwmWa3Zjs+fpKL0RB7kh/C0MVi6JGH47IMo3aDxGdvdW
 HdKDVTPx4R7Df38KbLh8xaySlnWdkzaEoFmUc21PkBFYkJUAVBCedAj2oymk/+u3
 9hpcPLESzwVusrKcI3OPXHOrj8Oa5f6vhaG85pdd6H7v7BWPR+RXj5O7lpXZY/wU
 rBnnaXA0xBOqgeW59XOK2x6NJCWYawyIZI/lJJPTxOdiWjumTfI1sAvV3jEMjEIt
 Vskx9axwYZr0Yl3pEMKYCfUzCgJW2yN8d1smRrJgpO5YwM8PKPghYw5NdRMwPbWv
 0EZR5YSW9izA2q/lX2H31adU2srDYGxSN2JGHY0olr/5Anu5UFA=
 =N1Cq
 -----END PGP SIGNATURE-----

Merge tag 'v6.12.2' into lf-6.12.y-latest

This is the 6.12.2 stable release

* tag 'v6.12.2': (819 commits)
  Linux 6.12.2
  block: don't verify IO lock for freeze/unfreeze in elevator_init_mq()
  block: always verify unfreeze lock on the owner task
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

 Conflicts:
	drivers/clk/imx/clk-fracn-gppll.c
	drivers/clk/imx/clk-lpcg-scu.c
	drivers/edac/fsl_ddr_edac.c
	drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
	drivers/pwm/pwm-imx27.c
	drivers/usb/host/xhci.h
2024-12-06 19:43:50 +08:00
Dong Aisheng
818f3ba437 drivers: make all local platform_driver::remove() return void
0edb555a65 ("platform: Make platform_driver::remove() return void")

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2024-12-06 18:24:07 +08:00
Dong Aisheng
ad54e1a0cb Merge branch 'pxp/next' into next
* pxp/next: (54 commits)
  LF-13705-4 dma: pxp_dma_v3: Fix Coverity issues
  LF-13705-3 media: pxp_device: Fix Coverity issue
  LF-13705-1 media: mxc: pxp_v4l2: Fix Coverity issue
  LF-9755 dma: pxp_dma_v3: fix typo causing function break
  LF-9509: dma: pxp_dma_v3: fix dereference after null check issue
  ...
2024-12-06 18:21:40 +08:00
Dong Aisheng
91960b5ec7 Merge branch 'mxc/next' into next
* mxc/next: (750 commits)
  MGS-7935 [#imx-3183] 0121-CL1002665-KERNEL-SPACE-NXP-Update-previous-cl-100220
  LF-13727 [#ccc] fix Bytes alignment issue of gpu video memory node
  MGS-7950 [#imx-3361] Coverity: fix free of array-typed value
  MGS-7915 gpu: Add shader and tiler utilization in gputop
  LF-13854: arm64: vpu: vsi: prevent invalid device
  ...
2024-12-06 18:21:33 +08:00
Dong Aisheng
91e83d89cc Merge branch 'capture/next' into next
* capture/next: (422 commits)
  LF-13267: media: nxp: imx8-isi: check streaming status in streamon()
  LF-13697-7: media: imx8mq-mipi-csi2: Add support for streams
  LF-13697-6: media: dt-bindings: nxp,imx8mq-mipi-csi2: Add new property
  LF-13697-5: media: nxp: imx8mq-mipi-csi2: Add support for i.MX8QM
  LF-13697-4: media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings
  ...
2024-12-06 18:21:12 +08:00
Dong Aisheng
ebc6e62922 Merge remote-tracking branch 'origin/mxc/vpu' into mxc/next
* origin/mxc/vpu: (270 commits)
  LF-13854: arm64: vpu: vsi: prevent invalid device
  LF-13169-2: Revert "LF-13169: mxc: vpu: hantro_v4l2: avoid pollerr before sequence header parsed"
  LF-13695: mxc: vpu: hantro_v4l2: decoder support display delay
  LF-13681: arm64: virtio video: adjust 6.12 version
  LF-12399: swiotlb-xen: solve domu can not play video
  ...
2024-12-06 18:20:20 +08:00
Dong Aisheng
01558d7639 Merge remote-tracking branch 'origin/capture/neoisp' into capture/next
* origin/capture/neoisp: (29 commits)
  LF-13402: media: nxp: neoisp: Use default streamoff/streamon vb2_ioctl
  media: nxp: neoisp: Enable memory dump for LUT via debugfs
  ILIE-114-3: media: nxp: neo: Add vb2 busy check for all s_fmt functions
  ILIE-114-2: media: nxp: neo: Return queued buffers on start_streaming error
  ILIE-114-1: media: nxp: neo: Perform standard check for VIDIOC_CREATE_BUFS
  ...
2024-12-06 18:19:05 +08:00
Dong Aisheng
237e97fe05 Merge remote-tracking branch 'origin/capture/ds90ub' into capture/next
* origin/capture/ds90ub: (6 commits)
  LF-12188-09: media: i2c: ds90ub960: add internally generated FrameSync support
  LF-12188-08: media: i2c: implement .[s/g]et_frame_interval subdev callback
  LF-12188-07: media: i2c: ds90ub960: add back channel GPIO select support
  LF-12188-05: media: dt-bindings: add new property ti,bc-gpio for ds90ub960
  LF-12188-04: media: i2c: ds90ub953: set GPIO as back channel by default
  ...
2024-12-06 18:19:05 +08:00
Dong Aisheng
564bac57c8 Merge remote-tracking branch 'origin/capture/ox03c10' into capture/next
* origin/capture/ox03c10: (37 commits)
  LF-13725 media/i2c: ox03c10: initialize custom control values
  LF-13840 media/i2c: ox03c10: change embedded data registers
  LF-13684-8 media/i2c: mx95mbcam: fix "declared but not referenced" Coverity issue
  LF-13684-7 media/i2c: max96724: fix "out-of-bounds write" Coverity issue
  LF-13684-6 media/i2c: max96724: fix "dereference null return value" Coverity issue
  ...
2024-12-06 18:19:04 +08:00
Dong Aisheng
ee74beee07 Merge remote-tracking branch 'origin/capture/ox05b1s' into capture/next
* origin/capture/ox05b1s: (11 commits)
  LF-13588-1: media: ox05b1s: Use centrally managed subdev active state
  LF-13436: media: ox05b1s: Fix hdr_mode control
  LF-13206: media: ox05b1s: Update controls when format changes
  LF-13019-3: media: ox05b1s: Add orientation and rotation controls
  LF-13019-1: dt-bindings: media: i2c: Add orientation and rotation properties for OX05B1S/OS08A20
  ...
2024-12-06 18:19:03 +08:00
Dong Aisheng
b2ac7d1163 Merge remote-tracking branch 'origin/capture/csi' into capture/next
* origin/capture/csi:
  LF-13219: media: staging/imx7: Add handler the abnormal interrupt signle
2024-12-06 18:19:02 +08:00
Dong Aisheng
b2a6ac1f3d Merge remote-tracking branch 'origin/capture/pi' into capture/next
* origin/capture/pi: (6 commits)
  LF-13987: media: imx-parallel-csi: export information for parallel csi entity
  LF-13697-9: media: imx-parallel-csi: Add support for 8QXP
  LF-13697-8: media: dt-bindings: nxp,imx-parallel-csi: Add i.MX8 compatible string
  LF-12531: media: nxp: fix capture image bottom edge green line
  LF-13535-15: media: dt-bindings: media: Add dt-binding for nxp,imx-parallel-csi
  ...
2024-12-06 18:19:02 +08:00
Dong Aisheng
f392b1fce4 Merge remote-tracking branch 'origin/capture/mt9m114' into capture/next
* origin/capture/mt9m114: (6 commits)
  LF-13535-13: media: mt9m114: Fix the set fmt failed for mismatch issue
  LF-13535-12: media: i2c: initialize subdev active state of MT9M114
  LF-13535-11: media: i2c: add v4l2 subdev initial of MT9M114
  LF-13535-10: media: i2c: add runtime PM support for MT9M114
  IMXBSP-123-3: media: mt9m114: Add the EXTCLK regulator control in mt9m114
  ...
2024-12-06 18:19:01 +08:00
Dong Aisheng
2c18223c11 Merge remote-tracking branch 'origin/capture/ap1302' into capture/next
* origin/capture/ap1302:
  MLK-26215: media: i2c: ap130x: Keep subdev name as v4l2 core set
  MLK-26216-02: media: i2c: ap1302: Add two fwnode properities support
  LF-11653-02: media: i2c: ap1302: remove ADV_IRQ_SYS_INTE register setting
  LF-10587-07: media: i2c: add AP1302 driver from community
2024-12-06 18:19:01 +08:00
Dong Aisheng
a60905df1d Merge remote-tracking branch 'origin/capture/ov5640' into capture/next
* origin/capture/ov5640: (29 commits)
  LF-13705-2 media: capture: ov5640_mipi_v2: Fix Coverity issue
  LF-13534-3: media: i2c: sensor: Fix the downstream platforms start camera failed
  LF-13534-1: media: i2c: sensor: add link_setup entity ops for ov5640 driver
  LF-13220: media: ov5640: Fix camera the frist few frames are green image
  LF-10336-2 media: ov5640_v2: Fix Division by zero problem
  ...
2024-12-06 18:19:01 +08:00
Dong Aisheng
86196e364f Merge remote-tracking branch 'origin/capture/mxc' into capture/next
* origin/capture/mxc: (17 commits)
  LF-13880-1: media: mx6s_capture: Removing i.MX8MQ support
  LF-13705-5 media: csi: Fix Coverity issue
  LF-10199-1 media: csi: fix kernel dump when rmmod mx6s_capture module
  LF-9749 media: csi: Fix dump issue against NULL pointer dereference
  MA-20197-3 uapi: mxc_v4l2: use __u32 instead of uint32_t
  ...
2024-12-06 18:19:00 +08:00
Dong Aisheng
719c522b98 Merge remote-tracking branch 'origin/capture/media' into capture/next
* origin/capture/media: (6 commits)
  Revert "media: v4l2-ioctl: clear fields in s_parm"
  media: v4l2: export video_usercopy function
  Revert "media: v4l2-subdev.h: remove obsolete g/s_parm"
  MLK-20724: uapi: add RGBA to exend V4L2 standard format for android usage
  MLK-9662 [V4L2 Capture] Revert patch to re-add support for _G_CHIP_IDENT
  ...
2024-12-06 18:18:59 +08:00
Dong Aisheng
08de1ba6dc Merge remote-tracking branch 'origin/capture/jpeg' into capture/next
* origin/capture/jpeg:
  LF-13473-7: media: imx-jpeg: Ensure power suppliers be suspended before detach them
  LF-13473-6: media: imx-jpeg: Set video drvdata before register video device
  media: imx-jpeg: add support for imx9 jpeg codec
  LF-5926: media: imx-jpeg: Add soft reset after frame done
2024-12-06 18:18:58 +08:00
Dong Aisheng
6973637930 Merge remote-tracking branch 'origin/capture/isi' into capture/next
* origin/capture/isi: (161 commits)
  LF-13267: media: nxp: imx8-isi: check streaming status in streamon()
  LF-13923 media: nxp: imx8-isi: better handle the m2m usage_count
  LF-13267 media: nxp: imx8-isi: fix v4l2-compliance test errors
  LF-13924: media: imx8-isi: Fix tearing of 8QM
  LF-13697-3: media: imx8-isi: Add null-pointer checks
  ...
2024-12-06 18:18:58 +08:00
Dong Aisheng
3a066892db Merge remote-tracking branch 'origin/capture/csi-pixel-formatter' into capture/next
* origin/capture/csi-pixel-formatter:
  LF-11414-2 media/platform/nxp: imx-csi-formatter: add RAW16 support
  LF-10853-03: media: nxp: add v4l2 subdev driver for csi pixel formatter
2024-12-06 18:18:56 +08:00
Dong Aisheng
82cf2140e2 Merge remote-tracking branch 'origin/capture/csi2-dwc' into capture/next
* origin/capture/csi2-dwc:
  LF-11503-1: media: nxp: dwc-mipi-csi2: Set default VC and DT in CSI when no get_frame_desc
  LF-11414-1 media/platform/nxp: dwc-mipi-csi2: add support for RAW 16bit formats
  LF-10587-05: media: nxp: add DesignWare MIPI CSI controller driver
2024-12-06 18:18:56 +08:00
Dong Aisheng
e942a248db Merge remote-tracking branch 'origin/capture/csi2-samsung' into capture/next
* origin/capture/csi2-samsung: (49 commits)
  LF-13443: media: staging/imx8mm: remove unused clocks for mipi csi
  LF-13217: media: imx: imx-mipi-csis: Fix the csi irq errors
  LF-13216: media: imx: imx-mipi-csis: Add the YUYV8_1X16 format support
  LF-11619-3: capture: csi : remove unused clocks for mipi csi
  LF-11431-01: media: imx8-mipi-csi2-sam: fix build issue due to API change
  ...
2024-12-06 18:18:55 +08:00
Laurentiu Palcu
59e3a34302 LF-13267: media: nxp: imx8-isi: check streaming status in streamon()
Return 0 if streaming on the video device was already started. According
to the documentation:

"If VIDIOC_STREAMON is called when streaming is already in progress,
or if VIDIOC_STREAMOFF is called when streaming is already stopped,
then 0 is returned."

However, in our case -EBUSY is returned by mxc_isi_pipe_acquire(). Fix
this by checking whether we're streaming or not, before going through
with acquiring the ISI pipe.

Fixes: cf21f328fc ("media: nxp: Add i.MX8 ISI driver")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Guoniu Zhou <guoniu.zhou@nxp.com>
2024-12-06 07:48:11 +00:00
Hans Verkuil
74be6d7ddc media: v4l2-core: v4l2-dv-timings: check cvt/gtf result
commit 9f070b1862f3411b8bcdfd51a8eaad25286f9deb upstream.

The v4l2_detect_cvt/gtf functions should check the result against the
timing capabilities: these functions calculate the timings, so if they
are out of bounds, they should be rejected.

To do this, add the struct v4l2_dv_timings_cap as argument to those
functions.

This required updates to the adv7604 and adv7842 drivers since the
prototype of these functions has now changed. The timings struct
that is passed to v4l2_detect_cvt/gtf in those two drivers is filled
with the timings detected by the hardware.

The vivid driver was also updated, but an additional check was added:
the width and height specified by VIDIOC_S_DV_TIMINGS has to match the
calculated result, otherwise something went wrong. Note that vivid
*emulates* hardware, so all the values passed to the v4l2_detect_cvt/gtf
functions came from the timings struct that was filled by userspace
and passed on to the driver via VIDIOC_S_DV_TIMINGS. So these fields
can contain random data. Both the constraints check via
struct v4l2_dv_timings_cap and the additional width/height check
ensure that the resulting timings are sane and not messed up by the
v4l2_detect_cvt/gtf calculations.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Fixes: 2576415846 ("[media] v4l2: move dv-timings related code to v4l2-dv-timings.c")
Cc: stable@vger.kernel.org
Reported-by: syzbot+a828133770f62293563e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-media/000000000000013050062127830a@google.com/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-05 14:02:57 +01:00
Stanislaw Gruszka
57241487a3 media: intel/ipu6: do not handle interrupts when device is disabled
commit 1429826883bb18847092b2e04c6598ef34bae1d4 upstream.

Some IPU6 devices have shared interrupts. We need to handle properly
case when interrupt is triggered from other device on shared irq line
and IPU6 itself disabled. In such case we get 0xffffffff from
ISR_STATUS register and handle all irq's cases, for what we are not
not prepared and usually hang the whole system.

To avoid the issue use pm_runtime_get_if_active() to check if
the device is enabled and prevent suspending it when we handle irq
until the end of irq. Additionally use synchronize_irq() in suspend

Fixes: ab29a2478e ("media: intel/ipu6: add IPU6 buttress interface driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com> # ThinkPad X1 Yoga Gen 8, ov2740
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-05 14:02:56 +01:00
Qiu-ji Chen
80a3b2ee01 media: wl128x: Fix atomicity violation in fmc_send_cmd()
commit ca59f9956d4519ab18ab2270be47c6b8c6ced091 upstream.

Atomicity violation occurs when the fmc_send_cmd() function is executed
simultaneously with the modification of the fmdev->resp_skb value.
Consider a scenario where, after passing the validity check within the
function, a non-null fmdev->resp_skb variable is assigned a null value.
This results in an invalid fmdev->resp_skb variable passing the validity
check. As seen in the later part of the function, skb = fmdev->resp_skb;
when the invalid fmdev->resp_skb passes the check, a null pointer
dereference error may occur at line 478, evt_hdr = (void *)skb->data;

To address this issue, it is recommended to include the validity check of
fmdev->resp_skb within the locked section of the function. This
modification ensures that the value of fmdev->resp_skb does not change
during the validation process, thereby maintaining its validity.

This possible bug is found by an experimental static analysis tool
developed by our team. This tool analyzes the locking APIs
to extract function pairs that can be concurrently executed, and then
analyzes the instructions in the paired functions to identify possible
concurrency bugs including data races and atomicity violations.

Fixes: e8454ff7b9 ("[media] drivers:media:radio: wl128x: FM Driver Common sources")
Cc: stable@vger.kernel.org
Signed-off-by: Qiu-ji Chen <chenqiuji666@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-05 14:02:56 +01:00
Bingbu Cao
11b0543efe media: ipu6: remove architecture DMA ops dependency in Kconfig
[ Upstream commit c8e9120c2065868d97e9e94bceee777e5db08c3e ]

IPU6 driver doesn't override the dma_ops of device now, it doesn't
depends on the ARCH_HAS_DMA_OPS, so remove the dependency in Kconfig.

Fixes: de6c85bf91 ("dma-mapping: clearly mark DMA ops as an architecture feature")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:34 +01:00
Bingbu Cao
6ac269abab media: ipu6: not override the dma_ops of device in driver
[ Upstream commit daabc5c64703432c4a8798421a3588c2c142c51b ]

DMA ops are a helper for architectures and not for drivers to override the
DMA implementation. Driver should not override the DMA implementation.

This patch removes the dma_ops override from auxiliary device and adds
driver-internal helpers that use the actual DMA mapping APIs.

Fixes: 9163d83573 ("media: intel/ipu6: add IPU6 DMA mapping API and MMU table")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
[Sakari Ailus: Fix the commit message a little.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:34 +01:00
Sakari Ailus
b0cd515202 media: ipu6: Fix DMA and physical address debugging messages for 32-bit
[ Upstream commit 199c204bcc732ec18dbaec2b9d6445addbd376ea ]

Fix printing DMA and physical address printing on 32-bit platforms, by
using correct types. Also cast DMA_BIT_MASK() result to dma_addr_t to make
Clang happy.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Stable-dep-of: daabc5c64703 ("media: ipu6: not override the dma_ops of device in driver")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:34 +01:00