Skip to content

Commit 09ceb2f

Browse files
author
Alain Volmat
committed
video: stm32: dcmipp: make isp handling depends on pixel pipes
ISP is part of the pixel pipes hence it doesn't make any sense to try to call ISP external handlers if the DCMIPP doesn't have pixel pipes available. Signed-off-by: Alain Volmat <[email protected]>
1 parent 9445f31 commit 09ceb2f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/video/video_stm32_dcmipp.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define STM32_DCMIPP_HAS_PIXEL_PIPES
3535
#endif
3636

37+
#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
3738
/* Weak function declaration in order to interface with external ISP handler */
3839
void __weak stm32_dcmipp_isp_vsync_update(DCMIPP_HandleTypeDef *hdcmipp, uint32_t Pipe)
3940
{
@@ -53,6 +54,7 @@ int __weak stm32_dcmipp_isp_stop(void)
5354
{
5455
return 0;
5556
}
57+
#endif
5658

5759
LOG_MODULE_REGISTER(stm32_dcmipp, CONFIG_VIDEO_LOG_LEVEL);
5860

@@ -171,11 +173,13 @@ void HAL_DCMIPP_PIPE_VsyncEventCallback(DCMIPP_HandleTypeDef *hdcmipp, uint32_t
171173
struct stm32_dcmipp_pipe_data *pipe = dcmipp->pipe[Pipe];
172174
int ret;
173175

176+
#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
174177
/*
175178
* Let the external ISP handler know that a VSYNC happened a new statistics are
176179
* thus available
177180
*/
178181
stm32_dcmipp_isp_vsync_update(hdcmipp, Pipe);
182+
#endif
179183

180184
if (pipe->state != STM32_DCMIPP_RUNNING) {
181185
return;
@@ -1029,13 +1033,13 @@ static int stm32_dcmipp_stream_enable(const struct device *dev)
10291033
goto out;
10301034
}
10311035
}
1032-
#endif
10331036

10341037
/* Initialize the external ISP handling stack */
10351038
ret = stm32_dcmipp_isp_init(&dcmipp->hdcmipp, config->source_dev);
10361039
if (ret < 0) {
10371040
goto out;
10381041
}
1042+
#endif
10391043

10401044
/* Enable the DCMIPP Pipeline */
10411045
if (config->bus_type == VIDEO_BUS_TYPE_PARALLEL) {
@@ -1082,11 +1086,13 @@ static int stm32_dcmipp_stream_enable(const struct device *dev)
10821086
}
10831087
}
10841088

1089+
#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
10851090
/* Start the external ISP handling */
10861091
ret = stm32_dcmipp_isp_start();
10871092
if (ret < 0) {
10881093
goto out;
10891094
}
1095+
#endif
10901096

10911097
pipe->state = STM32_DCMIPP_RUNNING;
10921098
pipe->is_streaming = true;
@@ -1112,11 +1118,13 @@ static int stm32_dcmipp_stream_disable(const struct device *dev)
11121118
goto out;
11131119
}
11141120

1121+
#if defined(STM32_DCMIPP_HAS_PIXEL_PIPES)
11151122
/* Stop the external ISP handling */
11161123
ret = stm32_dcmipp_isp_stop();
11171124
if (ret < 0) {
11181125
goto out;
11191126
}
1127+
#endif
11201128

11211129
/* Disable the DCMIPP Pipeline */
11221130
if (config->bus_type == VIDEO_BUS_TYPE_PARALLEL) {

0 commit comments

Comments
 (0)