[PATCH 0/2] media: rockchip: rkcif: ENUM_FMT and bytesperline fixes
From: Faizel K B
Date: Thu Nov 05 2026 - 18:24:05 EST
This series fixes two issues in the rkcif MIPI capture path, found while
using the libcamera simple pipeline handler with a Sony IMX415 on a
Radxa ROCK 5B+ (RK3588).
Patch 1 makes VIDIOC_ENUM_FMT honour the mbus_code field, as required
for V4L2_CAP_IO_MC devices. Without it, userspace can select a pixel
format that doesn't match the media bus format, e.g. a different Bayer
order, and the captured images have wrong colours.
Patch 2 aligns bytesperline to 8 bytes, as required by the MIPI DMA,
and honours a larger value requested by userspace. This allows the
capture buffers to be imported as DMA-BUFs by the libcamera GPU
software ISP on Panfrost, which needs a 64-byte stride alignment,
instead of copying every frame.
Tested on ROCK 5B+ with IMX415 (SGBRG10, 3864x2192): correct colours
without any userspace workaround, and a stride of 7936 bytes accepted
and used for zero-copy import. The corresponding libcamera change is
under review at:
https://patchwork.libcamera.org/patch/28662/
Faizel K B (2):
media: rockchip: rkcif: Filter enumerated formats by media bus code
media: rockchip: rkcif: Honour the requested bytesperline on MIPI
.../platform/rockchip/rkcif/rkcif-stream.c | 37 ++++++++++++++++---
1 file changed, 32 insertions(+), 5 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0