From patchwork Thu Mar 12 15:10:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 26277 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9912ABE086 for ; Thu, 12 Mar 2026 16:00:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A900F6262B; Thu, 12 Mar 2026 17:00:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Lk61WQPh"; dkim-atps=neutral Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2181162010 for ; Thu, 12 Mar 2026 17:00:15 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-439ce3605ecso970482f8f.0 for ; Thu, 12 Mar 2026 09:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1773331214; x=1773936014; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=L1kt/0ZagNJFzjH/9h/xm3IFgZuTXMJgAI2PP/m63xs=; b=Lk61WQPhb/TMecm1UuMlty8NgYnSG3IVe59KE26jD2Qp7WQpDFXCpJZ3cc9rVWGZZ2 tK6pL9fSiH2d4bHY0eDQBs77XYaDnQ9O6MeoOWzV9p/jnOrkrisSQIxp+24JedKLCPX+ wtccxR/gvVvmzi2u7QDzCpQ2P+VeK5ceMk2Iwar8mN/dWBOc5B9k/kiVvMCvcovmxtfk AwGLIFYqJ63p+cVV7tRQXd/4RXwZ0Y2vuctx2VtPb/ntAtkIgxF5u3OOf8c+6EtI/Tay bAkzDRd7iZ2AValRaHnE9pEEwSEvtGPHB1zjuxoZybDVtNW1GFQMZbp3iU3Xho6Imyuu OhNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773331214; x=1773936014; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=L1kt/0ZagNJFzjH/9h/xm3IFgZuTXMJgAI2PP/m63xs=; b=GJt1y7QILkHyXw4Ap91LYdnHqrco7I9ZSQ35FuX75p47CQ2WFqV+q7OZL3POuptCXO RaCbC6iemEN9hyLA7pX56Gi4zZ6q1m+icvSufPQzdjqy0mOD1eWA0OvMC4FRu7Du0kzq +rN8OzEhWO0w4fY6ftAnh9NNiKSK3q97u9QRA+ZqaZFL1uXIxEsx09I0qhAgtGcLEzB3 HqFoicQtdlvrPQXOeoptaK9I3wEK8PpnxpYlhPZEdiDHf0xUSTTsKWTQINKxudYhjXwO hPbre0nJCrRhI/8OlMd0qI5ilfdYbKJhYuTeNqwiG2HczcgjGHHqs5hu1/v8qCiuHSec 3BbA== X-Gm-Message-State: AOJu0YwF/D9n4RmZwjETCzCuPBk/Ldco5Q7zFtScz3++I7vSF4NCNCPE RZymSTQ14SeyB9tfrRFNr4QJbjVQAhy0c0u8Kg3oIwmJyndHia6lp8OF/olmQRSTqULX+jLkC5S Ld422zyc= X-Gm-Gg: ATEYQzx7OPcFSyioKGtcSSEC7K72jacEmCpJRtC02GUVHNa7+XPB6e7TOP2zlmiDuvJ CSKciE89q4bKOJpa3sRwuBUixHIGX9q6maEk2qmAYI0/EsgkyJP/uJ+LBXH6t9PdRTtQWgvLC7D gwkkFAjr9sroUT2oCdTxIWjv1t4jW9Nqsq7Vk1HdF+m3M4XVElEwd9LxrlGyg3YUK73Sgbyc0ZH 5OmxBlZd73lH8oClSa++7QEbzjpBbVLzEPSoa+YUb3oq662LWJYaWzORXb+6C6GBDn5R3fpI+fB 5K2PDLC7joXKt11hk8G6WfV9hRCnIm5TJS2eutZjHRpKHDI+iQuPKnLKOglCEJ1V1V+MQq7uyex lB4W+kWsniRZQptJ+oX7vyQVGVZ+6pg8uyib29EBOeEXp1WAA2HpXRsHvJ9NsE+sTCcRLD+C+EV Hr5kwDnjcowndm1f7S0lqKt/0YxNir9NAsvg9uAhsH0GM6SPtJeveA0wyney6CWIgwQS9rik/q4 uIQ1qxRVfbEGw+MEPN5r5SkY6oIPXJUHuIUkAA9Rw== X-Received: by 2002:a05:6000:310a:b0:439:b7b5:b1d1 with SMTP id ffacd0b85a97d-43a04d86393mr398740f8f.18.1773331214023; Thu, 12 Mar 2026 09:00:14 -0700 (PDT) Received: from davidp-pi5.pitowers.org ([2a00:1098:3142:1f:88ea:c658:5b20:5e46]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe1abf84sm9084111f8f.14.2026.03.12.09.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 09:00:13 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [RFC PATCH v2 0/1] Add queueControls mechanism Date: Thu, 12 Mar 2026 15:10:37 +0000 Message-ID: <20260312160009.18654-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi everyone Here's a version of Barnabas's previous patch (hence "v2") that added a separate applyControls function, to bypass the request queue. If you recall, I was a fan of this one. I've re-worked it only slightly, replacing the single pending ControlList with a queue, which is the functionality that was important to us. To make that explicit, I've renamed "applyControls" to "queueControls" everywhere. I've also tried, in passing, to answer some of the hanging questions: * Like requests, I've not allowed controls to be queued before the camera is running. Don't feel strongly either way, really. * I've allowed queueing empty ControlLists. Doing this allows you to get "another frame like the last one". * I clear out all pending controls when the camera stops. If an application needs to be sure they have been applied, it should wait (which kind of leads us on to PFC, but not a subject for this patch!). Or if it doesn't want to wait, it should re-apply any in-question values when it re-starts the camera. * I'm using the fallback only when the PH explicitly doesn't support queueControlsDevice. Really, if it's supported it's got to work every time, even if that only means putting it in a queue in the PH. Having some ControlLists go into the PH here, and then to have it fail and put others into the pending queue, just feels entirely confusing! * In the fallback case I'm copying the ControlList so that we can recover if the request fails to queue. Firstly, I don't think this is too horrible, and anyway, it's a fallback. If anyone cares about this they should implement queueControlsDevice. TBH, I'm a bit unconvinced by the whole fallback thing. We (RPi) always queue up lots of requests as soon as we can, and to my understanding they all go through to our PH pretty much straight away, which kind of nullifies the whole point. But maybe other PHs behave differently? Always happy to be corrected on any misconceptions! Thanks David David Plowman (1): libcamera: Add independent queue for ControlLists include/libcamera/camera.h | 1 + include/libcamera/internal/camera.h | 1 + include/libcamera/internal/pipeline_handler.h | 7 ++ src/libcamera/camera.cpp | 61 +++++++++++++++ src/libcamera/pipeline_handler.cpp | 76 +++++++++++++++++++ 5 files changed, 146 insertions(+)