Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions drivers/video/video_stm32_dcmipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,18 +1340,6 @@ static int stm32_dcmipp_dequeue(const struct device *dev, struct video_buffer **
#define DCMIPP_CEIL_DIV(val, div) \
(((val) + (div) - 1) / (div))

#define DCMIPP_VIDEO_FORMAT_CAP(format, pixmul) { \
.pixelformat = VIDEO_PIX_FMT_##format, \
.width_min = DCMIPP_CEIL_DIV_ROUND_UP_MUL(CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \
STM32_DCMIPP_MAX_PIPE_SCALE_FACTOR, \
pixmul), \
.width_max = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH / (pixmul) * (pixmul), \
.height_min = DCMIPP_CEIL_DIV(CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
STM32_DCMIPP_MAX_PIPE_SCALE_FACTOR), \
.height_max = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
.width_step = pixmul, .height_step = 1, \
}

static const struct video_format_cap stm32_dcmipp_dump_fmt[] = {
{
.pixelformat = VIDEO_FOURCC_FROM_STR(CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT),
Expand All @@ -1364,6 +1352,19 @@ static const struct video_format_cap stm32_dcmipp_dump_fmt[] = {
{0},
};

#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
#define DCMIPP_VIDEO_FORMAT_CAP(format, pixmul) { \
.pixelformat = VIDEO_PIX_FMT_##format, \
.width_min = DCMIPP_CEIL_DIV_ROUND_UP_MUL(CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \
STM32_DCMIPP_MAX_PIPE_SCALE_FACTOR, \
pixmul), \
.width_max = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH / (pixmul) * (pixmul), \
.height_min = DCMIPP_CEIL_DIV(CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
STM32_DCMIPP_MAX_PIPE_SCALE_FACTOR), \
.height_max = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
.width_step = pixmul, .height_step = 1, \
}

static const struct video_format_cap stm32_dcmipp_main_fmts[] = {
DCMIPP_VIDEO_FORMAT_CAP(RGB565, 8),
DCMIPP_VIDEO_FORMAT_CAP(YUYV, 8),
Expand Down Expand Up @@ -1397,6 +1398,7 @@ static const struct video_format_cap stm32_dcmipp_aux_fmts[] = {
DCMIPP_VIDEO_FORMAT_CAP(BGRA32, 4),
{0},
};
#endif

static int stm32_dcmipp_get_caps(const struct device *dev, struct video_caps *caps)
{
Expand All @@ -1406,12 +1408,14 @@ static int stm32_dcmipp_get_caps(const struct device *dev, struct video_caps *ca
case DCMIPP_PIPE0:
caps->format_caps = stm32_dcmipp_dump_fmt;
break;
#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
case DCMIPP_PIPE1:
caps->format_caps = stm32_dcmipp_main_fmts;
break;
case DCMIPP_PIPE2:
caps->format_caps = stm32_dcmipp_aux_fmts;
break;
#endif
default:
CODE_UNREACHABLE;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/drivers/build_all/video/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ tests:
drivers.video.stm32_dcmipp.build:
platform_allow:
- stm32n6570_dk/stm32n657xx/sb
- stm32mp135f_dk/stm32mp135fxx
extra_args:
- platform:stm32n6570_dk/stm32n657xx/sb:SHIELD=st_b_cams_imx_mb1854
- platform:stm32mp135f_dk/stm32mp135fxx:SHIELD=st_mb1897_cam
drivers.video.renesas_ra_ceu.build:
platform_allow:
- ek_ra8d1/r7fa8d1bhecbd
Expand Down