Skip to content

media: rockchip: fix camera format negotiation on Linux 6.6 - #385

Open
ocd0711 wants to merge 3 commits into
rockchip-linux:develop-6.6from
ocd0711:develop-6.6
Open

media: rockchip: fix camera format negotiation on Linux 6.6#385
ocd0711 wants to merge 3 commits into
rockchip-linux:develop-6.6from
ocd0711:develop-6.6

Conversation

@ocd0711

@ocd0711 ocd0711 commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Fix camera format negotiation failures observed on RK3576 with Linux 6.6.

Linux 6.6 added the stream field to struct v4l2_subdev_format. An
uninitialized format request may therefore contain an invalid stream ID,
causing the terminal sensor get_fmt call to fail.

Changes

  • Initialize the CSI2 DPHY sensor format request before calling get_fmt.
  • Zero-initialize the CIF v4l2_subdev_format request.
  • Reject NULL input formats instead of storing or dereferencing them.

Validation

  • Tested with RK3576 and GC2053 camera sensors.
  • Kernel boots and the camera media pipelines initialize.
  • All patches pass scripts/checkpatch.pl --strict.

Yuefu Su and others added 3 commits August 20, 2026 16:22
Set pad and which before forwarding get_fmt to the terminal sensor.
This prevents stale caller values from selecting an invalid pad or format
state.

Signed-off-by: Yuefu Su <yuefu.su@rock-chips.com>

Signed-off-by: Conghao Hu <ocd2057try@gmail.com>
Linux 6.6 added the stream field to struct v4l2_subdev_format.
Leaving the request uninitialized can pass a random stream ID to get_fmt
and make the terminal sensor format lookup fail.

Zero-initialize the request so unspecified fields, including stream, use
their default value.

Signed-off-by: Conghao Hu <ocd2057try@gmail.com>
rkcif_get_input_fmt() can return NULL when the terminal sensor format
lookup fails. Reject the error before storing or dereferencing the format,
and keep the output format check defensive for its other callers.

Signed-off-by: Conghao Hu <ocd2057try@gmail.com>
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.

1 participant