media: rockchip: fix camera format negotiation on Linux 6.6 - #385
Open
ocd0711 wants to merge 3 commits into
Open
media: rockchip: fix camera format negotiation on Linux 6.6#385ocd0711 wants to merge 3 commits into
ocd0711 wants to merge 3 commits into
Conversation
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>
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.
Summary
Fix camera format negotiation failures observed on RK3576 with Linux 6.6.
Linux 6.6 added the
streamfield tostruct v4l2_subdev_format. Anuninitialized format request may therefore contain an invalid stream ID,
causing the terminal sensor
get_fmtcall to fail.Changes
get_fmt.v4l2_subdev_formatrequest.Validation
scripts/checkpatch.pl --strict.