From patchwork Wed Dec 8 12:36:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15079 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 CFF47BDB13 for ; Wed, 8 Dec 2021 12:36:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8795760725; Wed, 8 Dec 2021 13:36:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="rhz9i65O"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B64260225 for ; Wed, 8 Dec 2021 13:36:40 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id n33-20020a05600c502100b0032fb900951eso4045346wmr.4 for ; Wed, 08 Dec 2021 04:36:40 -0800 (PST) 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=E7CLIrqrJiwLN/jNNgXj3Wp/tw22Abt5xww5XM+Lbw8=; b=rhz9i65OByFenARxe1wQwfOWeujFGKG8mFICqWeK173sCiOZoaIliw1VnkLwhiam4M 9vUTPR5pZmXkI5rJzAvgn6IOfCI+DRVLiSI6K8qew1kxen+b9Ee4QUYfeB1Qd1sQnFWj tZt+rI5xU8dwRT6chmrNNPiHy1he8YV3SIm/FSTQhjPcp3x7uBOkIUCMGeBDmjpNG/9g 77Xlt5tz9JYbCfW0yrNJHI6x7NYzr15+IYj2tC1t7kIT3n5YibdwUzwDngQ1EwQ1R3O/ qzL6Y4PPUlWvu0Fk6lXs41VXL1wcgf1za5oKW5fZgDaL1OT5h0msPO/GEQTlxkgcmhYN AfaQ== 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=E7CLIrqrJiwLN/jNNgXj3Wp/tw22Abt5xww5XM+Lbw8=; b=UcH3kJY7bCTfpYyCAhfrEfh7yCPLQVFSZBd7kPPg1JbzAsQ7aIbTg66ZxIgbQo8U19 d/3o6U33DyzdMmsZ2PfYtwNR+uzqvi71oNEw+PmENFIJId4IELJzaAssyxiGsDX5b5gQ vLh7oLs17wy5XBPf61fkPC88XqHKrC14pQ5r3dWsg02yP2NuZbvH4qcqaSicSUPNGr3b Cih43aD+q5LtNQMuain7iwtZsDjpXCoijjvDMsurLY8+poWME3Po1xykx+M1+ckCR9UB JCssd0MJW+OtYxbHVxqDSmXGCUwSsd0RhiR0eQuNL/WSv1Ry9+Po5SdphKaQNgHCZ3tr UoHA== X-Gm-Message-State: AOAM533uIec/fnBoiYjtetYFI3QAt3a4DZbjsVoSdPHHUZ+hl61pdeab WUTwrnJ/6UtViji5wp4ePshYMaW6cw2vtPZp X-Google-Smtp-Source: ABdhPJzTxBMCDMWrUqW9zR/5g9QqAPXNhhXiUDBVVhhBYTVutgXVv1fDwfdTBDTqzjZIcoPk1joGHg== X-Received: by 2002:a1c:a58d:: with SMTP id o135mr15512978wme.93.1638967000008; Wed, 08 Dec 2021 04:36:40 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:27d5:9305:f572:6623]) by smtp.gmail.com with ESMTPSA id n15sm5830360wmq.38.2021.12.08.04.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 04:36:39 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Dec 2021 12:36:36 +0000 Message-Id: <20211208123637.1332668-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] pipeline: raspberrypi: Reduce logging verbosity 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" Demote a couple of lines of logging to Debug level to reduce the verbosity of the log output during startup. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 22c8ee6831d3..101aaea30743 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -161,10 +161,10 @@ V4L2SubdeviceFormat findBestFormat(const SensorFormats &formatsMap, const Size & bestFormat.size = size; } - LOG(RPI, Info) << "Format: " << size.toString() - << " fmt " << format.toString() - << " Score: " << score - << " (best " << bestScore << ")"; + LOG(RPI, Debug) << "Format: " << size.toString() + << " fmt " << format.toString() + << " Score: " << score + << " (best " << bestScore << ")"; } } @@ -1746,8 +1746,8 @@ void RPiCameraData::checkRequestCompleted() state_ = State::Idle; if (dropFrameCount_) { dropFrameCount_--; - LOG(RPI, Info) << "Dropping frame at the request of the IPA (" - << dropFrameCount_ << " left)"; + LOG(RPI, Debug) << "Dropping frame at the request of the IPA (" + << dropFrameCount_ << " left)"; } } } From patchwork Wed Dec 8 12:36:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15080 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 60FA1C324B for ; Wed, 8 Dec 2021 12:36:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EEC806086A; Wed, 8 Dec 2021 13:36:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="AG7aj4g3"; dkim-atps=neutral Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4007660225 for ; Wed, 8 Dec 2021 13:36:41 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 77-20020a1c0450000000b0033123de3425so4102151wme.0 for ; Wed, 08 Dec 2021 04:36:41 -0800 (PST) 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=CgCVonvnxXDsJlMyIqj1/iVqjcm0DbL2S+Y1AFRZDPQ=; b=AG7aj4g3mCMoVn0SLgANAgBe6oQxzVdud+LIokrWyufHh9azhZKd0sIpG/tHV5tRvh QTIr/hNRqeCXHDZ6/wJMYltRJn5Vx4pNJlJPyvLQAvKJXNypAQXlXSO3IoJfi/0X+bbT B9uzATSFf/JxRabsmZ9Vp0grv8+oXpDIZWyqxoy5r4OMcOTZpevDkSn5VjO/7D67J34b c+lVgXCbd+RMb+gALUWI7kb0cvdmNjK6m5XtBVf6noW+LQ60fZShaI8Ck2XquIeWDSSh 9ZdkTzrRYREO1RRb2xCM8Q3rFrcpQubDOmVMy//W3QsKMx3a7o+yQfyE2uc5iyZFrade YVuw== 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=CgCVonvnxXDsJlMyIqj1/iVqjcm0DbL2S+Y1AFRZDPQ=; b=nPT8ztnd9g3oHHmR4taYCjhOAdA046Lv1pqrdEzw+1TmGBKIyfaYy2Bhf4V7uo/Cpq mWENHL1VV0lVyiajZH6GLNBnuHG4XAQNo4NwLmGX2Ws0M0L79uTde2K9Xl24KiOI7kQH xEKFu4WvGibM47IDxwqGSCg2EekQDfMJbhTJcAg9Kiz0VAujz1ZTJdyzZz7ZsHBIrZoR BFBTTUPhpEPqv/aqAKk0cLSXNSWzyan0E1NTM4XGvPFTUBU7ObSjy+vaFfswSQgPzhcB 2VPgGe7WfLGjkhvQU9MEG2SOuxQgCNiE10UxTiTw48vbcPccGlSlADrpOJ5CwRPoQaiG F5vA== X-Gm-Message-State: AOAM533pgGiab2mbzy+hX+McLIeZ4OyovZLlnzvYsL8qoIgP6/2igcP6 c1S/VoRzX1Shfyf4N3osW/zjBeCji4/bE9Kc X-Google-Smtp-Source: ABdhPJyKM7mGZrHrjC+Cc1mO/UkvGwtH3jinE2GXvrNrbE2+NGRNMZ2IPelstBom5KX0imBJqzMhXw== X-Received: by 2002:a05:600c:5125:: with SMTP id o37mr15597969wms.81.1638967000738; Wed, 08 Dec 2021 04:36:40 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:27d5:9305:f572:6623]) by smtp.gmail.com with ESMTPSA id n15sm5830360wmq.38.2021.12.08.04.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 04:36:40 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Dec 2021 12:36:37 +0000 Message-Id: <20211208123637.1332668-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211208123637.1332668-1-naush@raspberrypi.com> References: <20211208123637.1332668-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi: Restrict the advertised maximum ISP output resolution 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" Limit the advertised ISP output sizes available to the sensor resolution in PipelineHandlerRPi::generateConfiguration(). The user is free to configure a larger resolution than this, and this will work. However, this stops strange behavior in applications that use the V4L2 compatability layer to run, and request the largest possible advertised resolution, which is much larger than the sensor resolution. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 101aaea30743..86851ac467ad 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -530,10 +530,11 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, unsigned int rawCount = 0; unsigned int outCount = 0; + Size sensorSize = data->sensor_->resolution(); for (const StreamRole role : roles) { switch (role) { case StreamRole::Raw: - size = data->sensor_->resolution(); + size = sensorSize; sensorFormat = findBestFormat(data->sensorFormats_, size, defaultRawBitDepth); pixelFormat = mbusCodeToPixelFormat(sensorFormat.mbus_code, BayerFormat::Packing::CSI2); @@ -546,7 +547,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, fmts = data->isp_[Isp::Output0].dev()->formats(); pixelFormat = formats::NV12; /* Return the largest sensor resolution. */ - size = data->sensor_->resolution(); + size = sensorSize; bufferCount = 1; outCount++; break; @@ -599,11 +600,15 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, std::forward_as_tuple(format.second.begin(), format.second.end())); } } else { - /* Translate the V4L2PixelFormat to PixelFormat. */ + /* + * Translate the V4L2PixelFormat to PixelFormat. Note that we + * limit the recommended largest ISP output size to match the + * sensor resolution. + */ for (const auto &format : fmts) { PixelFormat pf = format.first.toPixelFormat(); if (pf.isValid()) - deviceFormats[pf] = format.second; + deviceFormats[pf].emplace_back(sensorSize); } }