@@ -1187,6 +1187,6 @@ std::string CameraSensorRaw::logPrefix() const
return "'" + entity_->name() + "'";
}
-REGISTER_CAMERA_SENSOR(CameraSensorRaw, -200)
+REGISTER_CAMERA_SENSOR(CameraSensorRaw, 0)
} /* namespace libcamera */
@@ -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;
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 <jai.luthra@ideasonboard.com> --- 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(-)