From patchwork Fri Oct 23 10:58:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 28581 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 D18FFC324C for ; Fri, 23 Oct 2026 10:59:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 88D8F68FC3; Fri, 23 Oct 2026 12:59:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Cou1e+pS"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7ED3368FAB for ; Fri, 23 Oct 2026 12:59:43 +0200 (CEST) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c30:59f6:be2b:2877:6bc4:392]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 392471D0F; Fri, 23 Oct 2026 12:57:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1792753054; bh=PiEY8zN72On+lVmeHRZEZmxchAcmiq6iQO6iDZYQMCk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Cou1e+pSCnnzBkFw8CRLHJIjK8YlFQIN96uIBaqcKwxVsZ0Fq44DYXPExlPd45//W XcqoGAkYrqSqL9U9r+E21ZAumR57MSi6NGZ/oO1yO4dOwSWslFUKei+oSB45l5VajJ PGE3J46ZH1l6leplDEX54uM2boZDoR0+2AH7IvsE= From: Jai Luthra Date: Fri, 23 Oct 2026 16:28:19 +0530 Subject: [PATCH WIP RFC 11/26] libcamera: Support raw sensor model MIME-Version: 1.0 Message-Id: <20261023-b4-raw-model-v1-11-eadb9948901b@ideasonboard.com> References: <20261023-b4-raw-model-v1-0-eadb9948901b@ideasonboard.com> In-Reply-To: <20261023-b4-raw-model-v1-0-eadb9948901b@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart , Kieran Bingham , Sakari Ailus , Naushir Patuck , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2330; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=PiEY8zN72On+lVmeHRZEZmxchAcmiq6iQO6iDZYQMCk=; b=kA0DAAoBQ96R+SSacUUByyZiAGrbPc2gLLkRi9Nd1frwVC+c48rx9dQMpOcLvW8QIx+Cl0TJz okCMwQAAQoAHRYhBE3g2Bjl1XXo1FqvxUPekfkkmnFFBQJq2z3NAAoJEEPekfkkmnFFyfoP/1d9 KPt1QBKcs3DC6+AX+Gb4SqElX+TaFkY/nQQBYPFDUb584fnMzATsQ6yYnrbKj6eeTJ2wJhvLHIN L1m3uOCUqVGR5veurhA0Dii72oxTSeSTt82ke+eYzeGvJ0oReUa6Tni1S0jMgdBPGxPGMrUtyme tMKnZ/xR9fTe12L6VXjj/FkazSX6pumClcE2UN4Uq5cTEAhITurv7qcrONGW8SPgSHiOsbfUbMK 9g78DNXmNS35lIEVE+OQwp5YWmf1cjKztY6BSiAryhl35OX6EmVehw5O4jtyXTtJ67Dqsrojhle Uo2I7+v4O8CMTIisuY0PCrv8cjc8fz4/m2ZBUDCElwCLrPhle2kBwRW1yxSXcNXH/dKb83AQiME jSKNb5sJwb+niMQ9V7QD/TLc3cPDWe1s08ZRwd4J8Dk6DJq4GWe9Lt5ETMSjAKqvRi5yNekVlJZ giVaPjXfnR5+0+CH40Gzl6yVYB+WGKPx1F0O5cNQe/Uev0Z2HVVlG75H6atNCLdLJZK6J1zOxVP Wr4xSOTZb1+OJUeD7vWlFq+mExsu5mXeEWFlZOCmM+xaUGYJNGNw0Di6x82nPY2S5qwMwBn27X4 HbfnrbwzxFmGzCSb/1bnXxanQF8NjsVln8W7/UAvqFHi5qMj8Ze58+APkfWuSbf20qtsWmadfC9 De3uI X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 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" Now that the raw sensor model is fully supported, set the client capability bit V4L2_SUBDEV_CLIENT_CAP_COMMON_RAW_SENSOR when interacting with V4L2 subdevices. Also bump the priority back up for the CameraRawSensor class, so it is matched first for sensors that support the new model. Signed-off-by: Jai Luthra --- This commit needs to be at the very end of the series before merging. I've kept it in the middle to ease review for now, as it is a WIP series. --- src/libcamera/sensor/camera_sensor_raw.cpp | 2 +- src/libcamera/v4l2_subdevice.cpp | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index d8874a7c5e1a..5301bc6d9f8c 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -1187,6 +1187,6 @@ std::string CameraSensorRaw::logPrefix() const return "'" + entity_->name() + "'"; } -REGISTER_CAMERA_SENSOR(CameraSensorRaw, -200) +REGISTER_CAMERA_SENSOR(CameraSensorRaw, 0) } /* namespace libcamera */ diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 36f17e23da8e..28f962bbdd10 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -1281,19 +1281,21 @@ int V4L2Subdevice::open() return ret; } + struct v4l2_subdev_client_capability clientCaps{}; + clientCaps.capabilities = V4L2_SUBDEV_CLIENT_CAP_COMMON_RAW_SENSOR; + /* If the subdev supports streams, enable the streams API. */ if (caps_.hasStreams()) { - struct v4l2_subdev_client_capability clientCaps{}; - clientCaps.capabilities = V4L2_SUBDEV_CLIENT_CAP_STREAMS; + clientCaps.capabilities |= V4L2_SUBDEV_CLIENT_CAP_STREAMS; + } - ret = ioctl(VIDIOC_SUBDEV_S_CLIENT_CAP, &clientCaps); - if (ret < 0) { - ret = -errno; - LOG(V4L2, Error) - << "Unable to set client capabilities: " - << strerror(-ret); - return ret; - } + ret = ioctl(VIDIOC_SUBDEV_S_CLIENT_CAP, &clientCaps); + if (ret < 0 && errno != ENOTTY) { + ret = -errno; + LOG(V4L2, Error) + << "Unable to set client capabilities: " + << strerror(-ret); + return ret; } return 0;