From patchwork Tue Jul 5 13:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16545 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 9ACBBBD1F1 for ; Tue, 5 Jul 2022 13:41:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 102A86330C; Tue, 5 Jul 2022 15:41:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657028475; bh=vmqd/2NC13QnZsEiQxdnT++vlTNJvAKRGOFaYlam2CA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=kDtndGVXh/0E6Yz/P/oBoWiaDqVvhHIJOGueR1MAyuyzlyGkK4oRjtb7a4actdB4k /kwvVnzKFo8biycz332fbMdQutIVCLa4uGUryBEQdNIfQ/p9FXc9hycu+lUXB2zEqe Ba0bw8rgevmJNOdNVGyxCFzL1DD4pDLozf0wgJbsr3Z43eCIIorJjGE5ueTtnW3vvq w7XckM1IbamAuO7qRkpx0Fwre6GHloKRhYM9okUNBIUDW7NFlKhATOrEmCRI+Ijpc+ LRWBkfe7XShXxehXi+c8hA2tUCpqCIcWMM0TPqYmHeyjW5ZoT50mw7BKmh43brqTSi kvC8d+eMVWqyg== Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C56E61FB0 for ; Tue, 5 Jul 2022 15:41:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="UHRzKdR0"; dkim-atps=neutral Received: by mail-wr1-x436.google.com with SMTP id v16so6183738wrd.13 for ; Tue, 05 Jul 2022 06:41:12 -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:mime-version :content-transfer-encoding; bh=mVYAiQtwB6M20uPMaz67xmVS72EN2vGvZctzvZROwvg=; b=UHRzKdR0H8cVtqyJHJfIyNlz/mw/8E1pBPkynGWmYIVKdJIvpusE8djdRngrr46bZj BixBn04Qu6bUDqjFs3OFQs5cMrhbMMlTiLybqQIb/ZfwdK6jMMokE0z34LvSr2f/9u9I AvJ+xn1taxuU+IYq6ksumgoi2OQKa7GXCmWdG0Ngyso7bG4pbBfNxwVP99dwsnwDq9Xf XSUAIz1Els/WiOU+80z3RToIx8NDkMcx4l7x7oEKvZN8enBKIojBqQwnEQe/rFCsc5EQ ihnc/f2v8drBOkEv+hqWQ9brSvoxFeCIz644yRQK4IhdDcU83nwDFP/+YAFwgW842Tpd d2BQ== 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:mime-version :content-transfer-encoding; bh=mVYAiQtwB6M20uPMaz67xmVS72EN2vGvZctzvZROwvg=; b=crVq9jz1mc4EDXKHpKHxKRkRsp/ROvH95Kb+j6mMtEbnunLnnPlHZQO7ybgl2HfqWa s+Uk8IRIv4fJoHp+RHDmiKsNMoVb2C7zNzSerbPcXAefS9I3aCiDm4gXl+eplSA6hecI qVHK4E4jKY4AJX1Wcas5JUhfy0YZkI3RNt/EcVoURWiZ96/d5d+f+5xxEwwTN+MPMmBf RDAq710pUL/DbuPxXJC7vTUCW/F47KSugi+QNNG0kq3QvX45voZU6JOTvW83GFvwtmyt hGc+K8sRspRo18ix39cNcmErlc+sTC7kmEUA3GHup3h8dF0eTKyeGDkRvnGWWLD7gmr8 12EA== X-Gm-Message-State: AJIora/Mg2dwlTktMlL7JRshfaGPt730A14OgCJ7cp6klwO98V5dJfSf GGoMhr89TAyQujkmbaV9nz4JTqJMvPG21yDj X-Google-Smtp-Source: AGRyM1u92ndNwW1gyzqvJan3VjX9KaaqlU5XaIF1hCJsruLDUjFXQNOVtaVf4WMFs6u9xDICwynBrg== X-Received: by 2002:a5d:410d:0:b0:21d:7195:43f3 with SMTP id l13-20020a5d410d000000b0021d719543f3mr3973009wrp.456.1657028471956; Tue, 05 Jul 2022 06:41:11 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c020c00b003a04b0bcb43sm22187192wmi.40.2022.07.05.06.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 06:41:11 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Jul 2022 14:41:00 +0100 Message-Id: <20220705134100.26713-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] pipeline: raspberrypi: Fix incorrect advertising of ScalerCrop 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 controls::ScalerCrop in the ControlInfoMap was advertised based on the ISP output Rectangle. This is incorrect, it needs to be set based on the sensor output Rectangle. Fix this. Additionally, do not use emplace to be consistent with the other controls set in the ControlInfoMap. Fixes: 9dacde0d651d (pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler) Reported-by: David Plowman Signed-off-by: Naushir Patuck --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 66a84b1dfb97..d1ecc50af3b9 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -946,8 +946,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) 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))); + ctrlMap[&controls::ScalerCrop] = + ControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.analogCrop.size())); data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());