From patchwork Thu Oct 29 13:26:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28701 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 56D0EC3261 for ; Thu, 29 Oct 2026 13:27:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0C897690B2; Thu, 29 Oct 2026 14:27:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U6WhGJ52"; dkim-atps=neutral Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E7AF66909D for ; Thu, 29 Oct 2026 14:27:33 +0100 (CET) Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-98c7798ce74so685958241.1 for ; Thu, 29 Oct 2026 06:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793280453; x=1793885253; 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=LcQL7aIUPoMCtRE7rLSaqztgaQ013sZBw1GwMYo0zZI=; b=U6WhGJ52eoX/am2PTmmH+EWwsqfu8c9TgZewOFVf3bORjTQdfHWLx/TYR33fOyC3Ba FDyrt0a5lBYiyzJmyLMfCQuQV2BK3u3VEg9t+YWQ3xc8jwCkHJfDtdKgVGbb/8NFSJ0U 5x/abkskYXdqWN6uZ29P4yQk7C2fyrMcV85sT1zLk8S5RRReuZjnpFlLBvp+H/m3FDEl OleiQyLtxQDO/0M32BIlgfwSex3IlRWkh4NvZ4FHtrJFacHzcucT/Qk1W9aOvQVL7Tmf fVmskDrq9+esxkChYp3MgpKgUTlDYdmTDnY4n06KT0qLgYoQBio0LNjaXxQtc6ZvfCKy U1bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793280453; x=1793885253; 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=LcQL7aIUPoMCtRE7rLSaqztgaQ013sZBw1GwMYo0zZI=; b=ujGauwnaII5SiYC4hMKfftvQmi7EJkfPI68E653vyQEbojFjUEO46Hw0nm9BKwQa8t aAdkgaEg2+ER69d7P3i8gv4ulew+9Xn04ukzxQEm8u2HzLDqa5HPA+vhUe4lP7ekwIKi 8zsGu3qtjvMotYeoRXLmyNFGCDQ2Ue8JWDisFZbA9MuvmT39BFDfJ8PSzWYdO9eU6+jO paZd4TqPTlj/YEw3dSlmwL/IMAe0cukR13ZXchFkgu/bhVmgqtm4gSagowXcxI6R7RPs kfrqA3rEN2Zo1elN/d9i6/7jNr6epEa0Ixo/QZUByejUIEpL0RbSiLiOJUjOpvEUc1/d /whA== X-Gm-Message-State: AFq9FYI2ZWQ/X/otMIIrT6TOmngwu0dJVvplZnznGDSMhVsa/444Py/b uWHHlj22nLUwRogMPIIJZNV8J38XCT0aGwMl/vxhXHpFGnlIxG6XhIywARRaGjHlDWg= X-Gm-Gg: AYBFou1zCn8x/jt4b5IpjT9P4tPqDPobhSl4XnaNkmduVlZC25D80I3tETPtZZsUgy5 1nl2RuEQXNKhMKxlEQR8G4gyMIduXvcfZvi3YucoeH4rCNz8S00QTP/DX7yMI0Gny09XNjr19Aq nKq5r8tPnu+X+tD34+x/rZX1VbgVpwE8QfCKFjgqkjBX07lugy814NhABQkmwzjTMvqgT7Zqr+Q F4Oqa0RsuTKG4KPeJ9Z5Et4AB20atbEaaeFULpAKYmw8h0YlBH0nELFDO3iC/y2ki2ZAHnznb0M EooEymA7RS8spCf5QxlMPbzK/dbozRaRNgMjHvTOAY9WWKPsNZC1Ddi8IabHtdlkKt1/EUv6bz/ BDeAjfySFMtO/1sS+Q/mfP/HT2bPoPIU8jOqtbyFXHgctPyycvAgPYTf6xY8HYjpzAF5tqTwaPo dyvZt35zyZBe3Xy3JoR/NJEdqgk8FkcXEPOFknydB/ZcVvFU7dnv8Xvt0o6aydX5ZOBrXNO2138 GSXWzS7S3lhShyk3aA9h0C4KrdhmyzW9gTK9LbBBlqrjJ5zMDw9OmHGD84oUYnZQ/BL2vpv3Y2+ bJFj9OqH3QXQeD6VzFP0/xRQ/FYo2NYmsIsT6Djpim6V2fz1e1yvPo5dcw== X-Received: by 2002:a05:6102:f0f:b0:7c0:1d48:b2a2 with SMTP id ada2fe7eead31-7d03a633e1cmr2278058137.31.1793280452741; Thu, 29 Oct 2026 06:27:32 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99125931983sm9476046241.2.2026.10.29.06.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 06:27:29 -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 9/9] pipeline: simple: Include the software ISP crop in request metadata Date: Thu, 29 Oct 2026 09:26:31 -0400 Message-ID: <20261029132631.370507-10-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029132631.370507-1-halfline@gmail.com> References: <20261016202818.1405645-1-halfline@gmail.com> <20261029132631.370507-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. Successful reconfiguration replaces or 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 3e6a3a50..4196ad4b 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1045,60 +1045,63 @@ void SimpleCameraData::updateScalerCrop(std::optional crop) properties_.set(properties::ScalerCropMaximum, *crop); return; } if (!properties_.contains(properties::ScalerCropMaximum.id())) return; ControlList updatedProperties = properties_; updatedProperties.clear(); for (const auto &[id, value] : properties_) { if (id != properties::ScalerCropMaximum.id()) updatedProperties.set(id, value); } properties_ = std::move(updatedProperties); } void SimpleCameraData::tryCompleteRequest(Request *request) { if (request->hasPendingBuffers()) return; SimpleFrameInfo *info = frameInfo_.find(request->sequence()); if (!info) { /* Something is really wrong, let's return. */ return; } if (info->metadataRequired && !info->metadataProcessed) return; + if (scalerCrop_) + request->_d()->metadata().set(controls::ScalerCrop, *scalerCrop_); + frameInfo_.destroy(info->frame); pipe()->completeRequest(request); } void SimpleCameraData::conversionInputDone(FrameBuffer *buffer) { if (rawStream_) { /* Complete the input buffer as with raw-only processing. */ Request *request = buffer->request(); if (pipe()->completeBuffer(request, buffer)) tryCompleteRequest(request); } else { /* Queue the input buffer back for capture. */ video_->queueBuffer(buffer); } } void SimpleCameraData::conversionOutputDone(FrameBuffer *buffer) { SimplePipelineHandler *pipe = SimpleCameraData::pipe(); /* Complete the buffer and the request. */ Request *request = buffer->request(); if (pipe->completeBuffer(request, buffer)) tryCompleteRequest(request); } void SimpleCameraData::ispStatsReady(uint32_t frame, uint32_t bufferId) { swIsp_->processStats(frame, bufferId,