media: imx335: Support 2x2 binning mode (and misc fixes)#7058
Closed
jailuthra wants to merge 7 commits intoraspberrypi:rpi-6.12.yfrom
Closed
media: imx335: Support 2x2 binning mode (and misc fixes)#7058jailuthra wants to merge 7 commits intoraspberrypi:rpi-6.12.yfrom
jailuthra wants to merge 7 commits intoraspberrypi:rpi-6.12.yfrom
Conversation
The sensor datasheet reports actual total number of pixels as 2696x2044. This becomes important for supporting 2x2 binning modes that can go beyond the current maximum pixel array width set here. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
While switching modes, updating to a different value of HBLANK isn't sufficient, as this is a read-only control with a single allowed value, and thus hblank_min == hblank_max == hblank of the default mode. So to correctly update the user-facing value of the HBLANK parameter, which is necessary for correct framerate calculation, update the whole range when switching modes. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Simplify .s_stream callback implementation by moving the runtime PM calls to the leaf functions. This patch should not affect any functionality. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Port the driver to use the subdev active state. This simplifies locking, and makes it easier to support different crop sizes for binned modes, by storing the crop rectangle inside the subdev state. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Introduce 2x2 binning mode (1312x972@60fps). Since there are multiple modes now, use v4l2_find_nearest_size() to select the appropriate mode in .set_fmt(). For 2x2 binning the minimum shutter value supported is 17 instead of 9. This effects the maximum allowed exposure time, and if not enforced then the sensor produces very dark frames when the minimum shutter limit is violated. Lastly, update the crop size reported to the userspace. When trying 2x2 binning with the datasheet suggested pixel array size (i.e. 2592 / 2 => 1296), on some platforms (Raspberry Pi 5) artefacts are introduced on the right edge of the output image. Instead, using a higher width of 1312 works fine on all platforms. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Switch from s_stream to enable_streams and disable_streams callbacks. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
In the early probe we can fail with -EPROBE_DEFER. Use dev_err_probe to ignore these warnings before we successfully power on the camera. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Contributor
|
Hi Jai, Unless there's a compelling reason to merge these immediately, I'd prefer to wait until they have been accepted and merged upstream, at which point you can repost them with a first line of "commit upstream." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for 2x2 binning mode for Sony IMX335, along with some improvements like using subdev active state, fixing the native pixel array width to match the datasheet (this was needed to circumvent #6896) and misc improvements to the driver.
These changes are picked from these two upstream series, posted by me and @kbingham:
https://lore.kernel.org/all/20250915-imx335_binning-v3-0-16ecabf2090d@ideasonboard.com/
https://lore.kernel.org/all/20250915120015.3062426-1-kieran.bingham@ideasonboard.com/