Files
openwrt-master/target/linux/bcm27xx/patches-6.6/950-0437-media-bcm2835-unicam-Start-and-stop-media_pipeline-w.patch
domenico c06fb25d1f
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Initial commit
2025-06-24 14:35:53 +02:00

44 lines
1.6 KiB
Diff

From 01bb5e9e33358d6aa4f2bba838dfc180798a12e7 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 28 Mar 2023 13:43:43 +0100
Subject: [PATCH 0437/1085] media: bcm2835-unicam: Start and stop
media_pipeline with same node
media_pipeline_start and media_pipeline_stop now validate that
the pipeline is being started and stopped with the same pipe
and pad handles.
When running with embedded metadata (eg imx477 and imx708), the
start typically happens from the metadata pad, whilst stop is
always from the image pad.
Always pass the image pad to media_pipeline_start to ensure
that the calls are balanced.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/platform/bcm2835/bcm2835-unicam.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
@@ -2550,7 +2550,8 @@ static int unicam_start_streaming(struct
goto err_streaming;
}
- ret = media_pipeline_start(node->video_dev.entity.pads, &node->pipe);
+ ret = media_pipeline_start(dev->node[IMAGE_PAD].video_dev.entity.pads,
+ &dev->node[IMAGE_PAD].pipe);
if (ret < 0) {
unicam_err(dev, "Failed to start media pipeline: %d\n", ret);
goto err_pm_put;
@@ -2644,7 +2645,8 @@ err_vpu_clock:
unicam_err(dev, "failed to reset the VPU clock\n");
clk_disable_unprepare(dev->vpu_clock);
error_pipeline:
- media_pipeline_stop(node->video_dev.entity.pads);
+ if (node->pad_id == IMAGE_PAD)
+ media_pipeline_stop(dev->node[IMAGE_PAD].video_dev.entity.pads);
err_pm_put:
unicam_runtime_put(dev);
err_streaming: