From patchwork Fri Oct 16 20:28:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28483 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 B3E3FC3357 for ; Fri, 16 Oct 2026 20:28:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 56AD268E63; Fri, 16 Oct 2026 22:28:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rwyaoH+S"; dkim-atps=neutral Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9712168E4C for ; Fri, 16 Oct 2026 22:28:41 +0200 (CEST) Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-5e3e525cf4bso245375e0c.1 for ; Fri, 16 Oct 2026 13:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792182520; x=1792787320; 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=ewDEJKwgHJhq2HC7JgAl5zIuGK+JFX8Qb8/E/ErGGoU=; b=rwyaoH+SQ6NDN11n7PC2DxmP0hKjh8LuzIvoXA+fdQCJitKequR4hgQssSqH+f05KM 7+b10P8yVqIRNKYc4J0UyIm0TwiGmpJPX4i3Dqj6AhHEJargf65zM5ih71NTrItxNG6X p6zlv/snxzX4y9vhqlEsD6mARKPORTLlQnHo8wi6N3z03WZwkPYy75iYXhUsH7C4rhPu zGNnfd6bJRONlj1yaR2zzeIGH5jCfo1EvMvL15YSyPi2/Y+hwWuqD8DfDXjesh4G+7L0 71jZpzd5Cvlw4W5T7kOmuxLgdL2aefaGuovgDiUFO0r3HVMQ2ClKrtnT1Rz5oQfY4TtB +zOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792182520; x=1792787320; 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=ewDEJKwgHJhq2HC7JgAl5zIuGK+JFX8Qb8/E/ErGGoU=; b=TCTV44inuQskPZ0//pOdUboUzUhCsWUh9W9a9Cw1XWsKdhen8TI/rV64zbRkwJQ6yD r4IqtCtjbjbnjHmNWK+Z5UF/ONxBseAa+Pbz3mNMbQZ6h6+ocnDucf9hQThsj8aLvbYc XFMkB8Zq6RyZYLWaCemu/KwOiNuUHZ3ydyLIB/B0u01jG3NVzZRP+ZYaJpdhN3QU4ENw eGkmrFzUux9xCxoBhUC8iQhHYR4P9XurWF+UG+mZZOHlazFrn7xS0NrzaCY+tgYe7L3Z oFa7LKaMW7JztHB/SrjlY2D/d8YTqWkzFEs7bRgl7YS7pezQPhxv/CPokIaOKm09we74 wWjw== X-Gm-Message-State: AFq9FYI815QbWJf8sRQilJaW75Ucry7MylDuJewrjHs9Jsfrf0zTwPeT zlE9Kunb4/WEqXPAuHB7GoWag5dScUuDhoqyTflDhfE1fDdwvxjXp+flONvbKCRVKOY= X-Gm-Gg: AYBFou2ViyKwPdG+8mvf5az6dlV2s2dXrgaVf44cGso0YpG2kLcAuB8mMUpQgvxCqNW iRcu5SAcB1U3QEyVA02ksLChuVtY9Bh2ELx20hZwPzW79+XsaxitXtCShcRQWTXVlXou5XRyocA LeP7DtX55VwoY6PMQPWpKSetDf+/Pormg1r+pGTJRpvxv+U8g8U9u1oV8FLvprZJayereTlYvn4 yGrnawZ9RGqUVmNMnuICfOyLp9bkrkMvKDGGLk2aQ/5iwPDYnPZuC7YqgZiXFD54mStk+A8m42l 0lVZiByXRPJxHIIjRLGKrUeE/s9Ip6g5e2QD5+Nzc2itYY0xjyB8WiTSuQOl5G+subf8PWZnpB8 6bnmSW96zkPC/x4Vq5IympfHYJkrjkI8o2uQtRN0s4SJMwRadeeynR46hWTZQDQ2HozOV21aCov WoDH1DoIno+Niglc0czNvoewdlY39maSxkvaEGTVfJ1YQZnbVZLsoNSORdnKiku4a5ncTCyb3A4 NQkPIoDvSzCDCrgA90PKe7gty8W X-Received: by 2002:a05:6122:4307:b0:5e7:8bd1:731f with SMTP id 71dfb90a1353d-5eaaa675dd4mr487145e0c.10.1792182520463; Fri, 16 Oct 2026 13:28:40 -0700 (PDT) Received: from localhost ([2601:19c:4a00:897d:3391:ed89:5571:41a8]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5ea9b2fef79sm2422500e0c.1.2026.10.16.13.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 13:28:39 -0700 (PDT) From: Ray Strode To: libcamera-devel@lists.libcamera.org Cc: kieran.bingham@ideasonboard.com, bod.linux@nxsw.ie, laurent.pinchart@ideasonboard.com Subject: [PATCH v3 11/11] pipeline: simple: Include the software ISP crop in request metadata Date: Fri, 16 Oct 2026 16:28:18 -0400 Message-ID: <20261016202818.1405645-12-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261016202818.1405645-1-halfline@gmail.com> References: <20261015223604.311616-1-halfline@gmail.com> <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" From: Ray Strode This commit includes the software ISP's configured image region in completed requests as ScalerCrop metadata. The simple pipeline exposes this fixed region through ScalerCropMaximum, but completed requests still omit the sensor rectangle visible in their processed output. The crop is cached when the software ISP is configured and reported when each request completes. Reconfiguration clears the cached region so raw-only requests do not inherit an earlier processed-image crop. Based on Kieran Bingham's ScalerCrop metadata reporting patch, extended to use the software ISP's selected image region. Link: https://patchwork.libcamera.org/patch/26817/ Signed-off-by: Ray Strode --- src/libcamera/pipeline/simple/simple.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 91b149d1..cce42af7 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -363,6 +363,7 @@ public: std::unique_ptr converter_; std::unique_ptr swIsp_; SimpleFrames frameInfo_; + std::optional scalerCrop_; private: void tryPipeline(unsigned int code, const Size &size); @@ -1022,10 +1023,10 @@ void SimpleCameraData::updateScalerCrop(const Size &inputSize, Transform transfo } } - Rectangle crop = debayerCropToSensor(swIsp_->inputCrop(), inputSize, - sensorInfo.analogCrop, sensorInfo.activeArea, - transform); - properties_.set(properties::ScalerCropMaximum, crop); + scalerCrop_ = debayerCropToSensor(swIsp_->inputCrop(), inputSize, + sensorInfo.analogCrop, sensorInfo.activeArea, + transform); + properties_.set(properties::ScalerCropMaximum, *scalerCrop_); } void SimpleCameraData::tryCompleteRequest(Request *request) @@ -1042,6 +1043,9 @@ void SimpleCameraData::tryCompleteRequest(Request *request) if (info->metadataRequired && !info->metadataProcessed) return; + if (scalerCrop_) + request->_d()->metadata().set(controls::ScalerCrop, *scalerCrop_); + frameInfo_.destroy(info->frame); pipe()->completeRequest(request); } @@ -1550,6 +1554,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) V4L2VideoDevice *video = data->video_; int ret; + data->scalerCrop_.reset(); data->properties_ = data->sensor_->properties(); /*