From patchwork Thu Oct 29 15:20:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28703 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 B5C60C324C for ; Thu, 29 Oct 2026 15:21:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A626E690B0; Thu, 29 Oct 2026 16:21:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="R9+mHP05"; dkim-atps=neutral Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4950D690A0 for ; Thu, 29 Oct 2026 16:21:15 +0100 (CET) Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-7c2f48f3a96so805369137.1 for ; Thu, 29 Oct 2026 08:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793287274; x=1793892074; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:content-type:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=T+1vVw5QMmpyvSeJKI6wrv3KBe+YNTfj4xROQDfOupQ=; b=R9+mHP05+LNlEzIYLj5j6+qvGWkGeygv420/bgac5AdCQQRj2f9XajMl3vFscHy4rS lTN5483E65Cv4wfw4DwY0oV64ZcHVYuE/GpC9FQND/+D81sPMv17TUOvFHsBHL1gi3xJ nOLWhX3ccgeaHuhiJhcoRGGQC8RkBPQ31Oyc5kkCEYHvJ6AYix12ZJ3DMM5sKeA/1KXg +3xhrSGxTcE5SHVmva4q+J+kRiXNWeE4Y27l2snyeQH3Xs8JEcRX2tRuFLpfk90Yd11U AIUyuTAGT0bdjStEyCusjQam5UtkGFJzsz9JuBIH43PBCBL2dx6p+jlMjXAJDBpgvhbt MfWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793287274; x=1793892074; h=content-transfer-encoding:mime-version:content-type: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=T+1vVw5QMmpyvSeJKI6wrv3KBe+YNTfj4xROQDfOupQ=; b=GLrQ6ReRM4BhvvlhpIES6O1SwxdttxtGEMVT3y+STsMrqnmUj4WwOFuKxKpA1h2Uyw bIrPCHxZDzKz1tsKSMTpoUsoVewVlj2qbXqaqKrgMM916fp/Im9SrGNJvxUPrCEfnra1 +xMs2Vbuo4D7ilui8v20IQl5l3Us2VeZv+8usHSY3VP/N3kY7xSHKZbbTQzhWCcU5I6U rLmtu+qdbGKHQHfdLQtlArkBbkiQgIKb/z9bZlCFuQkeZr5lNjlUNVWjE+I2mMJ0QJkn uG9n3TsQj7g9zwqdXST30AFxojmH3jUwS5BzHd8jdosJaRS6Sdo5Mtb2iaQ0p4dNSxt3 6QQA== X-Gm-Message-State: AFq9FYIclfkXgGLPiTI6qnKeqCmWjxT9q2MKkV6l0+WrbgTiW28cLDT9 9yHQViqVgcTpHR4eJsL6bhS0IyYPgRv1AO91nI074teZ8Ejf1qgoPP1FRjEUOCKi4RQ= X-Gm-Gg: AYBFou1Wd4tMX9li2/4871Jzb3OqPff37+6e7Q40M87Y453u0I23YAR7v9wTF0ineBX 5OB7cEa+5zwiSlroJFA9TVKdyFB4IVVDXVpAMOz/39B+8m5p1EwAiilZsdQboGuQTWG5P5OHbZU w/dCPIAiMQos18e4M0og8Ex/KyOKW2NEqQFvZxOKTRgt5Rd7YnbMlNQeLpzCL4arZWrmH69BiEo SH6//jOQxKAtWxaKaEHdzIVMPtw+iSaOYHeIpkmYGorD4/jARDqhz9z4D/0mCtiwatomDjob0h4 g67avKGhTIzMYoGRZM7vF1Qt9qbGQ3C/nG3LCVxYghByiq3RReZFj+QJjGvKdIPVFOpuQm4hxYQ YLTpVZUoDNYcM8VWvL4ubvy67z79rs55sYv4uxaVsA0MklUVjhRCTBzZfmPsEV4PF+EMpZ7Avww CWw+FkoqEyBCvbExw63VtDIH1vbjGAhPVDlNRkiO7+PIcVwQWn/PsnJYje8GVVLBjgU5ZgmbYMx HUYynBlA9auHNAzktA7wNKTDNbrEWpiyp0ceE6Ubia1cWxEnSJmEU2yb9qGOjKk0GDdhT2WCV/t GZNhpmrcwH32W1QpdoTHNMWy4JfTb/xBz4kYV/dy1ieM8H4M642DnSF9HBxfoGqhxinfQlj516M +lw== X-Received: by 2002:a05:6102:5123:b0:7a6:cd7e:72db with SMTP id ada2fe7eead31-7d03a5f1b86mr2018122137.26.1793287273985; Thu, 29 Oct 2026 08:21:13 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-991f74e5e22sm206563241.4.2026.10.29.08.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 08:21:12 -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 v5 0/11] software-isp: Align metering and report the configured crop Date: Thu, 29 Oct 2026 11:20:47 -0400 Message-ID: <20261029152058.896209-1-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 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, This series 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. It includes the optional-result getSelection() API from the earlier discussion: success with an empty optional means no rectangle was reported for the current configuration. The crop metadata uses physical pixel-array coordinates, with the control and property documentation corrected to match. The first patch is Martin's GPU crop-centering fix [1], included unchanged. [1] https://patchwork.libcamera.org/patch/28178/ --Ray Martin Neiva de Carvalho (1): libcamera: software_isp: Centre the crop the GPU debayer applies Ray Strode (10): libcamera: Document ScalerCrop in physical pixel-array coordinates libcamera: v4l2_subdevice: Return optional selection rectangles 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 + include/libcamera/internal/v4l2_subdevice.h | 5 +- src/libcamera/control_ids_core.yaml | 7 +- src/libcamera/pipeline/simple/simple.cpp | 95 +++++++++++++++++- src/libcamera/property_ids_core.yaml | 4 +- src/libcamera/sensor/camera_sensor_legacy.cpp | 42 +++++--- src/libcamera/sensor/camera_sensor_raw.cpp | 31 +++--- 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 | 38 +++++--- src/libcamera/software_isp/debayer_egl.h | 3 +- src/libcamera/software_isp/software_isp.cpp | 14 +++ src/libcamera/v4l2_subdevice.cpp | 40 +++++--- test/debayer-geometry.cpp | 106 +++++++++++++++++++++ test/meson.build | 2 + test/software_isp/debayer-crop.cpp | 102 ++++++++++++++++++++ test/software_isp/meson.build | 20 ++++ 20 files changed, 516 insertions(+), 59 deletions(-)