Skip to content

CFE/Unicam: Fix breakage from #7406#7444

Merged
pelwell merged 3 commits into
raspberrypi:rpi-6.18.yfrom
6by9:rpi-6.18.y-tc358743
Jun 17, 2026
Merged

CFE/Unicam: Fix breakage from #7406#7444
pelwell merged 3 commits into
raspberrypi:rpi-6.18.yfrom
6by9:rpi-6.18.y-tc358743

Conversation

@6by9

@6by9 6by9 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

I missed a follow up patch from upstream in #7406, and then copied the same error into the CFE driver.

Fix them up. (The Unicam patch hasn't been accepted and merged upstream, but has R-b responses).

ehristev and others added 3 commits June 17, 2026 11:18
…mats

The commit
08f9794 ("media: bcm2835-unicam: Fix RGB format / mbus code association")
introduced a check to see whether the format requested is the same as the
fourcc in the format list.

However, this breaks the case when userspace requested an unpacked fourcc,
e.g. RG10.

Unicam can work with or without unpacking pixels, e.g. pRAA or RG10, depending
on what userspace requests.
In the unpacking case, a dedicated register is being set.

If the userspace requests pRAA, this works, because the check validates the
pipeline:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=3280,height=2464,pixelformat=pRAA \
 --stream-mmap --stream-count=1 --stream-to=frame.raw

but, with
v4l2-ctl -d /dev/video0 --set-fmt-video=width=3280,height=2464,pixelformat=RG10 \
--stream-mmap --stream-count=1 --stream-to=frame.raw

unicam complains at validation level:

image: format mismatch: 0x300f <=> RG10 little-endian (0x30314752)

This should work, because MEDIA_BUS_FMT_SRGGB10_1X10 can be packed into either
RG10 or pRAA depending on the packing register.

To fix this, modified the condition check to also allow in the case when
requested format (fmt->pixelformat) is equal to fmtinfo->unpacked_fourcc.

Fixes: 08f9794 ("media: bcm2835-unicam: Fix RGB format / mbus code association")
Signed-off-by: Eugen Hristev <ehristev@kernel.org>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Commit 67f3a61 ("media: rp1-cfe-downstream: Fix RGB format /
mbus code association") missed the handling of the unpacked and
compressed output formats in the same way the original Unicam patch
did. Fix it.

Fixes: 67f3a61 ("media: rp1-cfe-downstream: Fix RGB format / mbus code association")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Commit e552091 ("media: rp1-cfe: Fix RGB format / mbus code
association") missed the handling of the unpacked and compressed
output formats in the same way the original Unicam patch did.
Fix it.

Fixes: e552091 ("media: rp1-cfe: Fix RGB format / mbus code association")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9 6by9 requested a review from naushir June 17, 2026 11:14
@pelwell pelwell merged commit 677a1f4 into raspberrypi:rpi-6.18.y Jun 17, 2026
11 of 12 checks passed
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.

3 participants