libcamera: rkisp1: Create main buffer pool out of if(!isRaw)
diff mbox series

Message ID 20241028101525.21369-1-jacopo.mondi@ideasonboard.com
State Accepted
Commit e1d45a17f76d5d125d44409b259114b087a4bfe3
Headers show
Series
  • libcamera: rkisp1: Create main buffer pool out of if(!isRaw)
Related show

Commit Message

Jacopo Mondi Oct. 28, 2024, 10:15 a.m. UTC
The "useDewarper_" class variable is set to true during configure
only if the configuration is !isRaw.

The main path buffer pool creation can thus be moved out of the
if (!isRaw) block at allocateBuffers() time.

Cosmetic change that will make it easier to create a buffer pool
for the main and self paths unconditionally in future.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Umang Jain Oct. 31, 2024, 5:44 a.m. UTC | #1
Hi Jacopo

Thank you for the patch.

On 28/10/24 3:45 pm, Jacopo Mondi wrote:
> The "useDewarper_" class variable is set to true during configure
> only if the configuration is !isRaw.
>
> The main path buffer pool creation can thus be moved out of the
> if (!isRaw) block at allocateBuffers() time.
>
> Cosmetic change that will make it easier to create a buffer pool
> for the main and self paths unconditionally in future.
>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 83b74b27652f..20fb9765727f 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -927,16 +927,16 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)
>   		ret = stat_->allocateBuffers(maxCount, &statBuffers_);
>   		if (ret < 0)
>   			goto error;
> +	}
>   
> -		/* If the dewarper is being used, allocate internal buffers for ISP. */
> -		if (useDewarper_) {
> -			ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);
> -			if (ret < 0)
> -				goto error;
> +	/* If the dewarper is being used, allocate internal buffers for ISP. */
> +	if (useDewarper_) {
> +		ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);
> +		if (ret < 0)
> +			goto error;
>   
> -			for (std::unique_ptr<FrameBuffer> &buffer : mainPathBuffers_)
> -				availableMainPathBuffers_.push(buffer.get());
> -		}
> +		for (std::unique_ptr<FrameBuffer> &buffer : mainPathBuffers_)
> +			availableMainPathBuffers_.push(buffer.get());
>   	}
>   
>   	for (std::unique_ptr<FrameBuffer> &buffer : paramBuffers_) {

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 83b74b27652f..20fb9765727f 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -927,16 +927,16 @@  int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)
 		ret = stat_->allocateBuffers(maxCount, &statBuffers_);
 		if (ret < 0)
 			goto error;
+	}
 
-		/* If the dewarper is being used, allocate internal buffers for ISP. */
-		if (useDewarper_) {
-			ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);
-			if (ret < 0)
-				goto error;
+	/* If the dewarper is being used, allocate internal buffers for ISP. */
+	if (useDewarper_) {
+		ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);
+		if (ret < 0)
+			goto error;
 
-			for (std::unique_ptr<FrameBuffer> &buffer : mainPathBuffers_)
-				availableMainPathBuffers_.push(buffer.get());
-		}
+		for (std::unique_ptr<FrameBuffer> &buffer : mainPathBuffers_)
+			availableMainPathBuffers_.push(buffer.get());
 	}
 
 	for (std::unique_ptr<FrameBuffer> &buffer : paramBuffers_) {