From patchwork Mon Nov 2 12:11:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28762 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 D5654C335A for ; Mon, 2 Nov 2026 12:11:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5B2586920A; Mon, 2 Nov 2026 13:11:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="avsCZjTa"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D508D691F2 for ; Mon, 2 Nov 2026 13:11:41 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 502731F36; Mon, 2 Nov 2026 13:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1793621365; bh=mjXEHVtv+ImZTQMFalbW88ygF+/S4O42Bla9w2/04cw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=avsCZjTaGLb5a3tRxXold6CJpNESmQeruVflM7glmvMHqUo0wUG5SXHNxOgxB0Scz aMOsfJYPRKwInVCwibxQUQ2M5KJYdS5ztbFYgvAtE1C265cd/FjTlFGR5yHEGkZrlX 7tUsrP+FHWi528cTy5fF449MbfkCHO8EkU/IzSuA= From: Kieran Bingham Date: Mon, 02 Nov 2026 12:11:34 +0000 Subject: [PATCH v2 2/3] libcamera: camera_sensor: Extend reporting in getFormat() MIME-Version: 1.0 Message-Id: <20261102-kbingham-orientation-v2-2-21b1cdd0d167@ideasonboard.com> References: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> In-Reply-To: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793621500; l=2079; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=mjXEHVtv+ImZTQMFalbW88ygF+/S4O42Bla9w2/04cw=; b=ivNYtAkc9spdEoFRJ8wxfXROO4QPU8B8Aw56Y+dxBrcwYg2ZBNhgSyPllcSw6dGkTsHgqgn85 Cy8go//CU2uD12XiIgtFvXh2UNEIUQoEy0TNbSzsJmZdlRgYowAhzJ2 X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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. Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- v2: - Keep log level as Debug --- 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 792e4b09d4fa..0e2085d91345 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Debug) + << "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 55b386cef3f3..14ab15b05ab3 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span 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 {}; }