libcamera: pipeline: ipu3: Try queuing pending requests if a buffer is available
IPU3CameraData stores requests that have been failed due to a buffer shortage. The requests should be retried once enough buffers are available. This sets the retry function as signal to CIO2Device and IPU3Frame, and invokes it from CIO2Device::tryReturnBuffer() and IPU3Frame::remove(). Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
89dae58449
commit
5a9d19210f
@@ -302,6 +302,8 @@ void CIO2Device::tryReturnBuffer(FrameBuffer *buffer)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bufferAvailable.emit();
|
||||
}
|
||||
|
||||
void CIO2Device::freeBuffers()
|
||||
|
||||
@@ -56,6 +56,8 @@ public:
|
||||
Signal<FrameBuffer *> &bufferReady() { return output_->bufferReady; }
|
||||
Signal<uint32_t> &frameStart() { return csi2_->frameStart; }
|
||||
|
||||
Signal<> bufferAvailable;
|
||||
|
||||
private:
|
||||
void freeBuffers();
|
||||
|
||||
|
||||
@@ -103,6 +103,8 @@ bool IPU3Frames::tryComplete(IPU3Frames::Info *info)
|
||||
|
||||
remove(info);
|
||||
|
||||
bufferAvailable.emit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class FrameBuffer;
|
||||
@@ -49,6 +51,8 @@ public:
|
||||
Info *find(unsigned int id);
|
||||
Info *find(FrameBuffer *buffer);
|
||||
|
||||
Signal<> bufferAvailable;
|
||||
|
||||
private:
|
||||
std::queue<FrameBuffer *> availableParamBuffers_;
|
||||
std::queue<FrameBuffer *> availableStatBuffers_;
|
||||
|
||||
@@ -701,6 +701,8 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera)
|
||||
data->ipa_->mapBuffers(ipaBuffers_);
|
||||
|
||||
data->frameInfos_.init(imgu->paramBuffers_, imgu->statBuffers_);
|
||||
data->frameInfos_.bufferAvailable.connect(
|
||||
data, &IPU3CameraData::queuePendingRequests);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1147,6 +1149,8 @@ int PipelineHandlerIPU3::registerCameras()
|
||||
*/
|
||||
data->cio2_.bufferReady().connect(data.get(),
|
||||
&IPU3CameraData::cio2BufferReady);
|
||||
data->cio2_.bufferAvailable.connect(
|
||||
data.get(), &IPU3CameraData::queuePendingRequests);
|
||||
data->imgu_->input_->bufferReady.connect(&data->cio2_,
|
||||
&CIO2Device::tryReturnBuffer);
|
||||
data->imgu_->output_->bufferReady.connect(data.get(),
|
||||
|
||||
Reference in New Issue
Block a user