[PATCH v2 6/7] libcamera: rkisp1: Remove tryCompleteRequest function
Daniel Scally
dan.scally at ideasonboard.com
Tue Feb 20 17:43:16 CET 2024
Now that tryCompleteRequest() does nothing beyond checking for the
Request's pending buffers, we can just remove the function and rely
on the return value of completeBuffer() to know if it's time to call
completeRequest() or not.
Signed-off-by: Daniel Scally <dan.scally at ideasonboard.com>
---
Changes in v2:
- New patch
src/libcamera/pipeline/rkisp1/rkisp1.cpp | 27 +++++++++---------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index ec4665a9..8331da11 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -143,7 +143,6 @@ private:
int initLinks(Camera *camera, const CameraSensor *sensor,
const RkISP1CameraConfiguration &config);
int createCamera(MediaEntity *sensor);
- void tryCompleteRequest(Request *request);
void bufferReady(FrameBuffer *buffer);
void paramReady(FrameBuffer *buffer);
void statReady(FrameBuffer *buffer);
@@ -276,8 +275,8 @@ void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &meta
request->metadata().merge(metadata);
pipe()->availableStatBuffers_.push(statBuffer);
- pipe()->completeBuffer(request, statBuffer);
- pipe()->tryCompleteRequest(request);
+ if (pipe()->completeBuffer(request, statBuffer))
+ pipe()->completeRequest(request);
}
/* -----------------------------------------------------------------------------
@@ -1104,14 +1103,6 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)
* Buffer Handling
*/
-void PipelineHandlerRkISP1::tryCompleteRequest(Request *request)
-{
- if (request->hasPendingBuffers())
- return;
-
- completeRequest(request);
-}
-
void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)
{
ASSERT(activeCamera_);
@@ -1137,8 +1128,8 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)
}
}
- completeBuffer(request, buffer);
- tryCompleteRequest(request);
+ if (completeBuffer(request, buffer))
+ completeRequest(request);
}
void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)
@@ -1146,8 +1137,9 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)
ASSERT(activeCamera_);
Request *request = buffer->request();
- completeBuffer(buffer->request(), buffer);
- tryCompleteRequest(request);
+ if (completeBuffer(buffer->request(), buffer))
+ completeRequest(request);
+
availableParamBuffers_.push(buffer);
}
@@ -1158,8 +1150,9 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)
Request *request = buffer->request();
if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
- completeBuffer(request, buffer);
- tryCompleteRequest(request);
+ if (completeBuffer(request, buffer))
+ completeRequest(request);
+
availableStatBuffers_.push(buffer);
return;
}
--
2.34.1
More information about the libcamera-devel
mailing list