summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-10-26 15:10:43 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-12-11 17:53:40 +0100
commit6cd5c958b738dd7b06605adff915093f9fe0d513 (patch)
treefae2e6e6c6257eda52a77e9ea69e6f2fcbcc83e7 /src
parenta645898af50396a4ae1b32e418c21011c8b3f99d (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline_handler.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 67fdf1d8..2374c289 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -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);
@@ -326,6 +337,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
* \param[in] camera The camera to queue the request to