[v5,11/13] libcamera: mali-c55: Enable links between resizer and video node
diff mbox series

Message ID 20241107105846.52287-12-dan.scally@ideasonboard.com
State Superseded
Headers show
Series
  • Miscellaneous Mali-C55 Pipeline Fixes
Related show

Commit Message

Dan Scally Nov. 7, 2024, 10:58 a.m. UTC
The mali-c55 driver now expects links to video devices to be enabled
in order for those devices to be streamed from / to. Enable the media
link between the resizers and their associated video device to fulfil
the requirement.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
---
Changes in v5:

	- None

 src/libcamera/pipeline/mali-c55/mali-c55.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Jacopo Mondi Nov. 11, 2024, 9:33 a.m. UTC | #1
Hi Dan

On Thu, Nov 07, 2024 at 10:58:44AM +0000, Daniel Scally wrote:
> The mali-c55 driver now expects links to video devices to be enabled
> in order for those devices to be streamed from / to. Enable the media
> link between the resizers and their associated video device to fulfil
> the requirement.
>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
> Changes in v5:
>
> 	- None
>
>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> index 97827abd..b00cbce5 100644
> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> @@ -834,6 +834,17 @@ int PipelineHandlerMaliC55::configure(Camera *camera,
>  		Stream *stream = streamConfig.stream();
>  		MaliC55Pipe *pipe = pipeFromStream(data, stream);
>
> +		/*
> +		 * Enable the media link between the pipe's resizer and the
> +		 * capture video device
> +		 */
> +		const MediaEntity *rszEntity = pipe->resizer->entity();
> +		ret = rszEntity->getPadByIndex(1)->links()[0]->setEnabled(true);
> +		if (ret) {
> +			LOG(MaliC55, Error) << "Couldn't enable resizer's link";
> +			return ret;
> +		}
> +
>  		if (isFormatRaw(streamConfig.pixelFormat))
>  			ret = configureRawStream(data, streamConfig, subdevFormat);
>  		else
> --
> 2.30.2
>
Laurent Pinchart Nov. 12, 2024, 6:40 a.m. UTC | #2
Hi Dan,

Thank you for the patch.

On Thu, Nov 07, 2024 at 10:58:44AM +0000, Daniel Scally wrote:
> The mali-c55 driver now expects links to video devices to be enabled
> in order for those devices to be streamed from / to. Enable the media
> link between the resizers and their associated video device to fulfil
> the requirement.
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
> Changes in v5:
> 
> 	- None
> 
>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> index 97827abd..b00cbce5 100644
> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
> @@ -834,6 +834,17 @@ int PipelineHandlerMaliC55::configure(Camera *camera,
>  		Stream *stream = streamConfig.stream();
>  		MaliC55Pipe *pipe = pipeFromStream(data, stream);
>  
> +		/*
> +		 * Enable the media link between the pipe's resizer and the
> +		 * capture video device
> +		 */
> +		const MediaEntity *rszEntity = pipe->resizer->entity();
> +		ret = rszEntity->getPadByIndex(1)->links()[0]->setEnabled(true);

I Would use the MediaDevice::link() function here, and verify that the
returned link is not null before proceeding. Same in other places where
this is applicable in the C55 pipeline handler. You could also cache the
link pointer in MaliC55Pipe.

> +		if (ret) {
> +			LOG(MaliC55, Error) << "Couldn't enable resizer's link";
> +			return ret;
> +		}
> +
>  		if (isFormatRaw(streamConfig.pixelFormat))
>  			ret = configureRawStream(data, streamConfig, subdevFormat);
>  		else

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
index 97827abd..b00cbce5 100644
--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp
+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp
@@ -834,6 +834,17 @@  int PipelineHandlerMaliC55::configure(Camera *camera,
 		Stream *stream = streamConfig.stream();
 		MaliC55Pipe *pipe = pipeFromStream(data, stream);
 
+		/*
+		 * Enable the media link between the pipe's resizer and the
+		 * capture video device
+		 */
+		const MediaEntity *rszEntity = pipe->resizer->entity();
+		ret = rszEntity->getPadByIndex(1)->links()[0]->setEnabled(true);
+		if (ret) {
+			LOG(MaliC55, Error) << "Couldn't enable resizer's link";
+			return ret;
+		}
+
 		if (isFormatRaw(streamConfig.pixelFormat))
 			ret = configureRawStream(data, streamConfig, subdevFormat);
 		else