| Age | Commit message (Collapse) | Author |
|
The ipu6_bus_del_devices() will uninitialize and free bus devices and
dereferencing isp->psys and isp->isys will lead to use-after-free.
While at it, remove unnecessary checks for isp->isys/psys.
Reported-by: Dan Carpenter <error27@gmail.com>
Fixes: 69ebb1bfc865 ("media: ipu6: Move isys fw mapping to pci_probe")
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Closes: https://lore.kernel.org/linux-media/aqlXAXcXvMM3HWtJ@stanley.mountain/T/#u
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The Dell 14 Premium DA14250 has its OV02C10 front sensor mounted upside
down, like the Dell 16 Premium DA16250 and the other Dell models already
present in upside_down_sensor_dmi_ids[]. The rotation is reported as 0 in
both the SSDB and the _PLD, so without a DMI quirk the image is presented
upside down.
Add a DMI quirk entry for this model so that a rotation of 180 degrees is
reported for its OVTI02C1 sensor.
Signed-off-by: Keith Harvey <kthhrv@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The Microsoft Surface Pro 9 mounts both its front sensor (OVTI5693) and
its rear one (OVTID858) rotated 180 degrees, and its SSDB reports 0 for
each, so frames from either arrive inverted with nothing to say so.
Add both to upside_down_sensor_dmi_ids. The two entries carry identical
DMI matches and differ only in the ACPI HID they gate on, which works
because ipu_bridge_parse_rotation() walks every matching DMI entry rather
than stopping at the first one.
Measured on a Surface Pro 9, DMI product SKU Surface_Pro_9_2038, IPU6
Alder Lake-P 8086:465d, where the inversion of both sensors was confirmed
visually. Matched on DMI_PRODUCT_NAME as the rest of the table is, rather
than on the narrower SKU: the entries only take effect when the ACPI HID
matches too, so a variant of the same model that shipped different
sensors is left alone.
This makes the kernel report the mounting truthfully and does no more
than that. Nothing in the bridge rotates pixels, so an application that
reads the property can turn the image the right way up while one that
ignores it still shows it inverted.
Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The Samsung Galaxy Book3 Pro (960XFG) has the same problem as the
Galaxy Book3 Ultra (960XFH): its OV02C10 sensor is mounted upside-down,
but neither the SSDB nor the _PLD reports the 180 degree rotation, so
ipu_bridge_parse_rotation() assigns a "rotation" property of 0 to the
sensor fwnode and the image is rendered upside-down in userspace.
Add a DMI quirk entry for this laptop so that the sensor fwnode gets a
"rotation" property of 180 and userspace (e.g. libcamera) can
compensate.
The DMI strings (sys_vendor "SAMSUNG ELECTRONICS CO., LTD.",
product_name "960XFG") and the upside-down image come from a report
against the ov02c10 26 MHz clock series.
Reported-by: Mars-Wave <tmorolias@gmail.com>
Closes: https://lore.kernel.org/linux-media/20260922063507.690-1-tmorolias@gmail.com/
Signed-off-by: Felipe Calliari <calliarifelipe@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The software nodes ipu-bridge registers on a successful init are never
unregistered. There is no module_exit and no remove hook, and every
software_node_unregister_node_group() call sits on an error unwind label
inside ipu_bridge_init(), so on success the nodes stay registered and
readable after the module is unloaded, which a later rebind relies on.
Nothing reachable from a registered node may therefore point into the
module image. PROPERTY_ENTRY_BOOL() stores a pointer to its name, so the
"clock-noncontinuous" string literal leaves the surviving node carrying a
dangling property name once ipu-bridge is gone.
Add the name to struct ipu_property_names, which is copied by value into
each struct ipu_sensor, and use that copy, as every other endpoint
property name already does.
Fixes: 8e3def7bf410 ("media: ipu-bridge: Request non-continuous clock for ov5693 on IPU6")
Reported-by: D. Manresa <dmanresa@gmail.com>
Closes: https://lore.kernel.org/linux-media/20260905211307.542810-1-dmanresa@gmail.com/
Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The logger and watchdog configurations are not isys specific, move them
to ipu7-boot.h. No functional change.
Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Add buttress psys helpers, needed by ipu7 psys driver.
Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Export a boot state accessor, so subsystem interrupt handler can detect
a firmware error state.
Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The fw_config holds the subsystem configuration blob handed to the
firmware at boot. Make it subsystem agnostic by using void pointer.
No functional change.
Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Keep the ipu7 boot helpers sub-system agnostic by passing the
firmware context explicitly. No functional change.
Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The struct ipu6_mmu is used by ipu6_mmu_hw_ops, but the latter is
defined before former. Including ipu6-mmu.h on its own would not work,
add a forward declaration.
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The media entity name prefix is ipu6 for all the hardware, fix it.
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The Omnivision OV8858 is used as the rear camera in several Intel
IPU3-based devices (e.g. Dell Latitude 5285 2-in-1). Its ACPI HID is
INT3477. Add a sensor configuration entry with a link frequency of
360 MHz to allow ipu_bridge to create the firmware node for this sensor.
Assisted-by: LLM
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Thierry Chatard <tchatard@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Add the ACPI HID Lenovo uses for the ST VD55G1 IR camera of the ThinkPad
X1 Carbon Gen 14. The firmware describes one CSI-2 data lane and, as
usual, no link frequency, so the value has to come from this table; the
vd55g1 driver requires exactly one.
Use 402 MHz (804 Mbps). The sensor derives its MIPI rate and clock tree
from this value and the IPU7 CSI-2 receiver reads the same value back
through V4L2_CID_LINK_FREQ, so both ends agree by construction. At
804 Mbps a full-width 10-bit line takes about 11 us on the link, which
allows well over 100 fps at full resolution; lower rates lengthen every
line proportionally. The rate is in the lower half of the 250 to
1200 Mbps range the sensor supports and is the one validated on the
hardware, where 804x704 streams at 58 fps.
Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Update Kconfig for support of IPU 7, 7.5 and 8 in mind.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Add the IPU8 PCI ID and probe wiring. IPU8 reuses the IPU7P5 buttress
register map (unvalidated against IPU8's hardware spec) but needs its
own default control ratio (0x10), so add dedicated
ipu8_{isys,psys}_buttress_ctrl structs instead of reusing IPU7's.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
[Sakari Ailus: Drop IPU8 from no_force_probe list.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Port the remaining IPU8 psys platform enablement that already exists
upstream in staging ipu7: the psys MMU hardware table and PLL
request/release in the shared power-on/off path. This driver has no
psys pipeline consumer, so it only affects the psys bus device's power
sequencing and MMU setup.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Complete IPU8 ISYS enablement: add the IPU8 NDE control register, TSC
sync variant, TLBID_HASH bits and ISYS MMU hardware table. Add
IS_IPU8() alongside the existing IS_IPU7() check at each site in
ipu6.c, ipu6-buttress.c, ipu6-isys.c, ipu6-isys-csi2.c, ipu6-cpd.c and
ipu6-mmu.c that needs to follow the IPU7-family codepath, keeping the
two checks independent instead of widening IS_IPU7() to also match
IPU8. Without this IPU8 firmware boot fails with
IA_GOFO_FW_BOOT_STATE_CRIT_UNSPECIFIED (0xdead0001), confirmed on real
hardware. PSYS-specific pieces are intentionally left out here.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
IPU8's GPREG stride is 0x2000, not IPU7's hardcoded 0x1000. Add
csi2.gpreg_stride and use it in the two gpreg accessors instead of the
fixed value, wiring it up for both IPU7 and IPU8 in
ipu6_internal_pdata_init().
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Firmware ABI 1.0.14 diverges from IPU7's InSys message layout (uPipe
config, CFA dimension, binning factor, wider output cropping) and
expects boot-message major version 2 instead of IPU7's 1; without the
version fix the IPU8 firmware rejects the boot handshake with
IA_GOFO_FW_BOOT_STATE_CRIT_MSG_VERSION (0xdead0301), confirmed on real
hardware.
Add the IPU8 layout as additional '_ipu8' structs and convert to it at
send time when running on IPU8, keeping the existing IPU7 layout as
the shared driver-internal representation used by the common isys
queue/video code.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Add IPU_VERSION_8 and an IS_IPU8() accessor mirroring
IS_IPU7()/IS_IPU7P5(), plus the IPU8 firmware/model name defines, as
the baseline for the rest of this series.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
Drop the retired IPU_INSYS_RESP_TYPE_PWM_IRQ response type and add the
mipi_fn field the firmware now reports in its place, matching staging
ipu7's ABI bump. The boot-ABI and psys message changes from that
commit don't apply here: this driver has no equivalents to touch.
Signed-off-by: Divyamani Tripathi <divyamani.tripathi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
A PIN_DATA_READY response for an unconfigured pin dereferences a NULL
output_pins_queue entry in interrupt context. Check the queue like the
ipu6 path does.
Fixes: f268203d74ff ("media: ipu6: Add ipu7 isr handler")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
ipu6_isys_fwcom_cfg_init() runs on every first stream start and allocates
the firmware config and queue configs with devm, so each STREAMON/STREAMOFF
cycle leaks them. They are only needed until ipu6_fw_com_prepare() has
copied them, so free them right after. Also check the return value, an
allocation failure would otherwise make ipu6_fw_com_prepare() dereference
a NULL queue config.
Fixes: f625e8d7ffc1 ("media: intel/ipu6: input system ABI between firmware and driver")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
ipu7_fw_isys_init() runs on every first stream start, but allocates the
firmware context and queue configs with devm and never frees them, so
each STREAMON/STREAMOFF cycle leaks them. Use kzalloc and free them in
ipu7_fw_isys_cleanup().
Fixes: 9ab793dbc176 ("media: ipu6: Add ipu7 fw isys ops")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The ISYS needs a reset when the active buffer list isn't empty. Warn about
this.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
The need_reset field in struct ipu6_isys tells whether the device needs a
power-on reset. Resetting the field was removed unintentionally in commit
70e3fac3ec78 ("media: ipu6: Move firmware init/cleanup to RPM callbacks").
Add it back.
Fixes: 70e3fac3ec78 ("media: ipu6: Move firmware init/cleanup to RPM callbacks")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Provide compatibility support for upstream sub-device drivers that do not
implement get_frame_desc() pad op.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Rely on runtime PM suspending and resuming the device and so remove
tracking of power state. Also remove the power_lock spinlock that
serialised firmware initialisation and cleanup with the ISR. This is no
longer necessary as the ISR now runs when the device is in RPM_ACTIVE
state.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Move handling firmware initialisation and cleanup away from the rest of
the driver to the runtime PM callbacks. This simplifies the driver,
including removing the ref_count field in struct ipu6_isys.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Re-purpose the unused stream_lock in struct ipu6_isys to serialise access
to streams_by_handle (struct ipu6_isys) and streams_by_vc (struct
ipu6_isys_csi2). Switch to scoped_guard() while at it.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
{get,put}_streams_opened() aren't needed anymore. Drop them. This also
requires acquiring isys->stream_mutex for system suspend.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
The stream concept of the IPU6 firmware is aligned with that of the CSI-2,
effectively meaning that a stream equals to a CSI-2 virtual channel. Only
start streaming once all streams on a given virtual channel have been
started, and stop streaming once first one of them has been stopped.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Remove structs to maintain watermark related configuration, by using the
values where they're obtained, apart from keeping watermark enabled status
in struct ipu6_isys.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Move watermark calculation to ipu6-isys-csi2.c and do the whole thing
as streaming is about to start. There's no need to store all the
information so that it is bound to video nodes.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Streams will soon be allocated just for the duration of streaming
operation. In this case, obtain the CSI-2 sub-device through av->csi2
which is set up during driver probe.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Collect enable stream IDs as streaming is enabled on video nodes. These
values will be needed once streaming actually starts. This is required for
multiple streams from a single source.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
nr_queues and nr_streaming fields were being used to determine whether
streaming was to be started in the upstream sub-device. As we store the
streaming state in the CSI-2 sub-device, there's no longer need for that.
Drop these fields.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
The callbacks for enabling and disabling streams access data serialised
using the isys stream_mutex; add lockdep checks for this.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
For each virtual channel, start streaming once all buffer queues connected
via enabled routes have been set streaming, similarly stop when the first
queue is stopped.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Collect the IPU streams to the CSI-2 receiver sub-device's context.
The background is that an IPU stream is bound to a CSI-2 virtual channel
but in a V4L2 pipeline there's no such assumption. Therefore a pipeline
may contain multiple virtual channels and so multiple IPU streams, too.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Instead of passing watermark configuration data around, get it directly
from IPU variant specific static data structure.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Handle link_freq <= as a special case and continue calculating the pixel
rate otherwise.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Always request a capture ack from a queued buffer. If streaming is
disabled, no buffers would have been queued in the first place. Remove the
streaming field from struct ipu6_isys_stream as well.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
ipu6_isys_video_init() has a label in the error path where it is used to
destroy a mutex. Rename the label as err_mutex_destroy.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
The stream number on the video nodes' single pad is always 0, thus the
stream number of the CSI-2 receivers' source pads is also 0. Remove the
complexity that is there to come up with 0.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
Move the streaming control out of the video nodes to the CSI-2 receiver
driver which is better positioned to consider stream configuration and so
when to actually start and stop streaming.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
If obtaining a firmware message or requesting to queue a buffer list
failed, either the buffer list or the firmware message buffer wasn't
properly released. While this is unlikely to happen, return the remaining
resources now.
This may still leave buffers queued.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com>
|
|
The Microsoft Surface Pro 11 for Business (Intel Lunar Lake, IPU7) carries
an OV13858 as its rear sensor, enumerated as ACPI device OVTID858. That HID
is not in ipu_supported_sensors[], so ipu_bridge_connect_sensors() passes
over it without logging anything and the IPU is left with an empty graph:
intel-ipu7 0000:00:05.0: no subdev found in graph
Add the entry, with the two link frequencies ov13858 declares. The bridge
then connects the sensor:
intel-ipu7 0000:00:05.0: Found supported sensor OVTID858:00
intel_ipu7_isys: bind ov13858 1-0010 nlanes is 4 port is 0
This machine needs two further fixes before the sensor streams, neither of
them a prerequisite for this entry to be correct: "platform/x86: int3472:
support the POWER1 GPIO type" from Jakob Berg Jespersen, and power
sequencing the in-tree ov13858 driver does not do on this platform. With
all three, libcamera streams SGRBG10 at 4224x3136, 29.95 fps.
Signed-off-by: Sergey Lebedev <lsa.uz@pm.me>
Tested-by: Fernando Rimoli <fernandorimoli11@gmail.com> # Surface Pro 9, IPU6 Alder Lake-P (8086:465d)
Tested-by: German Pablo Lindo <germanpapulindez@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
|
The Microsoft Surface Pro for Business 11th Edition with Intel mounts
its OV13858 rear sensor rotated 180 degrees, but reports a rotation of
0 in its SSDB and has no matching _PLD, so without a DMI quirk the
image is presented upside down.
Add a DMI quirk entry for this model so that a rotation of 180 degrees
is reported for its OVTID858 sensor.
Tested on the affected machine: camera_sensor_rotation reads 180 and
libcamera reports Rotation = 180. Confirmed independently on a second
machine of the same model, where GNOME Snapshot and Firefox present
the image the right way up once the quirk is applied; qcam, which
talks to libcamera directly, does not.
Signed-off-by: Sergey Lebedev <lsa.uz@pm.me>
Tested-by: German Pablo Lindo <germanpapulindez@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|