From patchwork Mon Sep 30 14:14:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21428 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 528B6C3257 for ; Mon, 30 Sep 2024 14:14:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D41AF63521; Mon, 30 Sep 2024 16:14:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="eE3ePZKw"; 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 E370E63502 for ; Mon, 30 Sep 2024 16:14:00 +0200 (CEST) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-37cd5501ec1so243998f8f.0 for ; Mon, 30 Sep 2024 07:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1727705640; x=1728310440; 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=XrWcUJQsFkTVobFUCVSgV/d6Wx/qIdBspGHAklWbwc0=; b=eE3ePZKw+z+TbwGeH/fXbIWDm8FpLBJeUAJyeI4u9FWwy86y0xNhwaihWZq/evTbJU hjHsCG6Ivg6sqPvudXo65jUY5VRXQtt8d5M1ku6l581Kj75NFow6xpGM/HQKi6fxtOQb pUD7E7PHngtyUVMBsOsxrAFs6TVtmjihw6e3XxrJF8yTunajRep8GJVN87RTlWo2F1Rq e/0cxL+ouXDuHrkE4Anyy+WPMTYc/xZO0oS0xa667sWRhR5pfTKMuycdGhCuk5lRIEHB UQ7w+W3MfzP9PfETJUKB25TmkVsaRuIW7Y/dCRcrJjPydk1BAT+acaXMB3YpShXhXw0b O6sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727705640; x=1728310440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XrWcUJQsFkTVobFUCVSgV/d6Wx/qIdBspGHAklWbwc0=; b=wLsWnGj+YS8adBCQvBmQO59D2aInFk22OZRC48Sg9sT8E1IccMh2ke33UIP7Q3L/6b /CrHik+9VLlIhKISxgxF838bISkMCPsN6V0ZlMGZ62RHpa1Tng4UEHiw3Uch6E3Bmx+i Md8A+eNbM02sqilyHISgyviaP9K+gXePP0BS5djJj5MQBLGCVBbrNC61JyyEKheB9cVu AbqKLRZLK1IH57Rku9UXMyx9lmIF6U6YqbtAupz0j14+RgqhMFmpdjpjYs5lcR56sp/Y okBsg80Vx0o3kKGwpUQXo/0GV5e7xuAaBmDPOkPfQGEYMbTRWLjy6sfnALVsjwr6zVQ1 Cquw== X-Gm-Message-State: AOJu0Yw9CjC61leJ0SnfetU1m2txK/v8cEWI1vE2ZkgVs4rf4+Js+oSH S1IvaUUEY18oCIOy4jrsdBHjU4naPPrnkWvw3THEK6UyamcvPCl99At9wWfzuiSfuU1mVt8/5zc q X-Google-Smtp-Source: AGHT+IFRVRJ3Wixy/fxnsnqXGcu3q3YbReZuKqMfk/9X82mwkcKJ/r50Mg2usG/e8/1K85/jc5XyEw== X-Received: by 2002:a05:6000:1acb:b0:374:cef0:fd2a with SMTP id ffacd0b85a97d-37cde3f8899mr2513893f8f.7.1727705639732; Mon, 30 Sep 2024 07:13:59 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd56e65c3sm9142524f8f.60.2024.09.30.07.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 07:13:59 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart Subject: [PATCH v2 3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop() Date: Mon, 30 Sep 2024 15:14:11 +0100 Message-Id: <20240930141415.8857-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930141415.8857-1-naush@raspberrypi.com> References: <20240930141415.8857-1-naush@raspberrypi.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" This will be required when we program separate crop values to each ISP output in a future commit. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 +- src/libcamera/pipeline/rpi/common/pipeline_base.h | 2 +- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 11f1bfd4a5da..2de6111bacfd 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1314,7 +1314,7 @@ void CameraData::applyScalerCrop(const ControlList &controls) if (ispCrop != ispCrop_) { ispCrop_ = ispCrop; - platformSetIspCrop(); + platformSetIspCrop(ispCrop); } } } diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h index 5161c16e518f..d65b695c30b5 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h @@ -83,7 +83,7 @@ public: Rectangle scaleIspCrop(const Rectangle &ispCrop) const; void applyScalerCrop(const ControlList &controls); - virtual void platformSetIspCrop() = 0; + virtual void platformSetIspCrop(const Rectangle &ispCrop) = 0; void cameraTimeout(); void frameStarted(uint32_t sequence); diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index e5b6ef2b37cd..0ea032293bc9 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -109,9 +109,10 @@ public: Config config_; private: - void platformSetIspCrop() override + void platformSetIspCrop(const Rectangle &ispCrop) override { - isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &ispCrop_); + Rectangle crop = ispCrop; + isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop); } int platformConfigure(const RPi::RPiCameraConfiguration *rpiConfig) override; @@ -707,7 +708,7 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi Size size = unicamFormat.size.boundedToAspectRatio(maxSize); ispCrop_ = size.centeredTo(Rectangle(unicamFormat.size).center()); - platformSetIspCrop(); + platformSetIspCrop(ispCrop_); return 0; }