From patchwork Wed Nov 18 09:57:13 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: 28968 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 536C1C3355 for ; Wed, 18 Nov 2026 09:58:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9EC316A8B9; Wed, 18 Nov 2026 10:58:00 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="b0gxSW2G"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1192A6A8AA for ; Wed, 18 Nov 2026 10:57:55 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-4a357b1c649so391799f8f.3 for ; Wed, 18 Nov 2026 01:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1794995875; x=1795600675; 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=QZskon6kHLcmiYpqHAXOnpz2FYA2mgCT4CsAt6KaUE0=; b=b0gxSW2G5s8uR69LadsqcDBbyubEgKhKakFQ8xC4DXhMjjLwjCV5ebifsOSv4d3/CO 3i6Prw9ffW0GTbYIt0tQYm5k6bxNv1Mkai03hNLkJ0Td0Tt8KdnF+LtaGD4nGepdLQIM kUbdLbAn6lsSuJIpsg/wepbpAcL524cEKxlOaosvJ2xLDj1v/hw365j2kGHl/MeR4pSh Z0uvmpZW/e1oDryGGUvESUtEPtpg3eqA2sJUT2j+uwWOlVTyw6qB73YYoBP/K8sTQqJO 1r6ALulN2ul8M3XuMP4JCFIISfV3pjneVB1pVQBkeY6jMfr9tgBgqiZcdJtAIFjKVW3g D+Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794995875; x=1795600675; 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=QZskon6kHLcmiYpqHAXOnpz2FYA2mgCT4CsAt6KaUE0=; b=BdeZ5ByfvfzBAPkR/rdA0IyaofA3AkjOtuzaE7cn827Y0Yur0dgQ7VYwdGm9VhOz8t s89GNlUyNLD2z4sglTJ5UDLfLf3eOqFvJn/UsincKbZnNcGcFvfXd64ft/mt0X4F8pQ+ fB7UPVviLu69EkffRCdcZMkZvvMgoe9NGmfmI7D0+FAaAPPYRLBrzCH6it3e8tmY9Gv/ AkG+OBWEYsb6bhs90XrApgky8i/TJEM4G/TlWpLp0K+30Rcfjr0JE03lF1H81iqFKBTI G9tAGgKHnNTpcNjKe4wAxKa0zI792yHSIo7V67Sg+FfOZF8C4e37ZKxM/3ey6pCmJ/Hj WyWw== X-Gm-Message-State: APuU4Z8FDblH1Rb8chy84tU2ZTIJ6OMbsHjZfhcLDixnBPy+osx5Nkb2 3siqSBpVRpet+Uu7+Dd34R/6TwT0UGR39AQ0uqMZdrFX4A8ZBxpP6DSJOEU9nPY8iCzOY5fe6eg eOzt9vp8= X-Gm-Gg: AZFdTZeatr5lGeDHCUFcXDS/xdcTf+j5/bG/xjMA0Enr1wu5Eug4kqNdf3kCGIhVA+Z SWTRFN3OJ6l+CaIdZjpOuIddXUFwwKAl8OD2nAtwcNlYCSl2JyZVFDQn2GDtD4tpx2iuGYfMzA7 NoZZdR/zFQw4vGquPe5UuBohUrp9YfgfuczULfCTYku9hCeu16qItgOc8awgh13FRnydLPPcmXl WstNGwfb8lIIClA2u7dSoOw7HeEeb9bkwqhEoJnK19ZJ+bVV2Y2N/mzhaCpO0Y8YVzbLxSoHzgR gHbzGv1et84AbZdWGMzbvDTngCPkX0lkiZXazUWHA0PjZmPu13SBJWx10RPkjW2z66mT1fTen42 vIPETMj7LuRhFEc4ZgVEF8wGyddaz8brJogaqaJs15vPHI6tub+snFRt2mI8mDP9Nzgs2xQDT4S gKyEEWaY9QtXbcT1t6O32AfFoA4q/4FGzGvN8ZwAh1t+5PLaAoRYXGlI7oVAaQBMbPAenkAZGRv d9qYhmsHPTXWaFXiuB+3QV32P4qBJ/fJEGSBWrU1Mwkp/pYkRmhA7LI/ztHgMJnayY0ThQgr0Sh HNWxysvd1alF+k7usbJ/CgddWSdcJJfIpU8iFiuG/+vQ1ZaPB7C8bKQqLP/qhiqBH3M= X-Received: by 2002:a05:6000:46ce:b0:490:9fe2:6a2d with SMTP id ffacd0b85a97d-4a63a5b55c8mr2480224f8f.26.1794995874542; Wed, 18 Nov 2026 01:57:54 -0800 (PST) Received: from inspiron14p-linux ([109.76.187.112]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a655f9f4a7sm3940871f8f.34.2026.11.18.01.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 01:57:53 -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 06/26] libcamera: software_isp: gpu: Make Rectangle window_ a local variable in configure() Date: Wed, 18 Nov 2026 10:57:13 +0100 Message-ID: <20261118095735.170587-7-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" Class member window_ is only used in one method now so make it a local to that method instead. Signed-off-by: Bryan O'Donoghue --- .../software_isp/software_isp_instance_gpu.cpp | 16 +++++++++------- .../software_isp/software_isp_instance_gpu.h | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libcamera/software_isp/software_isp_instance_gpu.cpp b/src/libcamera/software_isp/software_isp_instance_gpu.cpp index 4cec8f598..5c473948c 100644 --- a/src/libcamera/software_isp/software_isp_instance_gpu.cpp +++ b/src/libcamera/software_isp/software_isp_instance_gpu.cpp @@ -107,6 +107,8 @@ int SoftwareIspInstanceGpu::configure(const StreamConfiguration &inputCfg, [[maybe_unused]] bool ccmEnabled, bool lscEnabled) { + Rectangle window; + if (getInputConfig(inputCfg.pixelFormat, inputConfig_) != 0) { LOG(SoftwareIspInstance, Error) << "Unsupported input format " << inputCfg.pixelFormat; @@ -156,24 +158,24 @@ int SoftwareIspInstanceGpu::configure(const StreamConfiguration &inputCfg, outputSize_ = outputCfg.size; nativeOutputSize_ = outSizeRange.max; - window_.x = ((inputCfg.size.width - outputCfg.size.width) / 2) & + window.x = ((inputCfg.size.width - outputCfg.size.width) / 2) & ~(inputConfig_.patternSize.width - 1); - window_.y = ((inputCfg.size.height - outputCfg.size.height) / 2) & + window.y = ((inputCfg.size.height - outputCfg.size.height) / 2) & ~(inputConfig_.patternSize.height - 1); - window_.width = outputCfg.size.width; - window_.height = outputCfg.size.height; + window.width = outputCfg.size.width; + window.height = outputCfg.size.height; /* - * Don't pass x,y from window_ since process() already adjusts for it. + * Don't pass x,y from window since process() already adjusts for it. * But crop the window to 2/3 of its width and height for speedup. */ - stats_->setWindow(Rectangle(window_.size())); + stats_->setWindow(Rectangle(window.size())); inputBufferCount_ = inputCfg.bufferCount; outputBufferCount_ = outputCfg.bufferCount; /* Configure for one pass */ - PassConfig rawSensorIn = { inputCfg.size, inputConfig_.stride, inputPixelFormat_, window_ }; + PassConfig rawSensorIn = { inputCfg.size, inputConfig_.stride, inputPixelFormat_, window }; PassConfig rgbaOut = { outputCfg.size, outputConfig_.stride, outputPixelFormat_, Rectangle(nativeOutputSize_) }; gpuIspShaderPassDemosiac_.configure(rawSensorIn, rgbaOut); diff --git a/src/libcamera/software_isp/software_isp_instance_gpu.h b/src/libcamera/software_isp/software_isp_instance_gpu.h index 4a9de99ad..695fbd8d5 100644 --- a/src/libcamera/software_isp/software_isp_instance_gpu.h +++ b/src/libcamera/software_isp/software_isp_instance_gpu.h @@ -79,7 +79,6 @@ private: unsigned int outputBufferCount_; Size nativeOutputSize_; - Rectangle window_; std::unique_ptr stats_; eGL egl_; uint32_t width_;