Re: [PATCH v3 0/9] media: Add support for Broadcom/RPi BCM2835 ISP
From: Paul Elder
Date: Mon Aug 31 2026 - 01:42:51 EST
Hi Jai,
Thanks for the series.
Quoting Jai Luthra (2026-07-17 20:04:15)
> Hi,
>
> This series adds initial support for Broadcom/Raspberry Pi BCM2835 ISP
> present on older Raspberry Pi boards.
>
> The underlying hardware for the ISP is accessed through the VideoCore
> VPU, via the VCHIQ/MMAL interface that was recently destaged under
> platform/raspberrypi. The ISP driver, and thus this series, depends on
> VCSM CMA driver for shared memory support (for lens shading buffers):
>
> https://lore.kernel.org/all/20260105-b4-vc-sm-cma-v2-0-4daea749ced9@xxxxxxxxxxxxxxxx/
>
> The baseline driver was taken from the one present in the downstream
> raspberrypi 6.12 tree (which was posted as v1 with minor cleanups).
>
> Since then the driver has been significantly modified, switching away
> from custom V4L2 controls to parameter buffers for ISP configuration,
> and many other fixes.
>
> You can test this series with libcamera, using the following branch:
> https://github.com/jailuthra/libcamera/tree/pi4-upstream
It works! \o/
Tested on Raspberry Pi 4B with imx219.
# cam -c1 --capture=10
[42:53:29.157032279] [4146] INFO Camera camera_manager.cpp:340 libcamera v0.7.2+10-0de3e405
[42:53:29.182984113] [4149] INFO IPAProxy ipa_proxy.cpp:184 Using tuning file /usr/share/libcamera/ipa/rpi/vc4/imx219.json
[42:53:29.191749464] [4149] WARN RPI vc4.cpp:377 Mismatch between Unicam and CamHelper for embedded data usage!
[42:53:29.192265409] [4149] INFO Camera camera_manager.cpp:223 Adding camera '/base/i2c-mux0/i2c@1/camera@10' for pipeline handler rpi/vc4
[42:53:29.192290964] [4149] INFO RPI vc4.cpp:434 Registered camera /base/i2c-mux0/i2c@1/camera@10 to Unicam device /dev/media0 and ISP device /dev/media1
Using camera /base/i2c-mux0/i2c@1/camera@10 as cam0
[42:53:29.192825798] [4146] INFO Camera camera.cpp:1216 configuring streams: (0) 800x600-XRGB8888/sRGB
[42:53:29.192997261] [4149] INFO RPI vc4.cpp:644 Sensor: /base/i2c-mux0/i2c@1/camera@10 - Selected sensor format: 1640x1232-SBGGR10_1X10/RAW - Selected unicam format: 1640x1232-pBAA/RAW
cam0: Capture 10 frames
154409.246635 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 1920000
154409.279952 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 1920000
154409.313269 (30.01 fps) cam0-stream0 seq: 000002 bytesused: 1920000
154409.380002 (14.99 fps) cam0-stream0 seq: 000003 bytesused: 1920000
154409.446734 (14.99 fps) cam0-stream0 seq: 000004 bytesused: 1920000
154409.513466 (14.99 fps) cam0-stream0 seq: 000005 bytesused: 1920000
154409.580197 (14.99 fps) cam0-stream0 seq: 000006 bytesused: 1920000
154409.646930 (14.99 fps) cam0-stream0 seq: 000007 bytesused: 1920000
154409.713658 (14.99 fps) cam0-stream0 seq: 000008 bytesused: 1920000
154409.780390 (14.99 fps) cam0-stream0 seq: 000009 bytesused: 1920000
Tested-by: Paul Elder <paul.elder@xxxxxxxxxxxxxxxx>
>
> Thanks,
> Jai
>
> Signed-off-by: Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>
> ---
> Changes in v3:
> - Rebase on v7.2-rc1
> - Split PATCH 1 to add missing incles before moving the headers
> - Update commit messages with Laurent's suggestions
> - Drop redundant buffer list and locks for params as we send them
> immediately to the firmware in .buf_queue
> - Drop the now empty .stop_streaming() for params node
> - Minor cleanups
> - Link to v2: https://lore.kernel.org/r/20260210-b4-vchiq-isp-v2-0-4403944152fe@xxxxxxxxxxxxxxxx
>
> Changes in v2:
> - Replace custom V4L2 controls (V4L2_CID_USER_BCM2835_ISP_*) with the
> V4L2 extensible parameters framework via a dedicated metadata output
> node (bcm2835-isp-params). Split params handling into new file
> bcm2835-isp-params.c.
> - Add AWB gains and digital gain as extensible parameter block types
> instead of standard V4L2 integer controls.
> - Use MEDIA_ENT_F_PROC_VIDEO_ISP instead of MEDIA_ENT_F_PROC_VIDEO_SCALER
> for the media entity function.
> - Rework media controller registration: let video device nodes handle
> their own entity registration, removing the manual entity/interface
> creation in media_controller_register_node().
> - Propagate colorspace, ycbcr_enc, xfer_func, and quantization properly
> through g_fmt/s_fmt.
> - Fold the stats/params FourCC additions (previously a separate commit)
> into this patch.
> - Drop the custom CID base commit (no longer needed).
> - Update documentation.
> - Link to v1: https://lore.kernel.org/r/20260113-b4-vchiq-isp-v1-0-ea0b300bffc8@xxxxxxxxxxxxxxxx
>
> ---
> Dave Stevenson (1):
> media: videobuf2: Allow exporting of a struct dmabuf
>
> Jai Luthra (6):
> platform/raspberrypi: vchiq-mmal: Include missing headers
> platform/raspberrypi: vchiq-mmal: Move headers to include/linux
> platform/raspberrypi: vchiq-mmal: Support ISP parameters and stats
> platform/raspberrypi: vchiq-mmal: Support bayer and gray formats
> platform/raspberrypi: vchiq: Add helpers for vchiq driver data
> media: platform: broadcom: Move unicam driver to subdir
>
> Naushir Patuck (2):
> media: platform: broadcom: Add bcm2835-isp driver
> platform/raspberrypi: vchiq: Load bcm2835_isp driver from vchiq
>
> Documentation/admin-guide/media/bcm2835-isp.dot | 14 +
> Documentation/admin-guide/media/bcm2835-isp.rst | 78 +
> Documentation/admin-guide/media/v4l-drivers.rst | 1 +
> .../userspace-api/media/v4l/meta-formats.rst | 1 +
> .../media/v4l/metafmt-bcm2835-isp.rst | 101 ++
> MAINTAINERS | 12 +-
> drivers/media/common/videobuf2/videobuf2-core.c | 21 +-
> drivers/media/platform/broadcom/Kconfig | 18 +-
> drivers/media/platform/broadcom/Makefile | 3 +-
> .../media/platform/broadcom/bcm2835-isp/Kconfig | 15 +
> .../media/platform/broadcom/bcm2835-isp/Makefile | 4 +
> .../broadcom/bcm2835-isp/bcm2835-isp-common.h | 51 +
> .../broadcom/bcm2835-isp/bcm2835-isp-fmts.h | 558 ++++++++
> .../broadcom/bcm2835-isp/bcm2835-isp-params.c | 470 ++++++
> .../broadcom/bcm2835-isp/bcm2835-v4l2-isp.c | 1502 ++++++++++++++++++++
> .../media/platform/broadcom/bcm2835-unicam/Kconfig | 23 +
> .../platform/broadcom/bcm2835-unicam/Makefile | 3 +
> .../{ => bcm2835-unicam}/bcm2835-unicam-regs.h | 0
> .../broadcom/{ => bcm2835-unicam}/bcm2835-unicam.c | 0
> drivers/media/v4l2-core/v4l2-ioctl.c | 2 +
> .../raspberrypi/vchiq-interface/vchiq_arm.c | 2 +
> .../platform/raspberrypi/vchiq-mmal/mmal-vchiq.c | 9 +-
> .../linux/raspberrypi}/mmal-common.h | 4 +
> .../linux/raspberrypi}/mmal-encodings.h | 68 +
> .../linux/raspberrypi}/mmal-msg-common.h | 0
> .../linux/raspberrypi}/mmal-msg-format.h | 0
> .../linux/raspberrypi}/mmal-msg-port.h | 0
> .../linux/raspberrypi}/mmal-msg.h | 0
> .../linux/raspberrypi}/mmal-parameters.h | 86 ++
> .../linux/raspberrypi}/mmal-vchiq.h | 0
> include/linux/raspberrypi/vchiq_arm.h | 1 +
> include/linux/raspberrypi/vchiq_bus.h | 10 +
> include/media/videobuf2-core.h | 15 +
> include/uapi/linux/bcm2835-isp.h | 530 +++++++
> include/uapi/linux/videodev2.h | 2 +
> 35 files changed, 3579 insertions(+), 25 deletions(-)
> ---
> base-commit: 728e68a889bcf257b1e67298b12c360e5c3a13e0
> change-id: 20250923-b4-vchiq-isp-7e8c22c2860c
> prerequisite-message-id: 20260717-b4-vc-sm-cma-v3-0-6c4e77804e5d@xxxxxxxxxxxxxxxx
> prerequisite-patch-id: 07e50207cc947f44e1d626b31d0ace7e12a8f3a1
> prerequisite-patch-id: 3d82a2605799686668729fdc2677c3f6b7c2aa0d
> prerequisite-patch-id: 3022f05545dcfdaf05522f8ce1ebd8b9e3bc412f
> prerequisite-patch-id: ad833b78f90ce3081e470caf70e601fc573bb52d
> prerequisite-patch-id: 1898d91213e9bd75be3109180527fb0caf6d7174
> prerequisite-patch-id: d0cfc49c673c8c4a4c13d44a547104c24f57cb49
>
> Best regards,
> --
> Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>
>
>