Commit graph

379 commits

Author SHA1 Message Date
Anton Puppe
d74087f58d drivers: video: imx335: Add 2x2 binning support
Adds support for switching the sensor resolution between all-pixel scan
(2592x1944) and 2x2 binning (1296x972). This reduces the bandwidth
and processing power requirements for applications that do not need the
full resolution. It also paves the way for higher frame rates.

Note that while the imx335 driver now supports dynamic resolution
changes, some downstream components may not. The binning mode is enabled
automatically if the correct format is selected.

Signed-off-by: Anton Puppe <anton-noel-flynn.puppe@zeiss.com>
2026-01-11 13:05:34 +01:00
Yunjie Ye
cfb6e15040 drivers: video: ov2640: Fixing the issue of the reset pin for OV2640.
The dt binding file requires the reset pin to be configured
as `GPIO_ACTIVE_LOW`, but the driver uses the
logic of `GPIO_ACTIVE_HIGH`.
Therefore, modify the logic in the driver and add a
migration guide.

Signed-off-by: Yunjie Ye <yun_small@163.com>
2026-01-09 13:08:48 +01:00
Yunjie Ye
7b93c32bd1 drivers: video: ov2640: Running clang-format on ov2640.c file
Using clangd to format ov2640.c file, which is not compatible with
existing .clang-format file.

Signed-off-by: Yunjie Ye <yun_small@163.com>
2026-01-09 13:08:48 +01:00
Yunjie Ye
9a5d96e4e0 drivers: video: ov2640: Add pwdn pin support on ov2640.
Add handling for the power-down (pwdn) pin of the OV2640 sensor.

Signed-off-by: Yunjie Ye <yun_small@163.com>
2026-01-09 13:08:48 +01:00
Chen Xingyu
bd9d8ba000 soc: espressif: Introduce common LCD_CAM support
Move the shared pinctrl and clock initialization for the LCD_CAM peripheral
from the ESP32 DVP driver into a new SoC-level implementation.

Update the ESP32-S3 DTS to reflect the new structure by introducing an
`lcd_cam_dvp` child node under the common `lcd_cam` parent node.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2026-01-07 10:20:54 +01:00
Chen Xingyu
21eac8f32b drivers: video: esp32: Rename to lcd-cam-dvp
Rename the ESP32 LCD_CAM DVP driver and its DT binding from
`espressif,esp32-lcd-cam` to `espressif,esp32-lcd-cam-dvp` to clearly
identify it as the DVP (camera) input block of the LCD_CAM peripheral.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2026-01-07 10:20:54 +01:00
Alain Volmat
c4b7b7978b video: removal of VIDEO_BUFFER_POOL_SZ_MAX from Kconfig
Now that VIDEO_BUFFER_POOL_HEAP_SIZE is available is used
in all projects, VIDEO_BUFFER_POOL_SZ_MAX can be removed.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
3ff323b0ee video: replace CONFIG_VIDEO_BUFFER_POOL_SZ_MAX with POOL_HEAP_SIZE
Update video common code and applications to rely on the
CONFIG_VIDEO_BUFFER_POOL_HEAP_SIZE instead of
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
7319cd00d5 video: add CONFIG_VIDEO_BUFFER_POOL_HEAP_SIZE description
Clarify the size of the video buffer pool by having a
dedicated CONFIG for it.  Until now the size of the
video buffer pool was equal to VIDEO_BUFFER_POOL_SZ_MAX
multiply by VIDEO_BUFFER_POOL_NUM_MAX.

This commit only add the description, the config doesn't
have yet any effect. Change will be added after all configs
are updated to define it in order to avoid breaking
platforms between 2 commits.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
a299826287 video: stm32-venc: allow selection of venc internal memory pool
Allow usage of either Shared-Multi-Heap based internal memory pool
allocation or allocation from a HEAP located optional in a
Zephyr region.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
47e031ec85 video: fix VIDEO_BUFFER_USE_SHARED_MULTI_HEAP definition
Avoid default n since this is the default for a bool config

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
9788cedcfb video: allow placement of video buffer pool in a Zephyr region
Addition of two options in order to select the Zephyr region
into which the video buffer pool should be placed.
CONFIG_VIDEO_BUFFER_POOL_ZEPHYR_REGION allows to indicate that the
video video pool should be placed in a specific ZEPHYR region which
name is CONFIG_VIDEO_BUFFER_POOL_ZEPHYR_REGION_NAME

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-23 19:49:00 +00:00
Alain Volmat
d671e3f675 drivers: stm32: remove all HAL_RIF_ calls from stm32 drivers
RIF configuration is now done at soc init time in a centralized
way so it is no more necessary for drivers to perform this
configuration.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-11 09:18:38 +02:00
Mario Paja
f4cfd85c56 drivers: video: stm32_dcmi: relocate dma stream to driver data
This change moves the dma stream from _config to _data,
allowing direct reference the DMA stream rather than
duplicating it on the stack. Additionally, it aligns the
declaration to the other STM32 drivers.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-12-10 10:33:50 +00:00
Michael Smorto
5b05d649d0 drivers: video: Changed common registers to OV767X
Updated register tables to use use OV767X.

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-12-06 11:40:08 -05:00
Michael Smorto
7ac0dc47bc drivers: video: Add OV7675 changes to OV767x
Adds support for the ov7675 camers.

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-12-06 11:40:08 -05:00
Michael Smorto
2ffdb90223 drivers: video: Changes the driver name to ov767x.c
Changes the driver name to ov767x.

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-12-06 11:40:08 -05:00
Michael Smorto
0d5c6aa074 drivers: video: Update OV7670 to use generic ov767x functions
Minimal changes to OV760 drive to use generic ov767x structures.
- This includes changes to function names.
-  Includes changes to defines as necessary.
-  Deleted camera_id as no longer required

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-12-06 11:40:08 -05:00
Michael Smorto
a6311c5377 drivers: video: Restructure OV760.c driver before adding OV7675 support
Modifications for use of video cci helpers in video_common.h.

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-12-06 11:40:08 -05:00
Mathieu Choplain
3b745a1214 drivers: video: stm32_dcmi: configure proper DMA burst length
The burst length unit is bytes, not number of transfers. This had not been
an issue since the DMA driver historically ignored the values, but has now
become one since they are used and (most importantly for us) validated.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-04 05:23:02 -05:00
Hardevsinh Palaniya
c784481ca0 drivers: video: Add ov5642 camera driver
Add driver to support ov5642 camera sensor

Co-developed-by: Rutvij Trivedi <rutvij.trivedi@siliconsignals.io>
Signed-off-by: Rutvij Trivedi <rutvij.trivedi@siliconsignals.io>
Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
2025-11-19 15:57:05 -05:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Etienne Carriere
b0ccb2295f drivers: stm32: use STM32_CLOCK_INFO_BY_NAME() and friends
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.

Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Michael Smorto
20f6d716a3 drivers: video Add Himax HM0360 camera sensor driver
Adds support for the HM0360 camera.

Signed-off-by: Michael Smorto <CyberMerln@gmail.com>
2025-11-13 20:32:26 -05:00
Alain Volmat
3b0704974c video: gc2145: perform first-second switch for CSI RGB565
Correct the RGB565 format generated by the GC2145 in case of CSI based
RGB565 by setting the Page 0 BYPASS_MODE register switch bit in order
to generate RGB565_LE instead of RGB565_BE.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-11-05 11:34:41 +02:00
Alain Volmat
6b7ad26213 video: stm32_dcmipp: fix parallel interface RGB565 handling
On parallel interface, the DCMIPP is expecting data in what
corresponds to the RGB565_BE formats, aka

	     D7 D6 D5 D4 D3 D2 D1 D0
	     -----------------------
cycle 1:     R4 R3 R2 R1 R0 G5 G4 G3
cycle 2:     G2 G1 G0 B4 B3 B2 B1 B0

The Zephyr RGB565 video format corresponds to the RGB565_LE
hence perform a SWAPCYCLE when RGB565 is used as input format
on parallel interface.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-11-05 11:34:41 +02:00
Alain Volmat
f547fb1af5 video: dcmipp: put Pipe1 / pipe2 caps within preproc if statement
Correct compilation error due to usage of DCMIPP_PIPE1 / DCMIPP_PIPE2
on platform which do not have pixel pipes by putting those caps
under #if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
Put also DCMIPP_VIDEO_FORMAT_CAP macro inside since this is only used
for AUX / MAIN pipes.

Fixes: 126aaf6b72 ("video: dcmipp: expose dcmipp caps for all 3 pipes.")

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-28 17:41:28 +02:00
Alain Volmat
065754373a video: add H264 estimate in video_estimate_fmt_size
Add rough estimate of a worth case H264 output size.

The video_estimate_fmt_size would need more information
such as quality, profile in order to give a better
estimate for each formats so for the time being just
stick to 16bpp based size, same as for JPEG.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-24 13:25:34 -04:00
Alain Volmat
a6ceee976e video: addition of video_transfer_buffer helper function
Addition of a helper function which takes care of dequeue
from a source video device and queue into a sink video device.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-24 13:25:34 -04:00
Guillaume Gautier
2a52a2b7ff drivers: stm32: replace WRITE_REG HAL macro by stm32_reg_write
For all STM32 drivers and SoC, replace the WRITE_REG macro and the
LL_xxx_WriteReg functions (defined in the STM32 HAL) by
stm32_reg_write defined in Zephyr.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-24 08:58:25 -07:00
Guillaume Gautier
a2339c9b91 drivers: stm32: replace CLEAR_BIT HAL macro by stm32_reg_clear_bits
For all STM32 drivers, replace the CLEAR_BIT macro (defined in
the STM32 HAL) by stm32_reg_clear_bits defined in Zephyr.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-24 08:58:25 -07:00
Guillaume Gautier
73e9749c68 drivers: stm32: replace SET_BIT HAL macro by stm32_reg_set_bits
For all STM32 drivers, replace the SET_BIT macro (defined in
the STM32 HAL) by stm32_reg_set_bits defined in Zephyr.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-10-24 08:58:25 -07:00
Josuah Demangeon
c765b99887 drivers: video: sw_generator: support test pattern CID
Add an always-on CID for enabling the test pattern, which makes
it possible to use it in tests enabling the test first enabling
the pattern.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-10-24 08:52:57 -07:00
Alain Volmat
38a21cc1a2 video: introduce video_set_compose_format helper
Some devices allow for downscale / upscale via the set_selection
compose API. When using it, it is necessary to perform a
set_selection of the compose target prior to setting the format.
In order to allow non-compose aware application to benefit from
it, introduce a helper which take care of setting the compose
prior to setting the format.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-23 16:03:10 -04:00
Alain Volmat
126aaf6b72 video: dcmipp: expose dcmipp caps for all 3 pipes.
Currently the DCMIPP driver rely on a Kconfig in order to
select the right sensor resolution / format to pick.
This also makes the exposure of caps easier since it can
be exposed as:
  DUMP pipe: same caps as mentioned in Kconfig
  MAIN pipe: any format supported on this pipe and resolution
             starting at sensor selected resolution down to
             64 times smaller (which is the maximum of the
             downscale)
  AUX pipe: same as MAIN except without the semi-planar and
            planar formats

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-23 16:03:10 -04:00
Antonino Scarpaci
54ca22a626 drivers: video: Himax HM01B0 camera sensor driver
Add Himax HM01B0 camera sensor driver.
It depends on I2C and it is required to configure the camera.

Signed-off-by: Antonino Scarpaci <antonino.scarpaci@gmail.com>
2025-10-23 10:39:41 +02:00
Hugues Fruchet
0d2f910d3d drivers: video: stm32_venc: fix coding style
Fix coding style issues in venc video driver.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2025-10-22 18:06:55 -04:00
Hugues Fruchet
a186c72165 drivers: video: stm32_venc: log an error in case of hardware timeout
Log an error in case of hardware timeout.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2025-10-22 18:06:55 -04:00
Hugues Fruchet
8ad4282f4c drivers: video: stm32_venc: fix return value
Avoid mixing encoder library return code and driver return value to
fix wrong value returned by enqueue() in nominal case.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2025-10-22 18:06:55 -04:00
Adam BERLINGER
f97eba57d8 drivers: video: stm32_dcmipp: Initialize ISP only once
This fixes bug where stm32_dcmipp_isp_init is called multiple times.

Signed-off-by: Adam BERLINGER <adam.berlinger@st.com>
2025-10-21 17:23:13 +03:00
Etienne Carriere
d0c829a482 drivers: video: stm32: test HAL functions return value
Add missing test of some HAL functions return value.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-10-21 17:22:52 +03:00
Etienne Carriere
493993e0a6 drivers: video: stm32: don't mix HAL return value and errno
Clarify HAL return value is of type HAL_StatusTypeDef and not an
int in STM32 DCMI and DCMIPP drivers. For consistency, rename
the variable holding HAL return value from ret to hal_ret.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-10-21 17:22:52 +03:00
Kurt Eckhardt
eb7e332b1b video: stm32_dcmi: DMA Error recovery
On several boards, such as the Arduino Giga and
Portenta H7, they are often times setup with their
camera buffers and potentially video buffers in
SDRam.  This can lead to a significant number of
DMA errors, which currently stops the camera from
returning any additional frames.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2025-10-19 20:51:20 -04:00
Kurt Eckhardt
3d11ffd849 video: stm32_dcmi: forward selection
Forward the get_selection and set_selection APIs
to the camera objects, to allow some of the
selections to be supported at the camera level.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2025-10-19 20:51:20 -04:00
Kurt Eckhardt
0cbfe585df video: gc2145: support for CROP
Implements the set_selection and get_selection APIs,
if forwarded to it by a camera controller.
It uses the new messages
to allow you to set a crop window on top of the
current format window.  It also then allows you
to move this crop window around in the frame
window.

With this driver I also updated it to allow any resolution
from the displays min to max limits.
static const struct video_format_cap fmts[] = {
  GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
                              VIDEO_PIX_FMT_RGB565),
GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
                              VIDEO_PIX_FMT_YUYV),

When the resolution is set, it computes the scale factor.

Using the set_selection(VIDEO_SEL_TGT_CROP) allows you
define a crop window within the format window.

It clamps the ratio to a max of 3 as some other
drivers limit it saying it helps with frame rates.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2025-10-19 20:51:20 -04:00
Alain Volmat
320425847e video: stm32: addition of the STM32 JPEG HW Codec support
Initial version of the support for the STM32 JPEG HW codec,
currently supporting only NV12 to JPEG without DMA support
and using SW based conversion from NV12 to MCU required
for the JPEG codec.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-17 22:01:44 +03:00
Zacck Osiemo
6d60beffb9 drivers: video: mcux_sdma: Reconfigure the source when getting format
Reconfigure the sensor format with the only supported format of the
sdma when getting format

Signed-off-by: Zacck Osiemo <coderv63@gmail.com>
2025-10-16 12:17:29 -04:00
Alain Volmat
3a4f17454f drivers: video: stm32-venc: depends on VIDEO_ENCODER_H264
Make the STM32 VENC driver depends on the VIDEO_ENCODER_H264
in order to be compiled only if VIDEO_ENCODER_H264 is
enabled by an application.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-15 17:35:25 -04:00
Alain Volmat
f556a1b908 drivers: video: add encoders related Kconfig entries
Add video subsystem related Kconfig in order to allow an
application to enable encoder support.
This is useful for platforms having several video devices
available as well as several video encoders, since it allows
to only compile / enable part of those devices depending on
their kind.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-15 17:35:25 -04:00
Phi Bang Nguyen
517e13cae5 drivers: video: st_mipid02: Drop caps' min_vbuf_count
The mipid02 is just a bridge driver which does not deal with memory so
should not expose caps' min_vbuf_count.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2025-10-10 12:53:28 -04:00