From patchwork Thu May 1 14:16:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 23331 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 9E472C327D for ; Thu, 1 May 2025 14:16:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4E26268AD9; Thu, 1 May 2025 16:16:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Sk80Z774"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CDBC368AD5 for ; Thu, 1 May 2025 16:16:13 +0200 (CEST) Received: from Monstersaurus.lgs-net.com (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ABA2F82A; Thu, 1 May 2025 16:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1746108966; bh=D0/2zUQlvXuJedoYsqSiOkKRCiWN0FZ3b1bx8rieaYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sk80Z7744lSrPHuliUmxZ6VTWamRty16ePWMlvFI4Gjyao2d3uslZdDJ3d+Y6Nyys V+jlG0f/didqNhPWi65aJTWc8npV8hjkLua9nNy+73nDUQnicwuhpsR+ZWhc+nAG32 RYPhSJ+R80PO17JoEq60YJxsnG+OB19noysItcNQ= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH 2/3] libcamera: camera_sensor: Extend reporting in getFormat() Date: Thu, 1 May 2025 15:16:08 +0100 Message-ID: <20250501141609.717148-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250501141609.717148-1-kieran.bingham@ideasonboard.com> References: <20250501141609.717148-1-kieran.bingham@ideasonboard.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" When a pipeline handler asks the CameraSensor for a format, which is not achievable, it can be very helpful to the user to identify what size was requested and why it could not be provided within any constrained maximum size. This can make otherwise difficult to diagnose user errors visible and quickly correctable. Both of the CameraSensorRaw and CameraSensorLegacy are updated accordingly but that likely means these two classes could soon benefit from a more common base class to share otherwise identical code. Signed-off-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +++- src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 32989c19c019..20275f3bb1b2 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -742,7 +742,9 @@ CameraSensorLegacy::getFormat(const std::vector &mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Warning) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index ab75b1f8204c..07d1e2bfa600 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -800,7 +800,9 @@ CameraSensorRaw::getFormat(const std::vector &mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Warning) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; }