media: rp1: cfe: Fail streaming if FE_CONFIG node is not enabled
authorNaushir Patuck <naush@raspberrypi.com>
Wed, 4 Oct 2023 08:39:59 +0000 (09:39 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:03 +0000 (11:35 +0000)
When the FE is enabled, ensure that the FE_CONFIG node is enabled.
Otherwise fail cfe_start_streaming() entirely.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/media/platform/raspberrypi/rp1_cfe/cfe.c

index 8478b87..7e0a667 100644 (file)
@@ -997,6 +997,14 @@ static int cfe_start_streaming(struct vb2_queue *vq, unsigned int count)
                goto err_streaming;
        }
 
+       /* When using the Frontend, we must enable the FE_CONFIG node. */
+       if (is_fe_enabled(cfe) &&
+           !check_state(cfe, NODE_ENABLED, cfe->node[FE_CONFIG].id)) {
+               cfe_err("FE enabled, but FE_CONFIG node is not\n");
+               ret = -EINVAL;
+               goto err_streaming;
+       }
+
        ret = media_pipeline_start(&node->pad, &cfe->pipe);
        if (ret < 0) {
                cfe_err("Failed to start media pipeline: %d\n", ret);