libcamera: ipu3: Get request from information structure instead of buffer

Buffers dequeued from the ImgU may not be associated with a Request as
they are internal (statistics, parameters and some RAW buffers). Fetch
the request they are used for from the frame information instead.

Fixes: 9708f49fec ("libcamera: ipu3: Share parameter and statistic buffers with IPA")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2021-02-05 16:27:06 +01:00
parent 4625132b90
commit 03def6e947
+7 -7
View File
@@ -1121,14 +1121,14 @@ void IPU3CameraData::queueFrameAction(unsigned int id,
*/
void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
{
Request *request = buffer->request();
pipe_->completeBuffer(request, buffer);
IPU3Frames::Info *info = frameInfos_.find(buffer);
if (!info)
return;
Request *request = info->request;
pipe_->completeBuffer(request, buffer);
request->metadata().set(controls::draft::PipelineDepth, 3);
/* \todo Move the ExposureTime control to the IPA. */
request->metadata().set(controls::ExposureTime, exposureTime_);
@@ -1157,7 +1157,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)
if (!info)
return;
Request *request = buffer->request();
Request *request = info->request;
/* If the buffer is cancelled force a complete of the whole request. */
if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
@@ -1186,7 +1186,7 @@ void IPU3CameraData::paramBufferReady(FrameBuffer *buffer)
info->paramDequeued = true;
if (frameInfos_.tryComplete(info))
pipe_->completeRequest(buffer->request());
pipe_->completeRequest(info->request);
}
void IPU3CameraData::statBufferReady(FrameBuffer *buffer)
@@ -1198,7 +1198,7 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)
if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
info->metadataProcessed = true;
if (frameInfos_.tryComplete(info))
pipe_->completeRequest(buffer->request());
pipe_->completeRequest(info->request);
return;
}