libcamera: pipeline_handler: Split request queueing

In order to prepare to handle synchronization fences at Request
queueing time, split the PipelineHandler::queueRequest() function in
two, by creating a list of waiting requests and introducing the
doQueueRequest() function that queues requests to the device in the
order the pipeline has received them.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jacopo Mondi
2021-10-26 15:10:43 +02:00
parent a645898af5
commit 6cd5c958b7
3 changed files with 42 additions and 0 deletions
+27
View File
@@ -312,6 +312,17 @@ void PipelineHandler::queueRequest(Request *request)
{
LIBCAMERA_TRACEPOINT(request_queue, request);
waitingRequests_.push(request);
doQueueRequests();
}
/**
* \brief Queue one requests to the device
*/
void PipelineHandler::doQueueRequest(Request *request)
{
LIBCAMERA_TRACEPOINT(request_device_queue, request);
Camera *camera = request->_d()->camera();
Camera::Private *data = camera->_d();
data->queuedRequests_.push_back(request);
@@ -325,6 +336,22 @@ void PipelineHandler::queueRequest(Request *request)
}
}
/**
* \brief Queue requests to the device
*
* Iterate the list of waiting requests and queue them to the device one
* by one.
*/
void PipelineHandler::doQueueRequests()
{
while (!waitingRequests_.empty()) {
Request *request = waitingRequests_.front();
waitingRequests_.pop();
doQueueRequest(request);
}
}
/**
* \fn PipelineHandler::queueRequestDevice()
* \brief Queue a request to the device