From patchwork Wed Jun 22 10:20:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16309 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 6B80FBD808 for ; Wed, 22 Jun 2022 10:21:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 140B56563D; Wed, 22 Jun 2022 12:21:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655893265; bh=R8W2IaKmrDLUH23lPmlzOIdyDArFwOsNlCOPxwtI32w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BPdfyIIXswJwP82nkjJf+FjChvYMHgJzSHBtWUPwBs0aqVuK3GhTLYHEoA2J8VwH2 zKoY77cneLsvv7zU4J51I1uxjVVEIaTD3IfzNDdWQ06wFjy+nzUb2VRJyjcnx7pPaW K/IZaFZOYXF1CBL/1MvaUHTjT1ct6jxvU3FjqnfYgxQtQp7QXq2byF/7cP4F9J9B3Q 9MOJ5wccQQ7z7LHk9FSggIvXIE/8rSveGKt9r3oiVWwAloUjhDXHvJcg1KjTLZttRd 8Th6jkm6Myxy1MpuZQZqyjQvwZR+gfH3kF/oUsiKbhybEKSajqyBMOm3xYNOOCx0eJ 24aDRvUVz7nLw== Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F04C633A7 for ; Wed, 22 Jun 2022 12:21:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qaNuaXEt"; dkim-atps=neutral Received: by mail-wr1-x432.google.com with SMTP id o8so22726051wro.3 for ; Wed, 22 Jun 2022 03:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=of8OcpUH49FJA/uG9bdSOgvolWS8eZrOGomkTlrVHdg=; b=qaNuaXEtimiC4yR4JtuWreDE7BOXcUaNKIsuvTexJa41KqCuN7S2UBKVbAhjhISwRD DNs1A06fMWfCz8TDdGgltcKuixfWLepQo22RBZRFUzLJO0NFvLftAeBrI1eATvwYwgwS NZn5PFWGQ1HFkKiZF5VWN3kFc0m2GIF00PjiCWehaNletYCEC3MOeklRykXPszhUClDZ bbCjpe8UQuS7Xu+Dv6PeMXTe+z7Vh5Byw3qRUSfiFmm8Sx70NtoLGyxTovt58zcxrSe3 XLsGOcCx4KY40oRDU7i62Ud/rLUk5cJ3ZA4DyCXrl0PFnEq83QzLq7UdbPtUaADrEnnQ Vwbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=of8OcpUH49FJA/uG9bdSOgvolWS8eZrOGomkTlrVHdg=; b=PR6WYjzkfCwfPJhkjOxzgJzneB4eK8I2rB5a2GZ/ocoXrL+CVvASapXenS+9W/Roox fZW8GucsGjIE2q8NodUVT987nrNxzprAM9k3Zjepi1oOVZJ9xVxUQg4GJyS/4Tu+Me9s 5DT24bZwv2tQVbcyb/8PlH6AIFgUsKfZz2/vBHrJQq6fNLFmu5WPyqzOQTJsUISXhX95 rKZxidn2pixtE5Fc42qS5FM+WjB6SXczhSYlT/xjoNBaFk6SmBk98WSvah+z0AyzdAS1 7du9Q8ywmMgYg8IkT4ELHPEBUvOQJhKLXypEbTAl/YU+RYIguxlfaqs548B+8wjv9jOU NbVQ== X-Gm-Message-State: AJIora9Rt9WsHSM9Ws3Pl0ohVNeOHEw4+UvX3ogO0DegBXQb3VP299+s vqo+gZ8nzSA3bmpwBAftLFb+uqYAvupfnD+m X-Google-Smtp-Source: AGRyM1s9stLD2YOEijmr9SFT/VKUJB2Pc5Jh85SYmdys7x0oeIDjPFmQYYNF9hpNM/5WRkhQIHl7XA== X-Received: by 2002:a05:6000:1548:b0:217:6480:e65 with SMTP id 8-20020a056000154800b0021764800e65mr2611386wry.381.1655893259869; Wed, 22 Jun 2022 03:20:59 -0700 (PDT) Received: from naush-laptop.localdomain ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id h204-20020a1c21d5000000b0039c693a54ecsm26849423wmh.23.2022.06.22.03.20.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 03:20:59 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 22 Jun 2022 11:20:47 +0100 Message-Id: <20220622102047.22492-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220622102047.22492-1-naush@raspberrypi.com> References: <20220622102047.22492-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 3/3] pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The ScalerCrop control is handled directly by the pipeline handler. Remove the control from the IPA's static ControlInfoMap, and let the pipeline handler add it to the ControlInfoMap advertised to the application, ensuring the limits are set appropriately based on the current sensor mode. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4596f2babcea..66a84b1dfb97 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -941,7 +941,15 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) data->properties_.set(properties::SensorSensitivity, result.modeSensitivity); /* Update the controls that the Raspberry Pi IPA can handle. */ - data->controlInfo_ = result.controlInfo; + ControlInfoMap::Map ctrlMap; + for (auto const &c : result.controlInfo) + ctrlMap.emplace(c.first, c.second); + + /* Add the ScalerCrop control limits based on the current mode. */ + ctrlMap.emplace(&controls::ScalerCrop, + ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize))); + + data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap()); /* Setup the Video Mux/Bridge entities. */ for (auto &[device, link] : data->bridgeDevices_) {