From patchwork Thu Aug 8 10:23:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20834 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 9BF68C32D5 for ; Thu, 8 Aug 2024 10:24:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 92362633C0; Thu, 8 Aug 2024 12:23:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="AxbCVfw5"; 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 8056B61955 for ; Thu, 8 Aug 2024 12:23:48 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3683f56b9bdso521333f8f.1 for ; Thu, 08 Aug 2024 03:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1723112628; x=1723717428; 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=Nb+gdwWarnJNCQUVUUakWYok4gsIJIituzonUdU6Ang=; b=AxbCVfw5bg1P3TZN4HC/YWHBPl3f66OQ4MluPEgE9TiL39C9dZB1KB1GmKQe5S1sEN MwPtq2hR4avpKvfmX0uGE/6aGR0t8YFng3PrXRSZwjMXKsSYPRaf+WJhdHc1idtLT5RB k8/AKxuK80eeb5rTYamW8tr0p3l9ju5LBtVuWkMkMmZlJqQoJWpd05GRXEJztqLqORHf ge86BPw648APjvLbXEWkMSQ6Z6Ijs8rrGeILLU0hFffFajiKuRSOBC5Agkmg1uDKL9Zz 98QYFa6EdxfZNqkulL0okSq49cB3FYfhYCgevLmOxdYZkK8JAA6yhWooZEQ091glre3j SmqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723112628; x=1723717428; 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=Nb+gdwWarnJNCQUVUUakWYok4gsIJIituzonUdU6Ang=; b=lb97dD77jownE0zDyE8yc3Eu5UqKLE/1633Ek9QF1jjIf3+g5ZOdCVHJtJQWCnAeIh RftElgSeZoq/cj9LUIQFG4Hu3xfrEnw7mtUlWcChmyoSZG1jLKKI5TBWgV94RzaCD2aL +H4igzLousL38jfe/8SP69eRZTgMDmQwMkrxcWI8XAZWJcctZkN+bgmaHEXFXG7iije6 cPbj4A1sQAKUTsgwjNhyPaDV+5pL+aVzP7g3f7TvIRr9e5yJ8IAGMbja1bO5B4vWtxue tA/rw1ml+dRKkJf29MJGtqc3+t3TrvP7/ZCM4i2hBLNYJN/FWLMC9CRnvhifRYvwM6Dr a7LA== X-Gm-Message-State: AOJu0YzYr9Djls0PJto7no3yWH8JMRygqHSe9yUYs4JCdmheJM9vFqi4 wY+VYogFd7W4sgrzWF2D5wQ/zlSFLMrYn3TeXlukKxS/5NB5teaK2yxIhur2aoXxQTYibX97yCl E X-Google-Smtp-Source: AGHT+IGF05oNHM8p7Ce31bwXn08Ac7E8BGPabGvHPbgeQePR9ZipFLQHp9ZH/10O5ZlWsZ7Hsk3bDQ== X-Received: by 2002:a5d:6d01:0:b0:367:9828:f42d with SMTP id ffacd0b85a97d-36d275798c6mr1213909f8f.53.1723112627728; Thu, 08 Aug 2024 03:23:47 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d272290c2sm1404234f8f.92.2024.08.08.03.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 03:23:47 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop() Date: Thu, 8 Aug 2024 11:23:42 +0100 Message-Id: <20240808102346.13065-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808102346.13065-1-naush@raspberrypi.com> References: <20240808102346.13065-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 --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 3 +-- src/libcamera/pipeline/rpi/common/pipeline_base.h | 2 +- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 5322fd798a36..2de6111bacfd 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1314,8 +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; }