From patchwork Wed Dec 8 09:42:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15076 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 9C2F7BDB13 for ; Wed, 8 Dec 2021 09:42:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E76B60725; Wed, 8 Dec 2021 10:42:17 +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="ndGx8+lW"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 99F4360225 for ; Wed, 8 Dec 2021 10:42:15 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id i5so3026866wrb.2 for ; Wed, 08 Dec 2021 01:42:15 -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=ysGduBUkpkOLLQgKWUrLa/NyPE35c9VO543u7NEaSf8=; b=ndGx8+lWfFfP57BuoWrsa0zCG1Vdkdi7EkiCQU7zT0Lr0AuhERNZN7jZYCT6KKE/EV z+JvBEvqAmmQDF2IxCAUhQjqjIMc9sMotLRZPl2lWrEFZZf/76Tu/8PE0clBMpfOyMzq QDOpqFss68jQaL5cNCd5PAuCyo5GWpGpsUd3CmrQdjrqiaInOFWPY1QFJUNomy5MBaBP efZFNm1B0o7fc+8d+UUz4AZlXtcrY9gjZ0rfoUlIHWwPrgwpUAGH6wcV46JAk2Gi0WD2 WH37wlUxShNS7DEhqXhVDnQ2/7/+QIFQQP9JCokPysb4BZUOh/z6jzHL1h35JAOJ8tG3 hqzg== 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=ysGduBUkpkOLLQgKWUrLa/NyPE35c9VO543u7NEaSf8=; b=qVJjbk0VrYXDWR//GQgBuQjZbZZ/Q5ViM6wyYepNRt5GSbVdqqZVP5mREkjfbg2KIY w9q5U7ve6/tEWbOk1WDMnYk7sfEA+YimemdGGroSOCcuWP79x0+Y0lZVVZprFLuThXOs bH+BW8tA6b5f8vO0IbbNsiVvWtmQHUYXW0LNKDuWnN1Ps61aCXffsi0P/o4KdktWT8cE aHx1nRVCD4oVr6GFdkDmsmR7avvCMeiwbuh++ogDzbfVtmhYHYZyEvhq8SMegBjGUxIJ Fe/b1TbcIJfDLIce3DWgxtdKUFQSTJH/HAtUsz7LzWzg6pNrMEIydZkeAtnQv1l4Zg0j rSFw== X-Gm-Message-State: AOAM530FtTg2IiVZHYjVR3Nir+I4fKg510DeEV5H8G/Aa4Sw1JcG9WZF /xY8DJYNqTAtmx+ylHAh7CCN16cGJrW4MTRi X-Google-Smtp-Source: ABdhPJywyVIM8ij8sVqFx6Bfk0PN6ElZHl/HDIPSFtlB5lTQXT2cJVCx2up9b2KIrLkkuE0VBqYTzA== X-Received: by 2002:a5d:4fcc:: with SMTP id h12mr60356297wrw.434.1638956535119; Wed, 08 Dec 2021 01:42:15 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:27d5:9305:f572:6623]) by smtp.gmail.com with ESMTPSA id t127sm5279951wma.9.2021.12.08.01.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 01:42:14 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Dec 2021 09:42:10 +0000 Message-Id: <20211208094211.1251311-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 62db8f26b77d..4479e732a645 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -162,10 +162,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 << ")"; } } @@ -1747,8 +1747,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 09:42:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15077 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 6127FC324B for ; Wed, 8 Dec 2021 09:42:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9AF916087A; Wed, 8 Dec 2021 10:42:17 +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="DXJSWAi8"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4132B60225 for ; Wed, 8 Dec 2021 10:42:16 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id i5so3026911wrb.2 for ; Wed, 08 Dec 2021 01:42:16 -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=A7WhXwvVvQd6xB5i0I/8oDkRHjG4O5d4gvylgMkQj+A=; b=DXJSWAi8ebmdnPc6VKYRd3LY4YNvdb5WDPrv2M5kYviF5yG5j3sdQkq/0LL/sUh5le stQJUmW4c7f5Taw6dpfs10tI6U1o2j3arQYf/kGmrZzkp2CEpAp02ga/hIETldHpzFZY y+s/zuSuPI6z3tX1npV1Ed9evckua1uh7nxCKDovU7UpZ+fKX79gVk73ioJVu6jlz9/F yVKJmDnZo5rGfi4RH1jwv20FLuSpUWaYGhOl9X4XmX2cE2V08NR3KJpdXOydUK77GDiK PydDXK3TQpWJ/wXry8iNwnMy0mnwlgktkPMBjwObEAmM7zxlbTRgUYs41TTF2FafCb9c h5hQ== 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=A7WhXwvVvQd6xB5i0I/8oDkRHjG4O5d4gvylgMkQj+A=; b=P87WMEEZHy1DgHNJ4+MzVtNEFAlLcxvdVBQn2HZjZriVOB763gjPvfP30Yyy9mS1Lh 5DAWWb0QwGYLCY8Sx+L+gBTI2dPo8j9VOGyFAgMJAnCuPMoQtv5Qda72joeynMXeMAYT nK07vnevPGnJG50RxkHNCcn7IqHfIvD1N+ck9J6gGbDhRBsHrSWo6kOLw44mq35cP1bE /NiigYw3rW2xFauGoUfr8bgqkMpBtAzmvZWKdK3UN0DEmeEC/GZYy+KNoq8AW+w7FPa6 Ijsd514pKvnGnlaG8wMFR+c+0TMxFRsFEjiseOXxW5hXE/KddKF5VQZBpWVqik5YtuhE EAJw== X-Gm-Message-State: AOAM532qm+WmHKTBx25NitWopcCwEBGDryYarYgxJ3UrRTUUv88gQ4zJ WObNmoet/sbOlFntrjxWYGhPv9mlgI8DL8AB X-Google-Smtp-Source: ABdhPJzDRmRgek1+FXZOIdT29C9wfh5eNSUETnHiItOZvNcSM/s5N5vftrHSg35CZR6B10a10lywuQ== X-Received: by 2002:adf:e512:: with SMTP id j18mr58155084wrm.532.1638956535788; Wed, 08 Dec 2021 01:42:15 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:27d5:9305:f572:6623]) by smtp.gmail.com with ESMTPSA id t127sm5279951wma.9.2021.12.08.01.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 01:42:15 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Dec 2021 09:42:11 +0000 Message-Id: <20211208094211.1251311-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211208094211.1251311-1-naush@raspberrypi.com> References: <20211208094211.1251311-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 4479e732a645..6ee975e85567 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -531,10 +531,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); @@ -547,7 +548,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; @@ -600,11 +601,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); } }