From patchwork Wed Dec 2 16:13:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 29149 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 260A4C3304 for ; Thu, 3 Dec 2026 13:01:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BACA6AB3E; Thu, 3 Dec 2026 14:01:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="CBYk86LK"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 253C66AAE7 for ; Thu, 3 Dec 2026 14:01:17 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4bb64ef5a14so131076465e9.1 for ; Thu, 03 Dec 2026 05:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1796302876; x=1796907676; 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:content-type; bh=u8TpqOimc55fUq54LWfBj0WuF5mc1uh8PvoEt8Q7Ae8=; b=CBYk86LKidhERry/QD652QZwLJ6DNcxcgI6aAtOUBDv/owCGEklhKVbo7kPvIQduTB cn162EG4BAl7BMdqTWajCyFEOKJ8Nhv63rgoPxVsqcz/PkX+1nFlxWDssD+tz0+7DhIA 2r8q4gklsT5t9urGkegoaEq6JAYyyBH0pY9RrrHzgnNL/4swZpHJ1Z/GL7Nct8jHxOpr TJbTDAcWfAY5dXFzyMPwkA4gCLLaHK5eYGdWfil9CjoxfbAmVCs/Wb3rE0j0MDOT+ASv xAGh179v89DTbaHZe/YSld3AF4S11JiU8ybEDoobbyXfBDp4VNNwaqF7fIE94pfYoRyf sbAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796302876; x=1796907676; 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:content-type; bh=u8TpqOimc55fUq54LWfBj0WuF5mc1uh8PvoEt8Q7Ae8=; b=uMcR4/OZRm7s8OFuYy0KP/WkN+hEaNb6afZ1tGyV9maxqKjuQCxRULQfhWSaz+3DPW Qukgt2A8LqSmu6UczgQ8usNJgdEs6zj19Oti5Wo2fDV6bX11KKS3EvLP4B879Mv/dBcF gf8o6ty0OEWLbzbIKDGm0D4JgxI6mqQrra3/0hy7F13bm/sUiQAgJppw5zNey7S9b4lk 624rqyFO2ijiiYMGaoAHcgrvj6fsUcvv1nc35GO2TktJBQE2TaYmHz+DjIrao+ZOS2Kw 8ykMQ01PR5MOIVMdupEoqcdpr8a+8gRNzAIl1Z3uQ0yhM3hQNlOePBKvOrZsqLRC4Acs i6WA== X-Gm-Message-State: APuU4Z9MdOK8MkYWMiO3TV/n5leWItb6oiBdIFoym0ASdpcbJHcAF/nZ jvKPe3BAVuhbaZNCzBrJwpclpIEItkLOsR7KAPDinRUIoMuKsKdg+6/oM+lkzBHFij2HTezJ5xt Nm3woDlE= X-Gm-Gg: AZFdTZcxeWaDLBM1G5Y8vD2RcMtqic+HsumpPBTOV/4F7paAFKaVYVWJG8lkVhd/R78 rdFMHmAB+96k5cTJSnG7cuAKgIG8n+QxgcrFKIvzVDOTSojfmLaeM/pQkj3i2IUODryYg3SusgB uYSY1aDHdUQjXtXSb+ZrHAlKL4zB9TT8AzCRBDf3m9nn8viqGsURJWs0atSyYN9warlmxPKP0Wl B8Pr0CUTIyQ/6sCq0OoizjETihtKXPV2yYAFfjoLg3pKiZBE0SSKeYx/RS/oDcHldfqdsRGW+6E krC/zE0CofqPuz6ipC07ye013RbahdJ0tTDxFgIhtd8akKIeVqPELVcSVeLUUS20mViABB830LP yUuja9thl3rtVYCmPD6qQl+YC8KPAc44T7ng94KnJyj8p1S4lmcVKsxvfwI7DFmYae2uTzn6I0l rfp0a3fuX2bqkiaOv4O6ILEW46IUwg9qBcr+cKyNUOkOKSPlOOz6sgYCavt1jm2Ni8NHasuNq3W 9DphFDScjznRwD6P7nrFFvwpuw3hCi5F4PZZhSdOyVvxPCCgMK52YYw9FCtKKVTkmLeZv0jnTpS YbNpi2hdglZPRveXIxQx3vyTl2KmxhGHSRKvqFq11KOW31Y3dJ686MjptcIiY1HhJhoYAusyP0e PrjJcQaRxFMOuLqQCcN85QinuwOEhHCESD2SY8qHPXaKUKixrEw== X-Received: by 2002:a05:600d:1c:b0:4bb:9dbd:feb7 with SMTP id 5b1f17b1804b1-4bb9dbdff35mr553865705e9.9.1796302876273; Thu, 03 Dec 2026 05:01:16 -0800 (PST) Received: from davidp-hailo10.pitowers.org ([2a00:1098:3142:1f:9afe:54ff:fe21:ed41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe005543esm81555685e9.5.2026.12.03.05.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 05:01:15 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH v1 0/5] Extra pipeline processing "stages" for Raspberry Pi Date: Wed, 2 Dec 2026 16:13:22 +0000 Message-ID: <20261203130113.47873-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 Hi everyone Here's a reworking of my previous patch set for IPAs that can manipulate pixel values, which should now be regarded as obsolete and replaced by this new set. This time, we introduce the notion of additional "pipeline stages", that are configured by an IPA, and run under the auspices of the pipeline handler, as discussed in another previous email: https://lists.libcamera.org/pipermail/libcamera-devel/2026-November/064059.html There are 5 patches. The first two are things that I will want in future, so I've included them, but they could also be treated separately. The next two patches add the infrastructure for "pipeline stages", and the final patch adds an example stage to demonstrate how it's done. Specifically: 1. Memory map Unicam buffers on the vc4 platform. We were already doing this in the PiSP case, so we're just rationalising that. 2. Pass the PixelFormat over to the IPA. I haven't made the PixelFormat a full mojom type itself just for my use case, though we could if anyone wanted. 3. Adds the mojom configuration and per-frame structures that the IPA can use to pass information to the pipeline handler stage. 4. Infrastructure on the pipeline handler side to create the "stages", and run them asynchronously in a worker thread. 5. Add an example stage. Even once we have real stages, I'm inclined to leave this in as the canonical example as there is no significant cost. Comments always appreciated! Thanks David David Plowman (5): pipeline: rpi: vc4: Memory map the Unicam image buffers ipa: rpi: Pass raw buffer format to the IPA ipa: rpi: Add StageConfig and StageParams to the IPA interface pipeline: rpi: Add infrastructure for additional pipeline "stages" pipeline: rpi: Add an example additional pipeline "stage" include/libcamera/ipa/raspberrypi.mojom | 42 ++++- src/ipa/rpi/common/ipa_base.cpp | 49 +++++- src/ipa/rpi/common/ipa_base.h | 6 + src/ipa/rpi/controller/camera_mode.h | 3 + src/ipa/rpi/controller/example_stage_status.h | 20 +++ src/ipa/rpi/controller/meson.build | 1 + src/ipa/rpi/controller/rpi/example_stage.cpp | 63 ++++++++ src/ipa/rpi/controller/rpi/example_stage.h | 33 ++++ src/libcamera/pipeline/rpi/common/meson.build | 2 + .../pipeline/rpi/common/pipeline_base.cpp | 97 ++++++++++++ .../pipeline/rpi/common/pipeline_base.h | 36 +++++ src/libcamera/pipeline/rpi/common/stage.h | 75 +++++++++ .../pipeline/rpi/common/stage_runner.cpp | 149 ++++++++++++++++++ .../pipeline/rpi/common/stage_runner.h | 74 +++++++++ .../rpi/common/stages/example_stage.cpp | 66 ++++++++ .../rpi/common/stages/example_stage.h | 35 ++++ src/libcamera/pipeline/rpi/pisp/pisp.cpp | 41 ++++- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 41 ++++- 18 files changed, 816 insertions(+), 17 deletions(-) create mode 100644 src/ipa/rpi/controller/example_stage_status.h create mode 100644 src/ipa/rpi/controller/rpi/example_stage.cpp create mode 100644 src/ipa/rpi/controller/rpi/example_stage.h create mode 100644 src/libcamera/pipeline/rpi/common/stage.h create mode 100644 src/libcamera/pipeline/rpi/common/stage_runner.cpp create mode 100644 src/libcamera/pipeline/rpi/common/stage_runner.h create mode 100644 src/libcamera/pipeline/rpi/common/stages/example_stage.cpp create mode 100644 src/libcamera/pipeline/rpi/common/stages/example_stage.h