From patchwork Tue Nov 17 15:15:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28952 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 EA72CC3355 for ; Tue, 17 Nov 2026 15:15:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A9B0E6A895; Tue, 17 Nov 2026 16:15:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hjRgLMGT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E42F6A88C for ; Tue, 17 Nov 2026 16:15:12 +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 5BA482022; Tue, 17 Nov 2026 16:12:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794928364; bh=duTwtMDpLzPbbj0xAPi/Fz8IRgYwwz0J5dS3a4gRTnc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hjRgLMGTL7qGvMw6GK+9yrOtaH294Xd9nIbHZ580Jf8/ykOUredqcShZdSi3vafhF i75RjFOnmcZkoT10H+2zciwsdlm460pzW5xSlJVzS2fo3kC8NuQtic9aPrkeE+wSNB A549oVc8Q+8gkLIyQvNksAGCz9rZcOHSLwpayziI= From: Kieran Bingham Date: Tue, 17 Nov 2026 15:15:01 +0000 Subject: [PATCH v3 1/2] libcamera: camera_sensor: Extend reporting in getFormat() MIME-Version: 1.0 Message-Id: <20261117-kbingham-orientation-v3-1-b86563a93c34@ideasonboard.com> References: <20261117-kbingham-orientation-v3-0-b86563a93c34@ideasonboard.com> In-Reply-To: <20261117-kbingham-orientation-v3-0-b86563a93c34@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=1794928511; l=2128; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=duTwtMDpLzPbbj0xAPi/Fz8IRgYwwz0J5dS3a4gRTnc=; b=wgkwtNOoYrh4vGrOJyJyRkc9uw8cSejkDaEUi7eiQkOdEoNVQwNNj5j+Me/yNhiKHMqLIMkbq r0Hru3tQFdOC+B2MYuNuDAV1roQArjGtxmwGDzRBNABZaxN1B85Bqp4 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 v3: - Keep log level as Debug in *both* cases --- 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..5caa9122f962 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, Debug) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; }