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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>