Skip to content

drivers: media: i2c: imx335: Fix frame size enumeration#6829

Merged
6by9 merged 1 commit intoraspberrypi:rpi-6.12.yfrom
kbingham:6.12/iob/topic/imx335
Apr 30, 2025
Merged

drivers: media: i2c: imx335: Fix frame size enumeration#6829
6by9 merged 1 commit intoraspberrypi:rpi-6.12.yfrom
kbingham:6.12/iob/topic/imx335

Conversation

@kbingham
Copy link
Copy Markdown
Contributor

In commit cfa49ff ("media: i2c: imx335: Support 2592x1940 10-bit mode") the IMX335 driver was extended to support multiple output modes.

This incorrectly extended the frame size enumeration to check against the supported mbus_codes array instead of the supported mode/frame array. This has the unwanted side effect of reporting the currently supported frame size 2592x1944 three times.

Fix the check accordingly to report a frame size for each supported size, which is presently only a single entry.

Fixes: cfa49ff ("media: i2c: imx335: Support 2592x1940 10-bit mode")
Upstream: https://lore.kernel.org/linux-media/20250430073649.1986018-1-kieran.bingham@ideasonboard.com/T/#u

In commit cfa49ff ("media: i2c: imx335: Support 2592x1940 10-bit
mode") the IMX335 driver was extended to support multiple output modes.

This incorrectly extended the frame size enumeration to check against
the supported mbus_codes array instead of the supported mode/frame
array. This has the unwanted side effect of reporting the currently
supported frame size 2592x1944 three times.

Fix the check accordingly to report a frame size for each supported
size, which is presently only a single entry.

Fixes: cfa49ff ("media: i2c: imx335: Support 2592x1940 10-bit mode")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Copy link
Copy Markdown
Contributor

@6by9 6by9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kieran.

With your comment on the upstream commit that you're expecting to add in binning support which will increase the number of modes, there's no point in debating the various logical operations that could be used.
It looks like Sakari has accepted it as-is presumably on that basis, so I'm good with it too.

Do you want me to see if David can do a basic tune on the sensor?

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 30, 2025

(Ignore the checkpatch CI failure - it only pulls the diffs, so doesn't have a full tree to find the git hashes of all commits).

@kbingham
Copy link
Copy Markdown
Contributor Author

Thanks Kieran.

With your comment on the upstream commit that you're expecting to add in binning support which will increase the number of modes, there's no point in debating the various logical operations that could be used. It looks like Sakari has accepted it as-is presumably on that basis, so I'm good with it too.

Yes, I stated about the 2/2 binning mode precisely because I put "if (fsize->index > 0)" instead of "if (fsize->index)" like you suggested because I want to make sure (for me, later) it's clear that this is going to later compare a size.

Do you want me to see if David can do a basic tune on the sensor?

Yes please! That would be great.

I'm probably going to try to do this myself - but it's not easy for me yet, and I don't know when I'll get to it - but it could give me a way to compare and see how I do compared to David's result (I suspect if David does the tune we'd merge his even if I attempt it though!)

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 30, 2025

Do you want me to see if David can do a basic tune on the sensor?

Yes please! That would be great.

I'm probably going to try to do this myself - but it's not easy for me yet, and I don't know when I'll get to it - but it could give me a way to compare and see how I do compared to David's result (I suspect if David does the tune we'd merge his even if I attempt it though!)

Did you have a cam_helper file for imx335?
I think I copied imx290 for my quick testing on the basis they were both Starvis sensors, but I didn't check the content against the datasheet.

@kbingham
Copy link
Copy Markdown
Contributor Author

Oh - yes - let me send a pr to rpi's libcamera or something if it's not already covered. It's already in the libipa handlers - but I probably didn't handle the RPi somewhere.

@6by9 6by9 merged commit 3dd2c2c into raspberrypi:rpi-6.12.y Apr 30, 2025
12 of 13 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Apr 30, 2025
See: raspberrypi/linux#6824

kernel: DT: arm: bcm2712: re-add mmio-hi ranges for pciex1
See: raspberrypi/linux#6825

kernel: Add DT controlled XTRIG control to imx296
See: raspberrypi/linux#6827

kernel: drm/v3d: Add job to pending list if the reset was skipped
See: raspberrypi/linux#6822

kernel: drivers: media: i2c: imx335: Fix frame size enumeration
See: raspberrypi/linux#6829
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Apr 30, 2025
See: raspberrypi/linux#6824

kernel: DT: arm: bcm2712: re-add mmio-hi ranges for pciex1
See: raspberrypi/linux#6825

kernel: Add DT controlled XTRIG control to imx296
See: raspberrypi/linux#6827

kernel: drm/v3d: Add job to pending list if the reset was skipped
See: raspberrypi/linux#6822

kernel: drivers: media: i2c: imx335: Fix frame size enumeration
See: raspberrypi/linux#6829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants