From patchwork Wed Nov 18 09:57:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 28984 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 D0CC9BDE17 for ; Wed, 18 Nov 2026 09:58:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F4436A8ED; Wed, 18 Nov 2026 10:58:31 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gs3fcEdh"; dkim-atps=neutral Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 769EC6A8E0 for ; Wed, 18 Nov 2026 10:58:12 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-490c3ae81d3so451350f8f.2 for ; Wed, 18 Nov 2026 01:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1794995892; x=1795600692; 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=4sQ/Rn3HRthPdmB6xG+GmTxaBFr9DH/Hz6KAGK/e/sY=; b=gs3fcEdhfSyCMKPUHnzw/S/RCJQ1jjBRxmBz0kxe1JPUaUB/A6p/tmvpGV9/Ccebas qAU3wFDRqwvaC+87o9axahBXd2FvuoRJhheQV/CHCQWUVsor4tVJ/oUNKwQHPIbukhsk Uu8P1u6dxMFdWzHI3TN+gVi2HP1/KskzsrX/RS4sjKi/0UFPFCFg1f+vyFrxkRv3lL28 DI/2XGDFLF6vNEDGETMD6V4u9qUiMyqAGEhIJbImL+nLBkBSBro3rVJ/kXG7ZGyxB6/h 5znAJt15YbNabcpDusQE1T4YhALCFJgRLCbUGJ+FXyEFuiqTelFAv2h32OwvYLg8h7++ N1Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794995892; x=1795600692; 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=4sQ/Rn3HRthPdmB6xG+GmTxaBFr9DH/Hz6KAGK/e/sY=; b=ADQP/dj391DtYSg8XCvp6/I+cncGPP5VZb7yIHTmrNPF3fFQdlJDY2BLFts0KSFkSJ rnOporOiSW/iSSQ+Bs+mH2cMfE1JbkWFfCDniCXrEHj7egygm6POEEGvNT3nGHW0bFEs uPtnFG4FXrW9QfP4vr0l2i/SaOmsMW68V5P2xTbSaRV4L+lViBvHfb53DRdbne1pOV7d ob7GISYsry2mYjl0lnSVBMc+LmyGH7LIx/vOHFCdF4jDsmKKY6sMUAIcjZdtCe/Acnyw OyO+lKgs/1xH2xKDh0WmDlcT5B/IbeMr7rGt/fz4wQvm7wCHkLCv2JtC0n/zTEWn/B5J JfRw== X-Gm-Message-State: APuU4Z9iHBEX8OFeDjWbBQkXA8Nppt+FcS3tHKr9jnpbgRsAPKgcMvFj LmIHlaybUL91MITJYYAKFl4VSjLAOiqSPhK+H6LztCuwDnuhjzVdYodzWNyGEK9zsD3N4TzYXvy eEjqmXP4= X-Gm-Gg: AZFdTZccakxLNZWLas5/e4CbB8Ev3xodln0Ejljppp9H0BcNLNutVwGrzXNYkkQdgt5 hKxxVIjcY2uWonowMrFtSnuLVU1SJTbiACzmkLxjn1zI5olZbCvuTw+EHvffSInIHniZQPDk0h4 lIBWDmIK6czYlLaKz60KdBUXobLQwbiEdWMJ4k6eaqWt0HI2DCzecbU667lxGnAWLTvS+0PkzZE IaWKXCuUhKu9w099VngTNE1h7ibYGZGayyZ7vcEr3fOB/9rHAB656/dCHbkijkKa+wt3p7fwl4+ pyU9TDU1hIcYfxEpf5YkSktPJSg5s2tBFDIQN45zGcqbO8CnOMvIpJiNGyfl+K2I64RK+X4fzaf 0I35/S7+N16RBWedtnjj962MH+SvOiNTsJVHVBtMTIUg7UiUDKAhOcRpPZLj64b1uXHn/W/nlN5 e+0KIgurAAmjk1brnyTXxfAt5l0YeKRRN1vP8Y/ssy7myqBmVvO7dx6UiKVHPAi6OiwlhFdmu0d 6zGlpAwZxm/oFJuQ8Lgg23kdd8Wi0+iPXjlt7qnFI2w3Q9SkpeBRAwDXs5M6c2z9KcuLLt70uCn u5bDf+hofaLeIQqyIVCfsMbsPBH7wYqsUcjsHLz39DOZrw== X-Received: by 2002:a05:6000:3ca:b0:48f:bcdf:6f68 with SMTP id ffacd0b85a97d-4a63e03b638mr4446956f8f.37.1794995891796; Wed, 18 Nov 2026 01:58:11 -0800 (PST) Received: from inspiron14p-linux ([109.76.187.112]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a655f9f4a7sm3940871f8f.34.2026.11.18.01.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 01:58:11 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: rstrode@redhat.com, robert.mader@collabora.com, barnabas.pocze@ideasonboard.com, Bryan O'Donoghue Subject: [RFC PATCH v2 22/26] libcamera: software_isp: egl: Move scaling to the second stage Date: Wed, 18 Nov 2026 10:57:29 +0100 Message-ID: <20261118095735.170587-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261118095735.170587-1-bryan.odonoghue@linaro.org> References: <20261118095735.170587-1-bryan.odonoghue@linaro.org> 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" If we scale in the blc/normalise pass when we write to the output buffer we will be dropping Bayer encoded data. OTOH if we scale at the output of the demosaic phase the data we end up dropping has already been interpolated into RGB. Dropping at the BLC phase means losing the data-source to properly interpolate. Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/software_isp_instance_gpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp_instance_gpu.cpp b/src/libcamera/software_isp/software_isp_instance_gpu.cpp index 13d27ab7a..31940bdc6 100644 --- a/src/libcamera/software_isp/software_isp_instance_gpu.cpp +++ b/src/libcamera/software_isp/software_isp_instance_gpu.cpp @@ -183,9 +183,10 @@ int SoftwareIspInstanceGpu::configure(const StreamConfiguration &inputCfg, outputBufferCount_ = outputCfg.bufferCount; /* Configure for one pass */ - PassConfig rawSensorIn = { inputCfg.size, inputConfig_.stride, inputPixelFormat_, window }; + PassConfig rawSensorIn = { inputCfg.size, inputConfig_.stride, inputPixelFormat_, Rectangle(inputCfg.size) }; PassConfig pingPongOut = { inputCfg.size, inputCfg.size.width, inputPixelFormat_, Rectangle(inputCfg.size) }; PassConfig pingPongIn = pingPongOut; + pingPongIn.window = window; PassConfig rgbaOut = { outputCfg.size, outputConfig_.stride, outputPixelFormat_, Rectangle(nativeOutputSize_) }; gpuIspShaderPassBlcNormalise_.configure(rawSensorIn, pingPongOut);