diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-22 02:28:20 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-11-09 23:56:21 +0200 |
commit | 056da47e2d8cbc6baa12c5d09cc0a9102517fc80 (patch) | |
tree | 93fdeb4c3ef7b3e2214d514ba01bc2e4e8d37794 | |
parent | a07968bed27638f799adb825266a8417f6f3cdb3 (diff) |
pipeline: rkisp1: Pass info pointer to tryCompleteRequest()
The tryCompleteRequest() function looks up the RkISP1FrameInfo that all
but one of its callers already look up. Remove the double look up by
passing the info pointer to tryCompleteRequest().
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/pipeline/rkisp1/rkisp1.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 56e4a62a..3d3a7086 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -168,7 +168,7 @@ private: int initLinks(Camera *camera, const CameraSensor *sensor, const RkISP1CameraConfiguration &config); int createCamera(MediaEntity *sensor); - void tryCompleteRequest(Request *request); + void tryCompleteRequest(RkISP1FrameInfo *info); void bufferReady(FrameBuffer *buffer); void paramReady(FrameBuffer *buffer); void statReady(FrameBuffer *buffer); @@ -391,7 +391,7 @@ void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &meta info->request->metadata().merge(metadata); info->metadataProcessed = true; - pipe()->tryCompleteRequest(info->request); + pipe()->tryCompleteRequest(info); } RkISP1CameraConfiguration::RkISP1CameraConfiguration(Camera *camera, @@ -1123,12 +1123,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator) * Buffer Handling */ -void PipelineHandlerRkISP1::tryCompleteRequest(Request *request) +void PipelineHandlerRkISP1::tryCompleteRequest(RkISP1FrameInfo *info) { RkISP1CameraData *data = cameraData(activeCamera_); - RkISP1FrameInfo *info = data->frameInfo_.find(request); - if (!info) - return; + Request *request = info->request; if (request->hasPendingBuffers()) return; @@ -1146,6 +1144,13 @@ void PipelineHandlerRkISP1::tryCompleteRequest(Request *request) void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer) { + ASSERT(activeCamera_); + RkISP1CameraData *data = cameraData(activeCamera_); + + RkISP1FrameInfo *info = data->frameInfo_.find(buffer); + if (!info) + return; + Request *request = buffer->request(); /* @@ -1158,7 +1163,7 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer) buffer->metadata().timestamp); completeBuffer(request, buffer); - tryCompleteRequest(request); + tryCompleteRequest(info); } void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer) @@ -1171,7 +1176,7 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer) return; info->paramDequeued = true; - tryCompleteRequest(info->request); + tryCompleteRequest(info); } void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer) @@ -1185,7 +1190,7 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer) if (buffer->metadata().status == FrameMetadata::FrameCancelled) { info->metadataProcessed = true; - tryCompleteRequest(info->request); + tryCompleteRequest(info); return; } |