From patchwork Thu Oct 31 09:49:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21784 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 7B115C31E9 for ; Thu, 31 Oct 2024 09:52:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 34BB1653AB; Thu, 31 Oct 2024 10:52:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qsO2Un/s"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C3A36539F for ; Thu, 31 Oct 2024 10:52:44 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43160c5bad8so830845e9.3 for ; Thu, 31 Oct 2024 02:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1730368364; x=1730973164; 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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=; b=qsO2Un/sz2dJtmpX/ogxcn42+QAxuSv7c3sBTgdtKOYXOQgJNUh7IcoUfJB96F3BXn dPGFoJdF90en8I+wfkKLX49uFnMZeYl4x/NGl95t7TDHDNv5utocTBL92iBfUkt+mWdl vxJsEJRyGXzTxYWsuRewbpYhKp2He1VYuv2eQMUyh52VmBdZmSTzht3fb+lI7fi/CgpQ 9LFLjXwNlsZZ346uKbob/OXCiKFOftReWrISMQ4dlWS21K7MWbtxUr0y39xLzQcB849t GhV7AqRagFQmKg/WAvbrRs45ig3IdVmF1ar6jsSYllZ6oqK3E6x08ByED1wJ3yzxYs3T Z1Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730368364; x=1730973164; 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=IUr6Lw+NnsqPBWYBrmq0WF1o8u+vmudIqx4yHm1X3FA=; b=l6y8UfvrzA4LBJ6QQVvlL5axUnfbrpAmLE9VQKlgCkwD2zQKSDsgKhi7YmqQ6zS+N+ EIhf60rB8pX97J0mf3hLhpUMmnZnwOzO95sNV8idH+ja9E49/f11E0dVZ5+mCXJ6jCVB KRvuJ2Rrz1ToM87oLQbTfW4U0+NhuB9RiyDq88jTOQfC+rGTU9MZ2z4QJux/RkYgXnyp 4C5G1rbL2gAGhRNfXycSIsb6i+b6e0kbpFsUlVptR1qMb/sg8PxyARSqpjc/d3BVitOb nyZmOWqvlv6QEIdRFCuOdtOa48Dj3NDZfGHOuRkNC5aec5WoWAXt10FWLmxUrKdAJ246 20zQ== X-Gm-Message-State: AOJu0YwvhFnp/fOi8Y/zCOGjCs1Ua3u0r38PMY1bFim/S7H8NdUvHl09 LqnzQfWUL5eqE7jJ1RsRV73+/KoHwJQlZx0lm3Bov2Km12Nx+VvUuhtIb19mNXDY7IzTyqUJ6Rg X X-Google-Smtp-Source: AGHT+IEfsgogO3s8OyY/F+bsq57H50OrFcJaMzzpsGSRu0B759IzBj35G6VsgkgKJTFAGDJYvk1vgQ== X-Received: by 2002:a05:600c:468d:b0:42c:aeee:da86 with SMTP id 5b1f17b1804b1-4319ad75782mr72843645e9.8.1730368363698; Thu, 31 Oct 2024 02:52:43 -0700 (PDT) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d6983c2sm19789835e9.42.2024.10.31.02.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 02:52:43 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Jacopo Mondi Subject: [PATCH v4 3/7] pipeline: rpi: Pass crop rectangle as a parameter to platformSetIspCrop() Date: Thu, 31 Oct 2024 09:49:53 +0000 Message-Id: <20241031094957.18471-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241031094957.18471-1-naush@raspberrypi.com> References: <20241031094957.18471-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; }