| Message ID | 20261118-sklug-binning-factors-v1-v1-0-5e552aefbb07@ideasonboard.com |
|---|---|
| Headers | show
Return-Path: <libcamera-devel-bounces@lists.libcamera.org> 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 03487C3355 for <parsemail@patchwork.libcamera.org>; Wed, 18 Nov 2026 16:08:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EEBFC6A8F5; Wed, 18 Nov 2026 17:08:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZDUvW+gl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7474C6A8C7 for <libcamera-devel@lists.libcamera.org>; Wed, 18 Nov 2026 17:08:35 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c717:cce:84f5:c6f0]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EAF5563C; Wed, 18 Nov 2026 17:06:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1795017967; bh=t2pGDmhF6fcigAaw3buOYcykJ8b8fOmsiYk2jE1RWfo=; h=From:Subject:Date:To:Cc:From; b=ZDUvW+glFv4Louln/GMnztr82Xtnq93wp8dS0q80DvTOSlTqdYr0Qbz79SCf6y71t vm6YPm/53Fkvk5xoWonOQGBOQ5Ivf1lmX/ihgBel/CQjRbuIlfUx63ERUcq+YTUgoj IurB7zdZdwqAxu5al/9ANgdVd6eutbF9DagNBkhg= From: Stefan Klug <stefan.klug@ideasonboard.com> Subject: [PATCH RFC 0/3] libcamera: Allow to query binning factors Date: Wed, 18 Nov 2026 17:08:09 +0100 Message-Id: <20261118-sklug-binning-factors-v1-v1-0-5e552aefbb07@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3MQQqDQAxA0atI1gYaQbFuCz2AW3GhY5wGSywTH QTx7g5dvsX/JxgHYYMmOyFwFJNVEyjPwH0G9YwyJUPxKCoiqtGW7+5xFFVRj/PgtjUYRsJnNZY 1T0SuJEj5L/Asx3/dQft+QX9dN6pe62BvAAAA X-Change-ID: 20261118-sklug-binning-factors-v1-96b58ed11c51 To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug <stefan.klug@ideasonboard.com> X-Mailer: b4 0.14.3 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <libcamera-devel.lists.libcamera.org> List-Unsubscribe: <https://lists.libcamera.org/options/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe> List-Archive: <https://lists.libcamera.org/pipermail/libcamera-devel/> List-Post: <mailto:libcamera-devel@lists.libcamera.org> List-Help: <mailto:libcamera-devel-request@lists.libcamera.org?subject=help> List-Subscribe: <https://lists.libcamera.org/listinfo/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe> Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" <libcamera-devel-bounces@lists.libcamera.org> |
| Series |
|
| Related | show |
Hi everyone, For camshark to properly draw sensor rectangles (and most likely other use cases) it is necessary to know the binning factors of the chosen sensor configuration. Guessing these based on ScalerCropMaximum and image size is error prone especially when additional scalers (like the dw100 on the imx8mp) are involved. One idea was to add the binning factors to the camera properties. That was dropped in favour of extending the already existing CameraConfiguration::sensorConfig infrastructure. This RFC implements that functionality by adding a validatedSensorConfig() accessor to CameraConfiguration. To be honest, I don't like this implementation. It shows that CameraConfiguration::sensorConfig is not fully implemented and adding a similar function doesn't make that area of the API nicer. Additionally it requires us to populate the sensor config during validate() which adds complexity. If we'd just populate a camera property we could delay querying the binning factors until PipelineHandler::configure(). But camera properties should not be modified... oh my. This is only tested on rkisp1 and compile tested on the others. I'd be happy to get some thoughts on this. Best regards, Stefan Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- Stefan Klug (3): libcamera: v4l2_subdevice: Add whence parameter to set/getSelection() libcamera: camera_sensor: Add function to query the sensor configuration libcamera: Implement CameraConfiguration::validatedSensorConfig() include/libcamera/camera.h | 2 + include/libcamera/internal/camera_sensor.h | 4 ++ include/libcamera/internal/v4l2_subdevice.h | 14 ++-- src/libcamera/camera.cpp | 10 +++ src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 7 ++ src/libcamera/pipeline/ipu3/cio2.cpp | 10 ++- src/libcamera/pipeline/ipu3/cio2.h | 5 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 9 ++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++ .../pipeline/rpi/common/pipeline_base.cpp | 5 ++ src/libcamera/pipeline/rpi/common/pipeline_base.h | 3 + src/libcamera/pipeline/simple/simple.cpp | 10 +++ src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 + src/libcamera/pipeline/vimc/vimc.cpp | 2 + src/libcamera/pipeline/virtual/virtual.cpp | 2 + src/libcamera/sensor/camera_sensor_legacy.cpp | 83 ++++++++++++++++++++-- src/libcamera/sensor/camera_sensor_raw.cpp | 12 ++++ src/libcamera/v4l2_subdevice.cpp | 8 +-- src/py/libcamera/py_main.cpp | 3 +- test/stream/stream_colorspace.cpp | 8 +++ 21 files changed, 188 insertions(+), 19 deletions(-) --- base-commit: da6a6ed33ed0ab305f10b6f8b44736150d39cef4 change-id: 20261118-sklug-binning-factors-v1-96b58ed11c51 Best regards,