From patchwork Tue Jun 30 09:00:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 27141 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 41673C3261 for ; Tue, 30 Jun 2026 09:02:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0496865F5E; Tue, 30 Jun 2026 11:02:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="JMp5MbI5"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CB883658C5 for ; Tue, 30 Jun 2026 11:02:26 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-493bd302c91so17795e9.3 for ; Tue, 30 Jun 2026 02:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1782810146; x=1783414946; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZnzHEQt4EwC9uN8oitaivu1h/kOcnd2zgGIMaZwhoOI=; b=JMp5MbI5bJHrqQjCU4X8CrZ3UFrjr8nZFX/p9iweqjh4ihZxaIN44nQHMPUNieBmtb XMeiXTgyG9L/FHZXKLbhdwRguJS1Bu2PZLvDo7NwMAX9eatP7weLmLzmsDBejlnPrX7b Rmg6Pb3JZMsrsF76fLbCuXWMlZbr8pWX+5UMe9eBmbUgpzniAD3yXZRkxQjuO2YOnrLp rCBybmSnwRhV/OxE6I254u/MQbhtE7hZwYECw7ZMr9Jyu5qNxgZRYEpOWTJk1YUxGJyF AToz9HA/5EQJLyZU1tPT1aqzrzbtDNhxigWJ3chmlcm3/e2VunyZPr62G909sqzSXZ/6 jA1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782810146; x=1783414946; h=content-transfer-encoding:mime-version:references:in-reply-to :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=ZnzHEQt4EwC9uN8oitaivu1h/kOcnd2zgGIMaZwhoOI=; b=h+WLr7Q9F977LAZCI2luf1XpmCLCp8f0kPsrFRSieUoh+FDj5132hCrdpoqxkF6MaO x1sw+7Xv72fvprYlX5l5ESobhymWwx0koqUigM4hzeIbC3oz1Rh6RQ0TbuK2pggLh4QT fK0cYbw4bCIG3OlUZCWCC1CcJhUbwL1yQVo0d1rToJquhjIwU33pD6rMs6Alflt2QBZr 6bPCEVNk5BaNcFHENwOOvOPRhY8Z0lmhj9zLzlzVFG+NLHegwMaL+n5zacfRf4H8MnBD ulL5y2G10P/G3yxOhsX6u2vyWGjpNBfkyBITTFJVdnlJqEcZ5SluKLdXzKuflwd3qyYf rQwg== X-Gm-Message-State: AOJu0Yw8hxy+RxYUfsPfjvToNFrgVQSgyXihQYKbfcRpCLTKgXCh2GAZ Y7cUJ/7Ypl3DlFHh7QqoRTONUhA/X/1hpM6ZjVe6HYiW+OB5NKrT89ttq+9refL1N+4yKR8GjR8 6Gs/o6Kk= X-Gm-Gg: AfdE7cnR0PZXGUV7krDq21CdcsgCi+fd5aurGMtaMJMi1P/LaYkufO4jlknplBRiiYg LaLOHoBgFxuSQqk1IwC9K7PimHyH+plC2gj6HYxCud74TqhcptWrAcLaCOdNzUaSElSXRxiP7W8 CMxqlVRMYuVvjCjtnbL7F+LmDQfETF/fZ2cbtWi5zqPH5pyuYfEDcvp+CiCksfuHwi5A7PhMZcf STVqLWbEpn1AZLIuYMgI19FrJrzsZlzhnVs3CTGTFOKwZAZIqFChwy/ufoWrZrongOes3tOMP6p hXkOUx/3FQvZg1yWdWBXLR96I8BKHGqGF97MYqdas1SSPVuYnHsL4NWhEH6i2qOuJUPY8/86Zd2 aeLTuLk0zY8GRZvvbKxca/Nx7hOy1O4PdkwpPorjysev9vA5qoWcRSDLihWXC23nt67wcC/EY1K aI9lKLwDf9+x7DVfw8k8Y87dcdsPtt8pLKjCD2INMNsMaJCbvsdkKoE845LRiQLw5mgtDlp/yg5 OUpiOGd8IVE/EO78988TM9l7ixZMmCvje6Rhghf+YuedH5bEM1EtXurFbMmK83Zk5vz29rJj+WA VScLAcN3nAK4GTUmcyBf X-Received: by 2002:a05:600c:3e85:b0:493:2f0f:db7e with SMTP id 5b1f17b1804b1-493b8279d73mr20955625e9.2.1782810146198; Tue, 30 Jun 2026 02:02:26 -0700 (PDT) Received: from naush-dell.pitowers.org ([2a00:1098:3142:1f:9aa7:43e2:6907:a5c1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493b8c8d92dsm56635285e9.0.2026.06.30.02.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 02:02:25 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH v2 1/1] pipeline: rpi: pisp: Ensure we don't run our SW correction with packed Date: Tue, 30 Jun 2026 10:00:20 +0100 Message-ID: <20260630090215.813311-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260630090215.813311-1-naush@raspberrypi.com> References: <20260630090215.813311-1-naush@raspberrypi.com> 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" Due to hardware bugs in the CSI-2 RX, we need to unpack 14-bit CSI-2 packed samples and swap endian order in 16-bit samples both in software. These SW routines only work on unpacked/uncompresssed samples. For this reason, ensure the user cannot configure 14/16-bit RAW streams with PiSP Bayer compression in platformValidate(). Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/libcamera/pipeline/rpi/pisp/pisp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp index b744c901f751..8e8da116ef6f 100644 --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp @@ -1223,6 +1223,17 @@ PiSPCameraData::platformValidate(RPi::RPiCameraConfiguration *rpiConfig) const status = CameraConfiguration::Adjusted; } + unsigned bpp = MediaBusFormatInfo::info(rpiConfig->sensorFormat_.code).bitsPerPixel; + if ((bpp == 16 || bpp == 14) && + bayer.packing != BayerFormat::Packing::None) { + LOG(RPI, Info) + << "The sensor is configured for a 16/14-bit output, " + << "compression is not available for SW fixups needed."; + bayer.packing = BayerFormat::Packing::None; + rawStream->pixelFormat = bayer.toPixelFormat(); + status = CameraConfiguration::Adjusted; + } + rawStreams[0].format = RPi::PipelineHandlerBase::toV4L2DeviceFormat(cfe_[Cfe::Output0].dev(), rawStream);