[{"id":39364,"web_url":"https://patchwork.libcamera.org/comment/39364/","msgid":"<CAHW6GYJhp9-B-3ZA25DSruxRaFi-gjmmJcVZEU6NmDUU4Lk03g@mail.gmail.com>","date":"2026-06-24T08:46:17","subject":"Re: [PATCH 2/2] pipeline: rpi: pisp: Ensure we don't run our SW\n\tcorrection with packed","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Wed, 24 Jun 2026 at 09:35, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Due to hardware bugs in the CSI-2 RX, we need to unpack 14-bit CSI-2\n> packed samples and swap endian order in 16-bit samples both in software.\n> These SW routines only work on unpacked/uncompresssed samples.\n>\n> For this reason, ensure the user cannot configure 14/16-bit RAW streams\n> with PiSP Bayer compression in platformValidate().\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/rpi/pisp/pisp.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> index b744c901f751..8e8da116ef6f 100644\n> --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> @@ -1223,6 +1223,17 @@ PiSPCameraData::platformValidate(RPi::RPiCameraConfiguration *rpiConfig) const\n>                         status = CameraConfiguration::Adjusted;\n>                 }\n>\n> +               unsigned bpp = MediaBusFormatInfo::info(rpiConfig->sensorFormat_.code).bitsPerPixel;\n> +               if ((bpp == 16 || bpp == 14) &&\n> +                   bayer.packing != BayerFormat::Packing::None) {\n> +                       LOG(RPI, Info)\n> +                               << \"The sensor is configured for a 16/14-bit output, \"\n> +                               << \"compression is not available for SW fixups needed.\";\n> +                       bayer.packing = BayerFormat::Packing::None;\n> +                       rawStream->pixelFormat = bayer.toPixelFormat();\n> +                       status = CameraConfiguration::Adjusted;\n> +               }\n> +\n>                 rawStreams[0].format =\n>                         RPi::PipelineHandlerBase::toV4L2DeviceFormat(cfe_[Cfe::Output0].dev(), rawStream);\n>\n> --\n> 2.53.0\n>\n\nThis looks fine to me. Packing/compression can't possibly work for 14\nor 16 bit formats as things stand, so fixing it like this (with a\nlittle complaint), is probably the best workaround. I suppose maybe\n\"Warning\" level rather than \"Info\"? But really not bothered either\nway...\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\n\nDavid","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 378BFC3307\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Jun 2026 08:46:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1AA0765884;\n\tWed, 24 Jun 2026 10:46:30 +0200 (CEST)","from mail-ed1-x533.google.com (mail-ed1-x533.google.com\n\t[IPv6:2a00:1450:4864:20::533])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D4DBC65871\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2026 10:46:28 +0200 (CEST)","by mail-ed1-x533.google.com with SMTP id\n\t4fb4d7f45d1cf-697f3af8749so775093a12.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2026 01:46:28 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"KwM1eC4g\"; dkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1782290788; cv=none;\n\td=google.com; s=arc-20240605;\n\tb=C0y3mLmSMtjTtTmOCAIrf8zF+gVO28vnFNShn1G45tdfL7mg6cwA2Jaxkk+lGBGu+b\n\t4E6aJkW0xdYY0vptPXDkslfZfkmVyRlsBJ4r0W59jDAIjlWkUzo3rljxbw7N/0uDHLj9\n\tFq1AjJ2Ac2IXeHnaGwmn24upDpfSjgOnDXfM3SptuNJ8lkzYmUzecxUQFLphJDbkaNR1\n\t5uNBikonHUJQJHcT/mbZDRnYm5ZuSx/Mwlfxq6a5eLoVZZ5ONtO8v32YeHS894tBOhSi\n\tXYTfmE8bNvjENwiDCxBWfLz00dak/wWhmXKWzvg1mfvXg5WVf00MoNWnqDUG7XmPxAfj\n\teTzw==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20240605; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:dkim-signature;\n\tbh=we0hQYK1vFC/jwWPcv+FbtSQiGRrjAhzgjKdvPEB84A=;\n\tfh=24Q+cvxO2MyQyOWig8dQzAv5WkSICwpSuSPmFCG0Zgc=;\n\tb=jk+p9BhJWvFCA1EGjbalXcOFrUBpp5JcErGgXg6Wqh2eKpe+4pBGsPrNqgGEBtWbqZ\n\tZ2oaUBJD5wSLPtOqmKBJOlTpY5QNtXzc/JuYM+UrEn3p21r/nSpyXovBEeK55swX+cM1\n\tXxBaCVzLIFqmFAPxs3FdSUbrxjOrCGJ9A5OnyTJIZKZDXjBm5daFIkBoTeouOCr4GsKS\n\tXKzcwtV/JxpZdWZWU7eKHV4KbVg8HOUhJkglIdUao/5BTQCSiKhsQZzw3vPaRGTfqtQl\n\tjDOAuVgoX1DT423CUsvkzOmQ500d5mjIcgAiKewYfhfEUXTLXAEMC+AHgxlfzMcpotM3\n\tYKtA==; darn=lists.libcamera.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1782290788; x=1782895588;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=we0hQYK1vFC/jwWPcv+FbtSQiGRrjAhzgjKdvPEB84A=;\n\tb=KwM1eC4gDkR/gQ0dQhuy+WcIWqX9hFMQxWFOlNuN8mMLOqCrE0QduN5GlGcPTS2ZGb\n\t7JrDJR9tr0pd6A0NIXaML+zgRtXP71ixLMr3Tp3KZruA6yoMeyLfUhiy4PDGJw3DKuGD\n\tVcu/CT3zw47x0wRx5gHgbpM502I7sU2+cQb2pPO+OO11Ll2kZC5dtxEhlwzG7rKg0Scv\n\tbrsmsITSNxLq1STeiXL5zN4HM2/BF274PBFUCxuyvOFPsLlkS++Om/ROUpCZuxMlxiEQ\n\tQvhHYnP4yJduuEXFETLho/DEbbqqtUZyEHXLyKyMxGs3xMnmpqFo2cA2vcT7rhprbm/h\n\tT0Kw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782290788; x=1782895588;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=we0hQYK1vFC/jwWPcv+FbtSQiGRrjAhzgjKdvPEB84A=;\n\tb=NKNqndYxZwSXDw2dVppUXPljoqOxF2IgRZSXqI3GJduxvmKlcnH967uza7kvGpuwr3\n\tmnD4M0ddLjt6MkfOUKX2XZ2yfc6rybiy1MdG8vfrJRFXQcW7WAzPkFRgB1BAMImrtbMK\n\tmYZHs8EzVGu6X+zmO/ePxTHOY9VKhTPT6PGfjmcjP+HIdPV9KG927VNVXov3+XtsVTCW\n\t9gaGUOZqnxHGvPc0VXQsPFirtyuLrJzoOfph4qX5ZkXaZoek0AtFuQN7LCR+Jem2cLuv\n\tpGvy22rluQ9n6+F3VrOVnqJGPS020qCjOf516biDamntd1ANhpQiHBvpB98Yoy9e2bY/\n\tj1AA==","X-Gm-Message-State":"AOJu0YxrICLwWu72G+nbP0nVN9URK1QdQOKsquOOCxfJAq5Sm452YDdL\n\t0Rg/RB9z+y0BvANP/31y6mfXbhbpkyq5HA2kckGmIOTG56WMHQhMpAsUfXv3YMtiYK0bchrGEvF\n\t81IrBDnpigNv55+ug6u4whGg6a8XKMSqOgBhvM84+bQ==","X-Gm-Gg":"AfdE7cmzG7DQMzR2C+avW4GBAaI+cbUufzX1bUR77kHSE9uEzSHmUAtR6DwpJuei6/r\n\tnmcmjxnTzU61MnxfM+5NDrF9sMdMz2oAi7B8r/4xnQk1jhz1zppLIWpuoNrG1eNnZMo3MbPJhTD\n\tNrxzBA0LnkLGbkCzgKIwltJubzzXmKxJddPFVKL7cKgFE9LzCpSojJk0pX7VZuJ8ADaAX260xga\n\tZDHqz7esX4WOF5FP6ctNy+qzpPTsHJGuHqiqtVZ3O/US9y+vh2mDD79iroRtBOxw+9IOLvN50/x\n\tdYj8HAIuqKudC/2X831VYA9rc75wkOpAKRdU+ws3bYWIo2FOHSlWwmW0/+yQJD9T2gwX15oOxiK\n\tCLlmRU+BSwlb84g==","X-Received":"by 2002:a05:6402:270d:b0:68d:623a:bc77 with SMTP id\n\t4fb4d7f45d1cf-697f387a516mr1007069a12.8.1782290788181;\n\tWed, 24 Jun 2026 01:46:28 -0700 (PDT)","MIME-Version":"1.0","References":"<20260624082705.272795-1-naush@raspberrypi.com>\n\t<20260624082705.272795-3-naush@raspberrypi.com>","In-Reply-To":"<20260624082705.272795-3-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Wed, 24 Jun 2026 09:46:17 +0100","X-Gm-Features":"AVVi8Cexdvr1f3GbjthJZsEvHrj31xN2UAwYSOnWNErV3jbFIhvl4qNNd2FR-J4","Message-ID":"<CAHW6GYJhp9-B-3ZA25DSruxRaFi-gjmmJcVZEU6NmDUU4Lk03g@mail.gmail.com>","Subject":"Re: [PATCH 2/2] pipeline: rpi: pisp: Ensure we don't run our SW\n\tcorrection with packed","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, laurent.pinchart@ideasonboard.com","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]