From patchwork Thu Oct 29 13:26:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28692 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 B0255C324C for ; Thu, 29 Oct 2026 13:26:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 671D46909B; Thu, 29 Oct 2026 14:26:51 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JyZHDaG4"; dkim-atps=neutral Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 69ED268E07 for ; Thu, 29 Oct 2026 14:26:50 +0100 (CET) Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-7c03744ef27so680118137.1 for ; Thu, 29 Oct 2026 06:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793280409; x=1793885209; darn=lists.libcamera.org; h=content-transfer-encoding:content-type: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=EA4hyrl/J32xKw9fttGJklVB+wwNJmwdHsTjFJ0MC+c=; b=JyZHDaG4xmdvyEo5PvNceSUGgcLez5YrqR9XoszMvUR9IZp0/Z3DCPSRXSf4ihsfRa LFYsdPGsv+7PXR/QQcniYa0vXzP3z+WDeww8Th9VTL0Cp4coThZzpd7BaoZUhao5enOF 6bIBgcfP3twEy9FnjqikHJeiIvWRLiyCGyuMCzFXBpjMQpCkp4SAqs6rGVZ4nN7/R+/a IbpAPOF5sWK1WAC5IIcxn8KtnYwe1WCqBaOcHMPpYeBVkcPMj5Qii8QvgJJFLp5U0K1C kfSaI/IzWY8bI4jOVHHbau5CndMrLIS8e03VMM6N2/jvr4d5ghZ0dMWe0D0ntepuGPg9 DKdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793280409; x=1793885209; h=content-transfer-encoding:content-type: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=EA4hyrl/J32xKw9fttGJklVB+wwNJmwdHsTjFJ0MC+c=; b=cHCf/YOtkCP3mX+ZwHBTD4e9SseCAv6EiuMzttVHY/BPxuXQ1U4aDOdemXCF7nWJpg taCtgETS9j0Ws7R62y/jNKphzv0lIYl5JomJOpg7iCWpRyx25LbVeyco33QaX3NpgR6t xttMkgIsppAES26JH+AEiQM6AEbo03IUDt7ucyIUHXXWP4rCkaIH9y3OFsGYWd8sBrai kHVe/vHufVBwJ0vcXMIky47AUSP1TgZTfx3FqWwgZgPnUIgR4FPFDk0LXbaekL10D6Kp U0QA/yJqzBqO+bPiuGp1RQmcb3bd+FE7bL8s0YEVh3u64gx/8H/wh/gX/qyc97yi9cAN D1hQ== X-Gm-Message-State: AFq9FYJSUq2vOFp8W3uURzpwG/GrybX6NbX3Dysm+OMQz1j4z8aobV/1 mrqwWlabCJgoBOEMFmwJikdIg6NvsXYa4tAmiidXKDOzrY43oQWmI48ZRSGbh/lUrcA= X-Gm-Gg: AYBFou2NS5sQB5rc9DEGpoIQs7NsBOSqGPFTUKmoBLM95eEJV2mHQfuxVFXAwyZa/oL ZBte3CadvN8EwLIdlIBSm1wHfLSdSjGkWbXacn1fyEJxR03jP00juyZvO8W/p1laGLk6bzXGvDF HsgUZxDb53j0cbb05PC6CgtutWJQqbA9ElaHI4Pp2G1nTAZWbuyCQtMNmfAa7qdBnVU+mZ14gfM CKBhuk8woOr4BR/n0HrlFw6xhMaxMK1h27cff2VvIRlrBJWS6aRlyQwIruAaIK6BqMaHp3FsBRS lNLxRqD2NNo82s8ORMXZofoK4hpiNJAsjJ1GJWqEWiSTWkC8UuCOaLOstXthVBbglGPWIZwcgAx Omgulr8nmuRVDGRLopUUi+IFifRsQAHGfIwNuvCBW2K3XZTNsm8nnj/2E4aSHTw/TP+2WdxN6jk KMIMCh39aCN7rsR8I/kRUxpjjnCba+y18vsKu+o1dRvONOU8IIiL1qHzsf9IAzso2zD9RQKlztR arRlKHM5LbjaTXaaz1H7qyfbVAiVQwSnXxsP9O49YnPau5Vde36DSMTCT4TJmZmNp0HJD8sEjpt zZmooxVE4buH7NsALkxAkqHL0ZtWULK9R2WsnLlLT/OZpTaY0+rHucSx X-Received: by 2002:a05:6102:2c0f:b0:7c4:a0e4:1a79 with SMTP id ada2fe7eead31-7d03a5a8477mr2500813137.19.1793280409240; Thu, 29 Oct 2026 06:26:49 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99125931983sm9476046241.2.2026.10.29.06.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 06:26:46 -0700 (PDT) From: Ray Strode To: libcamera-devel@lists.libcamera.org Cc: kieran.bingham@ideasonboard.com, bod.linux@nxsw.ie, laurent.pinchart@ideasonboard.com, stefan.klug@ideasonboard.com, martincarvalho@gmail.com Subject: [PATCH v4 0/9] software-isp: Align metering and report the configured crop Date: Thu, 29 Oct 2026 09:26:22 -0400 Message-ID: <20261029132631.370507-1-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261016202818.1405645-1-halfline@gmail.com> References: <20261016202818.1405645-1-halfline@gmail.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" Hi, Here's an updated version of the software ISP crop series, rebased on current master (6e19ca0f). It makes GPU statistics follow the sensor region visible in the output, keeping exposure and white balance metering aligned with the image. The simple pipeline also reports the configured CPU or GPU crop through ScalerCropMaximum and ScalerCrop request metadata. The series depends on Martin's GPU crop-centering patch [1] and the accompanying getSelection() API patch. I've implemented the optional-result approach from the earlier getSelection() discussion as a separate patch. Success with an empty optional means no rectangle was reported for the current configuration. Following Stefan's feedback, the crop coordinates are relative to the physical pixel array. The first patch corrects the ScalerCrop and ScalerCropMaximum documentation to match. [1] https://patchwork.libcamera.org/patch/28178/ --Ray Ray Strode (9): libcamera: Document ScalerCrop in physical pixel-array coordinates software-isp: Align statistics with the visible sensor crop tests: Validate the visible sensor crop software-isp: Expose the configured image crop tests: Check the configured CPU image crop software-isp: Map input crops to native sensor coordinates tests: Validate native sensor crop coordinates pipeline: simple: Report the software ISP's maximum crop pipeline: simple: Include the software ISP crop in request metadata .../internal/software_isp/debayer_geometry.h | 48 ++++++++++ .../libcamera/internal/software_isp/meson.build | 1 + .../libcamera/internal/software_isp/software_isp.h | 1 + src/libcamera/control_ids_core.yaml | 7 +- src/libcamera/pipeline/simple/simple.cpp | 95 +++++++++++++++++- src/libcamera/property_ids_core.yaml | 4 +- src/libcamera/software_isp/debayer.cpp | 11 +++ src/libcamera/software_isp/debayer.h | 1 + src/libcamera/software_isp/debayer_cpu.h | 4 + src/libcamera/software_isp/debayer_egl.cpp | 15 +-- src/libcamera/software_isp/debayer_egl.h | 3 +- src/libcamera/software_isp/software_isp.cpp | 14 +++ test/debayer-geometry.cpp | 106 +++++++++++++++++++++ test/meson.build | 2 + test/software_isp/debayer-crop.cpp | 102 ++++++++++++++++++++ test/software_isp/meson.build | 20 ++++ 16 files changed, 414 insertions(+), 20 deletions(-)