From patchwork Thu Oct 29 15:28:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28714 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 D086CC324C for ; Thu, 29 Oct 2026 15:28:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7EFE1690D7; Thu, 29 Oct 2026 16:28:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="zNsVz3GS"; dkim-atps=neutral Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 50D45690BB for ; Thu, 29 Oct 2026 16:28:46 +0100 (CET) Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-7cbbb7b90efso714844137.2 for ; Thu, 29 Oct 2026 08:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793287725; x=1793892525; 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=hW2Xt9W+E2y0B/M4nuixvNoENM4hU13DMLc/usEW5Vg=; b=zNsVz3GSB7BODRBlgPxCZGmIloXAl+1DXDuWiny8dbBh6jMNwMd9FLol4JQd6LFIpQ +r+kM36hYUSxlP1m+F3w16eF7QnkQ1MVBIZLMO+eHea81FekpSeRjKezvjGWNPmLCrC+ HA5uGeWCBvMSHM4AeiXJq9roskRMF0OanP1azKYkpjgMPllE6KBPjiqfUK9nynu9OMEX VX7yxYUfHavKmbzc+68ozci/e+iZ3nVFo08xLtTKAoryYXrx7StKQnTwgVdFQ4/VTe55 uWhmS2Nj1vA09KwEAne0bxo3VW9OvZD02uufM0Bit9iPogfLjGx2wdY5/CLF8YE8Zuim 0GSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793287725; x=1793892525; 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=hW2Xt9W+E2y0B/M4nuixvNoENM4hU13DMLc/usEW5Vg=; b=Pl65NXzizaoshlNFy5D5CWYhfaYoxZwqnQivUPfBEkgPwZIjsX6IAesjxMgUnu3jm3 ie22lAyfpLjZ/ultsnY2Htpz7SyewSpMyu//DqxedO3uK+gRdZKxX3JGvUOe+Z9j03e0 TVWe5oCFU/A6Fj0/1merLj+ewbj+aGDG3j2y3SFj6hn0ZMTuKUeor3eBnHW8OSjxBJvG fSXQw24vnqZodjh3CFKNeaBBfOLt3QY9wCgrINeNwvf56x/kfCUt/aczMAnuzGS4KIyb 96dnY2+sFj0v8sArli1OptKKoA/ld0T9HKeJYdPGsWycwb4qGD2TE8ObWH5XLeRX8EOM 1+dg== X-Gm-Message-State: AFq9FYKY8h6iNREZvhYzws4qNZ0091ImCHqOomt6lo7PKc/p8p5yw36W 6axBiZsfQXdGhGWi1VS+eEMT9AmAGKQ5w0cmeoHO/bNEcBcS1OxesBfE/WfqvY/Z2pI= X-Gm-Gg: AYBFou2ogmrmVVfX7YTdTIrg2ae+XLwKY+keaCCHUCL3O4eYgByxEPZC6jCHRKqMnHv gtJkOBzN67Dvv86ZeTdDyJXQeyLXrkRyb2Ynv2z4ZX5VeHxdqGTqEh5JP1f+oEk35ydo8dZ2wl1 rrMDlJ2gsw9D+zqZRmdFKYP0Pkmc8IOu0eDI//o2oa89pjB+OfqXh1ZvY1I7+dwGgVUNjqLwJe8 E0PJdcSqGQzi0u1ti49QbUVuPrageh2Z+rZ1pq5AGY3QWBsIrF1/bPigh9kGmVA468joqaDAcXA z10H6h4/+p0Wj4S+DAigYJ6d0+P+pwNvceNZCOW/+uS9VqTm3bNUHvvm32pzgGsZpsrGC52sCGc bEcl6H5QZ2suraK1XElZ8EDn8NHhokpzz0H/gTK+9QuAOgIfV/hce0Z6H2ykWwgKGqn83+7vtNE 3EL/GrFzisGl830rqi+8aBqeI2u/V/H8yOIXkzT6T3HjNz5QYGlEEdU01Qwfw8mlWgEBLdyZ8Lr bU+Veaf4Mqw5XrXvAbJQqOvZlbWG75lCP0KjhWV4ENnNmAvOi4ypWnky9XXLto6vqWZtFfJEW0t uI+Nzsprg/7kpu0F92OJNgLikERAbzdxJZuI/GwrsmsIZ9sSoAj9Olay X-Received: by 2002:a05:6102:4422:b0:7cc:9d47:9c9 with SMTP id ada2fe7eead31-7d03a6567eemr2620649137.35.1793287724959; Thu, 29 Oct 2026 08:28:44 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-991f76aea18sm182670241.11.2026.10.29.08.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 08:28:44 -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 11/11] pipeline: simple: Include the software ISP crop in request metadata Date: Thu, 29 Oct 2026 11:28:26 -0400 Message-ID: <20261029152058.896209-12-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029152058.896209-1-halfline@gmail.com> References: <20261029152058.896209-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 the 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,