From patchwork Thu Jun 18 12:22:22 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: 26942 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 69F0EC3301 for ; Thu, 18 Jun 2026 12:23:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 509BE656BD; Thu, 18 Jun 2026 14:23:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xvaTIubi"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 94A7362C6E for ; Thu, 18 Jun 2026 14:23:04 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-490b8ac62baso19678345e9.0 for ; Thu, 18 Jun 2026 05:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781785384; x=1782390184; 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; bh=Im+zzqwJ00458QMQzuv8XikugjegTVaGOsoHOKzuyZo=; b=xvaTIubilviPD2qvOjRw10ApZdNOGJCcjzAoUW2Mj+/1LEAyPG8mDdww6Rrzy6wkWZ HhzbjVdXJBSj1DD9+CWYqN/Sl//CSB7WHuvMJ++AlQxqctOnjX7PX73Pk360i6YhNfb5 xr7/0qQeIAdUU3tG2Kb6ag/D3ZFju/ccyoiTZOe27YDJUifA4QgmskN+dksWcavCZxEZ KeMd4xa2i6yaVOUtfls9TwaOPYcLxSwbwvS5ZaD4PdnWNuQFkQmWXALffMqP4FbE5HCS IkUJwVrfGInKQCmbpYJS0qXcnCyKDCdD+GzcWPzpsTQ+Q5xaOpTGtnipopFp2bKS9ljE 7FnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785384; x=1782390184; 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; bh=Im+zzqwJ00458QMQzuv8XikugjegTVaGOsoHOKzuyZo=; b=Fy8luTS5rnxw9WekCnNWky/1By7ThBwm6dyZMD+EXAqa5LTI5w7mKe7IZbtPnJQ8Hc Lf9lntdGyNM8UxsJPc+aoBU9Cn3ScDqSr7ycGChwSQzYriJ2HNiVQiKIxuTNsQaC4Rnf McSJ0rtxrhTwxAJfXJ/Cb3BY6015pQY8jyHNkRuVRHwaGAv/VD5sJTVeR+z7bTsCSbT5 VTmCs/FfcWlLtrci2XrPXIhlUoFi1c5bzWxKuWxUUMvdssHcK4Uua/D0Ep+asrsFx+2S ygmeoUcUsqcfrEZHjxYYfFvjGmBXrR+id7nYKrLxlT5aFJBnvlK0y481xOkZ4giKUBml PYlQ== X-Gm-Message-State: AOJu0YxcwmemWrtajJUUCaz+sZ18rGMt8NugaV3UlW6s9JrILkxARor8 Jdb/qXn9IGX/lmbiSfZeiWPe1F/m09cfvCK3ue6MidJNIiM/APZocDjC9dtiaOPL97sm4w7+4Bo wQvgPhXk= X-Gm-Gg: AfdE7clNrP1tI6tYfz34GImUtBF+xbqMpFT0dw0tTx76CY6thPiOAKSm/rMF+QxOwdf aTVX4DU9KkO9s6eoU3K+A4WTRLsf5SOFb1d5FfisbIuulteivR8lKvO/w1bsaZuD1QrJWJoBOSY lGiEosfycLO0h5wRqftvUkklI3/044XsWcsdI24oti1DsEBGBcc1NmLi2r0x/Sro4GxQg19bBOY JxeUCo4BYVSd8v+7euPCNeDiJyPP5paXpS5b0mWw/t+pSkgYp818Bcqz12Odh2UcUcu4ZIhVm66 t1GkBAVy+K/LxhWuYj3hUgnHgBDidDrxVLgkcNvu/n6LOSFGdAGj0VWL6B5LKm0h3oc0Hcq0+8T bM+v8p82UU91J1lLmW8MotDpTrDNv7g4TRs+l2z+jtKktbR2jj/Hn7YTdX6SWtyOWh2JGgFqmoJ HXhMtChBANdhzryrVhNHThTj7dysnm X-Received: by 2002:a05:600c:4ec6:b0:490:3cf0:8d81 with SMTP id 5b1f17b1804b1-492381864b5mr51320325e9.13.1781785383996; Thu, 18 Jun 2026 05:23:03 -0700 (PDT) Received: from inspiron14p-linux ([109.76.144.236]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4922fa3a4easm275198015e9.3.2026.06.18.05.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 05:23:03 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 09/30] libcamera: software_isp: gpu: Make Rectangle window_ a local variable in configure() Date: Thu, 18 Jun 2026 13:22:22 +0100 Message-ID: <20260618122245.946138-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260618122245.946138-1-bryan.odonoghue@linaro.org> References: <20260618122245.946138-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_pipeline_gpu.cpp | 16 +++++++++------- .../software_isp/software_isp_pipeline_gpu.h | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp b/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp index 6f329cf40..7de77319d 100644 --- a/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp +++ b/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp @@ -122,6 +122,8 @@ int SoftwareIspPipelineGpu::configure(const StreamConfiguration &inputCfg, const std::vector> &outputCfgs, [[maybe_unused]] bool ccmEnabled) { + Rectangle window; + if (getInputConfig(inputCfg.pixelFormat, inputConfig_) != 0) return -EINVAL; @@ -165,21 +167,21 @@ int SoftwareIspPipelineGpu::configure(const StreamConfiguration &inputCfg, outputPixelFormat_ = outputCfg.pixelFormat; outputSize_ = outputCfg.size; - 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())); /* 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(outputSize_) }; gpuIspShaderPassDemosiac_.configure(rawSensorIn, rgbaOut); diff --git a/src/libcamera/software_isp/software_isp_pipeline_gpu.h b/src/libcamera/software_isp/software_isp_pipeline_gpu.h index 6bd8adc8f..1b77bc71d 100644 --- a/src/libcamera/software_isp/software_isp_pipeline_gpu.h +++ b/src/libcamera/software_isp/software_isp_pipeline_gpu.h @@ -67,7 +67,6 @@ private: std::unique_ptr eglImageBayerIn_; std::unique_ptr eglImageRGBAOut_; - Rectangle window_; std::unique_ptr stats_; eGL egl_; uint32_t width_;