[v2,33/35] pipeline: rkisp1: Add warning to unclear format handling
diff mbox series

Message ID 20251023144841.403689-34-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Full dewarper support on imx8mp
Related show

Commit Message

Stefan Klug Oct. 23, 2025, 2:48 p.m. UTC
It is not mentioned when the sensorFormat is allowed to have zero size.
Add a warning and todo to that case but leave it in place for now.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Umang Jain Oct. 25, 2025, 1:19 p.m. UTC | #1
On Thu, Oct 23, 2025 at 04:48:34PM +0200, Stefan Klug wrote:
> It is not mentioned when the sensorFormat is allowed to have zero size.
> Add a warning and todo to that case but leave it in place for now.
> 

CameraSensor::getformat() documentation mentions this no ?

and both derived classes seem to log a debug message if a size
cannot be decided.

	if (!bestSize) {
		LOG(CameraSensor, Debug) << "No supported format or size found";
		return {};
	}


> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index da3cfc0ffdeb..9a156d4a01f2 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -782,8 +782,16 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
>  	sensorFormat_ = sensor->getFormat(mbusCodes, accumulatedSensorSize,
>  					  mainPath->maxResolution());
>  
> -	if (sensorFormat_.size.isNull())
> +	if (sensorFormat_.size.isNull()) {
> +		/*
> +		 * \todo When can this happen? Should we return a failure in
> +		 * this case?
> +		 */
>  		sensorFormat_.size = sensor->resolution();
> +		LOG(RkISP1, Warning)
> +			<< "Failed to select sensor format. Default to "
> +			<< sensorFormat_;
> +	}
>  
>  	return status;
>  }
> -- 
> 2.48.1
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index da3cfc0ffdeb..9a156d4a01f2 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -782,8 +782,16 @@  CameraConfiguration::Status RkISP1CameraConfiguration::validate()
 	sensorFormat_ = sensor->getFormat(mbusCodes, accumulatedSensorSize,
 					  mainPath->maxResolution());
 
-	if (sensorFormat_.size.isNull())
+	if (sensorFormat_.size.isNull()) {
+		/*
+		 * \todo When can this happen? Should we return a failure in
+		 * this case?
+		 */
 		sensorFormat_.size = sensor->resolution();
+		LOG(RkISP1, Warning)
+			<< "Failed to select sensor format. Default to "
+			<< sensorFormat_;
+	}
 
 	return status;
 }