-
Notifications
You must be signed in to change notification settings - Fork 5.3k
media: i2c: imx219: Scale the pixel rate for analog binning #7045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I didn't understand the benefit of adding the binning_mode enumeration, but no objections. |
Neither do I TBH - it was an upstream thing 😃 |
|
Adding "Commit f513997 upstream" would help Dom for rebasing onto 6.15 and above. |
When the analog binning mode is used for high framerate operation, the pixel rate is effectively doubled. Account for this when setting up the pixel clock rate, and applying the vblank and exposure controls. The previous logic only used analog binning for RAW8, but normal binning limits the framerate on RAW10 480p [1]. So with this patch we switch to using special binning (with 2x pixel rate) wherever possible. Backport of commit f513997 upstream. [1]: raspberrypi#5493 Co-developed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Co-developed-by: Vinay Varma <varmavinaym@gmail.com> Signed-off-by: Vinay Varma <varmavinaym@gmail.com> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Done! |
kernel: dtoverlays: adjust inbound windows for MIP1 on Pi 5 with 32-bit PCIe DMA See: raspberrypi/linux#7049 kernel: drm/vc4: hvs: Populate YUV to RGB matrices for GEN_6D See: raspberrypi/linux#7043 kernel: DRM command line parser fix See: raspberrypi/linux#7051 kernel: Overlays: rpi-power-hat i2c_arm enable See: raspberrypi/linux#7055 kernel: configs: Add CONFIG_W1_SLAVE_DS2430=m See: raspberrypi/linux#7056 kernel: media: i2c: imx219: Scale the pixel rate for analog binning See: raspberrypi/linux#7045
kernel: dtoverlays: adjust inbound windows for MIP1 on Pi 5 with 32-bit PCIe DMA See: raspberrypi/linux#7049 kernel: drm/vc4: hvs: Populate YUV to RGB matrices for GEN_6D See: raspberrypi/linux#7043 kernel: DRM command line parser fix See: raspberrypi/linux#7051 kernel: Overlays: rpi-power-hat i2c_arm enable See: raspberrypi/linux#7055 kernel: configs: Add CONFIG_W1_SLAVE_DS2430=m See: raspberrypi/linux#7056 kernel: media: i2c: imx219: Scale the pixel rate for analog binning See: raspberrypi/linux#7045
|
@naushir Hello. I've tried reading camera with kernel version of 6.12.48. And it seems that this fix causes another issue. FPS seems to be fixed however I get my images with horizontal stipes of 64 pixels high that are misaligned. (attached example image) When I revert to a stable kernel this issue is not present. |
|
What command line are you using for the above capture? |
|
I don't use a command line directly. I read frames using libcamera bindings to Rust... but basically here is my settings that I get from the sensor: And I read a Plane from a FrameBuffer. I've tried running exactly the same code on different kernel versions and on a Linux rpi 6.12.34+rpt-rpi-2712 everything is fine. |
|
Thanks - confirmed that this breaks the 1640x1232 mode. Annoyingly I did not test this one as 640x480 is the only mode that is applicable for the rate change. Sign, this is again upstream trying to achieve modeless settings that now break some modes :( |
Fewer modes = more modeless. |
1640x1232 with this patch also changes to 83.7 fps (which is what I'm trying to use) |
That may not be a functional mode/framerate on this sensor. |
|
I've mentioned it in raspberrypi/libcamera#308 At that time I used just a python picamera2 module (which internally uses libcamera) and was able to read 80 fps without any issues. and for a new: So newer version makes SRGGB10_CSI2P mode to work on 83 fps. |
The new version lists that it works at 83fps. That doesn't necessarily mean it actually works. |
|
I understand that. However I would like to use at least 8 bit SRGGB8 in 80fps mode. And on latest stable kernel it only exposes 40 fps. And this seems like a regression to me |
|
#7063 updates another downstream patch from 6.6 to fix the mode specific binning factors. |
See: raspberrypi/linux#6945 kernel: net: phy: broadcom: Add led-swap property support See: raspberrypi/linux#7060 kernel: Select internal MSI target for 32-bit DMA on Pi 5 PCIe See: raspberrypi/linux#7059 kernel: configs: Add CONFIG_VEML6030=m See: raspberrypi/linux#7052 kernel: media: i2c: imx219: Scale the pixel rate for analog binning See: raspberrypi/linux#7045 kernel: staging: vc-sm-cma: Fix field-spanning write warning See: raspberrypi/linux#7064 kernel: drm/rp1: rp1-dsi: Add support for inverting lane polarities See: raspberrypi/linux#7065 kernel: ARM: dts: Select the PL011 platform driver See: raspberrypi/linux#7023 kernel: media: i2c: imx219: fix binning and rate_factor for 480p and 1232p See: raspberrypi/linux#7063
See: raspberrypi/linux#6945 kernel: net: phy: broadcom: Add led-swap property support See: raspberrypi/linux#7060 kernel: Select internal MSI target for 32-bit DMA on Pi 5 PCIe See: raspberrypi/linux#7059 kernel: configs: Add CONFIG_VEML6030=m See: raspberrypi/linux#7052 kernel: media: i2c: imx219: Scale the pixel rate for analog binning See: raspberrypi/linux#7045 kernel: staging: vc-sm-cma: Fix field-spanning write warning See: raspberrypi/linux#7064 kernel: drm/rp1: rp1-dsi: Add support for inverting lane polarities See: raspberrypi/linux#7065 kernel: ARM: dts: Select the PL011 platform driver See: raspberrypi/linux#7023 kernel: media: i2c: imx219: fix binning and rate_factor for 480p and 1232p See: raspberrypi/linux#7063

When the analog binning mode is used for high framerate operation, the pixel rate is effectively doubled. Account for this when setting up the pixel clock rate, and applying the vblank and exposure controls.
The previous logic only used analog binning for RAW8, but normal binning limits the framerate on RAW10 480p 1. So with this patch we switch to using special binning (with 2x pixel rate) wherever possible.
Co-developed-by: Naushir Patuck naush@raspberrypi.com
Co-developed-by: Vinay Varma varmavinaym@gmail.com