[v2,10/16] pipeline: rkisp1: Add error log when parameter queuing fails
diff mbox series

Message ID 20250808141315.413839-11-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Implement WDR algorithm
Related show

Commit Message

Stefan Klug Aug. 8, 2025, 2:12 p.m. UTC
When the extensible parameters queued to the kernel contain an unknown
block type it fails with -EINVAL. This should not happen as user land is
supposed to check for the supported parameter types. But it took a while
to figure out where things went wrong. Add a error statement when
queuing of the parameter buffer fails for whatever reason.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

---

Changes in v4:
- Improved commit message

Changes in v3:
- Collected tags
- Removed hint regarding unsupported parameter types as this will be
  handled using the now upstreamed RKISP1_CID_SUPPORTED_PARAMS_BLOCKS.

Changes in v2:
- Also print the error code in case of failure
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Dan Scally Aug. 12, 2025, 11:50 a.m. UTC | #1
On 08/08/2025 15:12, Stefan Klug wrote:
> When the extensible parameters queued to the kernel contain an unknown
> block type it fails with -EINVAL. This should not happen as user land is
> supposed to check for the supported parameter types. But it took a while
> to figure out where things went wrong. Add a error statement when
> queuing of the parameter buffer fails for whatever reason.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> 
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
> 
> Changes in v4:
> - Improved commit message
> 
> Changes in v3:
> - Collected tags
> - Removed hint regarding unsupported parameter types as this will be
>    handled using the now upstreamed RKISP1_CID_SUPPORTED_PARAMS_BLOCKS.
> 
> Changes in v2:
> - Also print the error code in case of failure
> ---
>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 8b434a56ea04..06785cb2fd57 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -429,7 +429,14 @@ void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused
>   		return;
>   
>   	info->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;
> -	pipe->param_->queueBuffer(info->paramBuffer);
> +
> +	int ret = pipe->param_->queueBuffer(info->paramBuffer);
> +	if (ret < 0) {
> +		LOG(RkISP1, Error) << "Failed to queue parameter buffer: "
> +				   << strerror(-ret);
> +		return;
> +	}
> +
>   	pipe->stat_->queueBuffer(info->statBuffer);
>   
>   	if (info->mainPathBuffer)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 8b434a56ea04..06785cb2fd57 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -429,7 +429,14 @@  void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused
 		return;
 
 	info->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;
-	pipe->param_->queueBuffer(info->paramBuffer);
+
+	int ret = pipe->param_->queueBuffer(info->paramBuffer);
+	if (ret < 0) {
+		LOG(RkISP1, Error) << "Failed to queue parameter buffer: "
+				   << strerror(-ret);
+		return;
+	}
+
 	pipe->stat_->queueBuffer(info->statBuffer);
 
 	if (info->mainPathBuffer)