v4l2-ctl --list-formats-ext does not generate correct information


I have an sensor which has several modes.
The modes has same resolution but has different fps like imx185 reference code below.

static const struct camera_common_frmfmt imx185_frmfmt[] = {
	{{1920, 1080}, imx185_30fps, 1, 0,
	{{1920, 1080}, imx185_60fps, 1, 0,

When I use v4l2-ctl to get list of available formats, it outputs wrong information.
It reports correct framesize but the framerate is from the first mode which has same framesize.
For above modes of imx185, v4l2-ctl will outputs 2 formats, (1920x1080 @30fps and 1920x1080 @30fps)

I looked into the related v4l2 api in camera_common.c and found that this behavior is expected from the code.

Although I cannot get formats list from v4l2 api, nvarguscamerasrc can get correct information.
Where does argus get information ? (device tree?)

Is there any plan to fix this ?

If I combine two mode with same resolution, v4l2-ctl works.

static const struct camera_common_frmfmt imx185_frmfmt[] = {
	{{1920, 1080}, imx185_30_60fps, 2, 0,
[s]	{{1920, 1080}, imx185_60fps, 1, 0,

However, tegra kernel expects imx185_frmfmt corresponds to device tree and this modification does not meet the requirements.

hello rary,

this caused by only first sensor mode of frame intervals reported, it seems an internal bug of tegra_channel_enum_frameintervals() function.

we’ll investigate this internally.

Hi JerryChang,

Thank you.

hello rary,

we had also added use_sensor_mode_id control property in device tree.
you’ll need to update sensor driver by implement TEGRA_CAMERA_CID_SENSOR_MODE_ID controls.
hence, Argus can just send the mode-id to driver to set to specific mode without going through v4l2 framework’s mode selection logic.

Hi JerryChang,

I’m aware that argus uses sensor_mode property to select sensor mode before launching.

My problem is not I cannot select mode from frame format.

v4l2-ctl --list-formats-ext

This command produces wrong result as stated in the first post.

I solved this problem by adding a member to camera_common_sensor_ops just for v4l2 format enumeratation in camera_common.c