Re: [PATCH 4/5] [media] uvcvideo: create pad links after subdev registration

From: Javier Martinez Canillas
Date: Mon Sep 07 2015 - 10:10:39 EST


On 09/03/2015 06:00 PM, Javier Martinez Canillas wrote:
> The uvc driver creates the pads links before the media entity is
> registered with the media device. This doesn't work now that obj
> IDs are used to create links so the media_device has to be set.
> Move entities registration logic before pads links creation.
> Signed-off-by: Javier Martinez Canillas <javier@xxxxxxxxxxxxxxx>
> ---
> drivers/media/usb/uvc/uvc_entity.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
> diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
> index 429e428ccd93..9dde1f86cc4b 100644
> --- a/drivers/media/usb/uvc/uvc_entity.c
> +++ b/drivers/media/usb/uvc/uvc_entity.c
> @@ -37,6 +37,10 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
> if (sink == NULL)
> return 0;
> + ret = v4l2_device_register_subdev(&chain->dev->vdev, &entity->subdev);

Testing this patch on an Exynos Chromebook that has a built-in USB camera, I
noticed that v4l2_device_register_subdev() was wrongly called for UVC entities

So I have the following [0] v2 patch. This patch was tested on an Exynos5800
Peach Pi Chromebook using qv4l2 to test video capture and the output of the
media-ctl -p command was compared with and without the MC next gen patches
to verify that was identical in both cases.

The media-ctl -p output is:

And the mc_next_gen -e -i -I -l output is

Normally I would just resend the complete series but since there are so many
in-flight patches, I preferred to only re-send this patch one in this thread.

Best regards,
Javier Martinez Canillas
Open Source Group
Samsung Research America