Skip to content

Unicam Media Controller support #4641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 22, 2021

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Oct 20, 2021

Updates bcm2835-unicam to allow it to use Media Controller fully for the more complex pipelines.

This does still want to be updated to add a DT switch between MC-centric and video-centric in addition to the module parameter. There's then the discussion over which we adopt as the default.
@naushir has patches to make libcamera work with the new scheme, and that is the way we want to go, but it may need some coordination in changeover.

@6by9 6by9 changed the title Unicam Media Controller support WIP: Unicam Media Controller support Oct 20, 2021
@6by9
Copy link
Contributor Author

6by9 commented Oct 20, 2021

Added a couple of extra patches that will be squashed into the "Add support for configuration via MC API", but Naush may have started reviewing.


static void unicam_mc_set_default_format(struct unicam_node *node, int pad_id)
{
if (pad_id == IMAGE_PAD) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still wonder if this should query the subdev for the format, but it's not something other drivers do...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conversion is based largely on Tomi's conversion of ti-vpe, and that doesn't do it.
AIUI The only interaction between the subdevs should be during link_validate, and we do that now.

@6by9 6by9 force-pushed the rpi-5.10.y-unicam-mc branch from eab179d to 9b5a2e2 Compare October 21, 2021 14:17
@6by9
Copy link
Contributor Author

6by9 commented Oct 21, 2021

Rebased, fixed up comments, added updates to all CSI source overlays, and squashed.

Overlays shouldn't change now (expect based on review comments), but v4l2-compliance is complaining so I need to fix that up.

@6by9 6by9 force-pushed the rpi-5.10.y-unicam-mc branch 3 times, most recently from e478e1f to 2185d80 Compare October 21, 2021 16:50
@6by9
Copy link
Contributor Author

6by9 commented Oct 21, 2021

OK, hopefully that has everything sorted.

v4l2-compliance is now happy with both nodes. I have also changed the default embedded data buffer size to 16kB - sorry Naush as that sort of makes your latest changes redundant (at least for now).

Removing WIP tag, but want Naush's confirmation that we're now all good from his side.

@6by9 6by9 changed the title WIP: Unicam Media Controller support Unicam Media Controller support Oct 21, 2021
naushir added a commit to naushir/libcamera that referenced this pull request Oct 22, 2021
…roller

Switch the pipeline handler to use the new Unicam media controller based driver.
With this change, we directly talk to the sensor device driver to set controls
and set/get formats in the pipeline handler.

This change requires the accompanying Raspberry Pi linux kernel change at
raspberrypi/linux#4641. If this kernel change is not
present, the pipeline handler will fail to run with an error message informing
the user to update the kernel build.

Signed-off-by: Naushir Patuck <[email protected]>
@naushir
Copy link
Contributor

naushir commented Oct 22, 2021

Yup, all looks good to me.

I'm happy to merge all but d49eb3d straight away. If we can hold off merging the overlays switch to MC, that can be co-ordinated with the userland changes.

@6by9
Copy link
Contributor Author

6by9 commented Oct 22, 2021

I'll update PR to drop d49eb3d and make a new PR for it (to be merged when libcamera changes are also accepted).

6by9 and others added 3 commits October 22, 2021 11:23
The driver was making big assumptions about the source device
using pad 0 and 1, which doesn't follow for more complex
devices where Unicam's source device may be a sink device for
something else.

Read the pad numbers through media controller, and reference
them appropriately.

Signed-off-by: Dave Stevenson <[email protected]>
Adds Media Controller API support for more complex pipelines.
libcamera is about to switch to using this mechanism for configuring
sensors.

This can be enabled by either a module parameter, or device tree.

Various functions have been moved to group video-centric and
mc-centric functions together.

Based on a similar conversion done to ti-vpe.

Signed-off-by: Dave Stevenson <[email protected]>
Commit db8e94e upstream

The existing link format validation failure debug message in media-entity.c
helped to pinpoint the point of failure but provided no additional
information what's wrong. Tell the user exactly why the validation failed.

Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
@6by9 6by9 force-pushed the rpi-5.10.y-unicam-mc branch from 2185d80 to b9ef900 Compare October 22, 2021 10:24
@6by9
Copy link
Contributor Author

6by9 commented Oct 22, 2021

Overlays patch dropped. Should be good to go.

@pelwell pelwell merged commit 600a08c into raspberrypi:rpi-5.10.y Oct 22, 2021
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
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