All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Helen Koike <helen.koike@collabora.co.uk>,
	linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com,
	jgebben@codeaurora.org, mchehab@osg.samsung.com
Cc: Helen Fornazier <helen.fornazier@gmail.com>,
	Helen Koike <helen.koike@collabora.com>
Subject: Re: [PATCH v5] [media] vimc: Virtual Media Controller core, capture and sensor
Date: Mon, 5 Sep 2016 11:01:13 +0200	[thread overview]
Message-ID: <700a9e7b-0bb6-7923-6528-12d65c4f62b4@xs4all.nl> (raw)
In-Reply-To: <f231cdc7-1b31-6ac1-8e88-37b8b89e9fc2@collabora.co.uk>

On 09/04/2016 10:05 PM, Helen Koike wrote:
> Hi Hans,
> 
> Thank you for your review.
> 
> On 2016-08-22 07:57 AM, Hans Verkuil wrote:
>> Hi Helen,
>>
>> A few small code comments are below.
>>
>> Note that if I try to capture I see these two messages in the kernel log:
>>
>> [588197.368145] vimc vimc.0: Entity type for entity Sensor A was not initialized!
>> [588197.368169] vimc vimc.0: Entity type for entity Sensor B was not initialized!
> 
> 
> I correct this, I am sending it in v6.
> 
> 
>>
>> I also can't capture anything: v4l2-ctl --stream-mmap just sits there, waiting for
>> frames, I guess.
>>
>> I'm not sure if that has to do with the two warnings above.
> 
> 
> This is weird, v4l2-ctl --stream-mmap works for me even with those 
> messages above, could you try again with the v6 please?

Yup, v6 fixed it for me. Not sure what was the cause, but it's now working fine.

Once I have Laurent's Ack I'll take it.

Thanks for all your hard work, I'm sure you expected this to get in sooner, but
better late than never!

	Hans

> 
> 
>>
>> I am assuming that the initial pipeline is correct and that you should be able
>> to start streaming. If not, then attempting to start streaming should return an
>> error.
>>
>> On 08/18/2016 12:09 AM, Helen Koike wrote:
>>> From: Helen Fornazier <helen.fornazier@gmail.com>
>>>
>>> First version of the Virtual Media Controller.
>>> Add a simple version of the core of the driver, the capture and
>>> sensor nodes in the topology, generating a grey image in a hardcoded
>>> format.
>>>
>>> Signed-off-by: Helen Koike <helen.koike@collabora.com>
>>
>> <snip>
>>
>>> +static int vimc_cap_querycap(struct file *file, void *priv,
>>> +			     struct v4l2_capability *cap)
>>> +{
>>> +	struct vimc_cap_device *vcap = video_drvdata(file);
>>> +
>>> +	strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
>>> +	strlcpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
>>> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
>>> +		 "platform:%s", vcap->v4l2_dev->name);
>>> +
>>> +	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
>>
>> This line should be moved to vimc_cap_create:
>>
>> 	vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
>>
>> This is new. The v4l2 core will fill in the querycap capabilities for you
>> based on vdev->device_caps.
>>
>>> +
>>> +	return 0;
>>> +}
>>
>> <snip>
>>
>>> +static int vimc_device_register(struct vimc_device *vimc)
>>> +{
>>> +	unsigned int i;
>>> +	int ret = 0;
>>> +
>>> +	/* Allocate memory for the vimc_ent_devices pointers */
>>> +	vimc->ved = devm_kcalloc(vimc->mdev.dev, vimc->pipe_cfg->num_ents,
>>> +				 sizeof(*vimc->ved), GFP_KERNEL);
>>> +	if (!vimc->ved)
>>> +		return -ENOMEM;
>>> +
>>> +	/* Register the media device */
>>> +	ret = media_device_register(&vimc->mdev);
>>> +	if (ret) {
>>> +		dev_err(vimc->mdev.dev,
>>> +			"media device register failed (err=%d)\n", ret);
>>> +		return ret;
>>> +	}
>>> +
>>> +	/* Link the media device within the v4l2_device */
>>> +	vimc->v4l2_dev.mdev = &vimc->mdev;
>>> +
>>> +	/* Register the v4l2 struct */
>>> +	ret = v4l2_device_register(vimc->mdev.dev, &vimc->v4l2_dev);
>>> +	if (ret) {
>>> +		dev_err(vimc->mdev.dev,
>>> +			"v4l2 device register failed (err=%d)\n", ret);
>>> +		return ret;
>>> +	}
>>> +
>>> +	/* Initialize entities */
>>> +	for (i = 0; i < vimc->pipe_cfg->num_ents; i++) {
>>> +		struct vimc_ent_device *(*create_func)(struct v4l2_device *,
>>> +						       const char *const,
>>> +						       u16,
>>> +						       const unsigned long *);
>>> +
>>> +		/* Register the specific node */
>>> +		switch (vimc->pipe_cfg->ents[i].node) {
>>> +		case VIMC_ENT_NODE_SENSOR:
>>> +			create_func = vimc_sen_create;
>>> +			break;
>>> +
>>> +		case VIMC_ENT_NODE_CAPTURE:
>>> +			create_func = vimc_cap_create;
>>> +			break;
>>> +
>>> +		/* TODO: Instantiate the specific topology node */
>>> +		case VIMC_ENT_NODE_INPUT:
>>> +		case VIMC_ENT_NODE_DEBAYER:
>>> +		case VIMC_ENT_NODE_SCALER:
>>> +		default:
>>> +			/* TODO: remove this when all the entities specific
>>> +			 * code are implemented
>>> +			 */
>>> +			create_func = vimc_raw_create;
>>> +			break;
>>> +		}
>>> +
>>> +		vimc->ved[i] = create_func(&vimc->v4l2_dev,
>>> +					   vimc->pipe_cfg->ents[i].name,
>>> +					   vimc->pipe_cfg->ents[i].pads_qty,
>>> +					   vimc->pipe_cfg->ents[i].pads_flag);
>>> +		if (IS_ERR(vimc->ved[i])) {
>>> +			ret = PTR_ERR(vimc->ved[i]);
>>> +			vimc->ved[i] = NULL;
>>> +			goto err;
>>> +		}
>>> +
>>> +		/* Set use_count to keep track of the ved structure */
>>> +		vimc->ved[i]->ent->use_count = i;
>>> +	}
>>> +
>>> +	/* Initialize the links between entities */
>>> +	for (i = 0; i < vimc->pipe_cfg->num_links; i++) {
>>> +		const struct vimc_ent_link *link = &vimc->pipe_cfg->links[i];
>>> +
>>> +		ret = media_create_pad_link(vimc->ved[link->src_ent]->ent,
>>> +					    link->src_pad,
>>> +					    vimc->ved[link->sink_ent]->ent,
>>> +					    link->sink_pad,
>>> +					    link->flags);
>>> +		if (ret)
>>> +			goto err;
>>> +	}
>>> +
>>> +	/* Expose all subdev's nodes*/
>>> +	ret = v4l2_device_register_subdev_nodes(&vimc->v4l2_dev);
>>> +	if (ret) {
>>> +		dev_err(vimc->mdev.dev,
>>> +			"vimc subdev nodes registration failed (err=%d)\n",
>>> +			ret);
>>> +		goto err;
>>> +	}
>>> +
>>> +	return 0;
>>> +
>>> +err:
>>> +	/* Destroy de so far created topology */
>>
>> s/de/the/
>>
>>> +	vimc_device_unregister(vimc);
>>> +
>>> +	return ret;
>>> +}
>>
>> Regards,
>>
>> 	Hans
>>
> 
> 
> Regards,
> Helen
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2016-09-05  9:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 15:02 [PATCH v4] [media] vimc: Virtual Media Controller core, capture and sensor Helen Koike
2016-06-12  1:59 ` kbuild test robot
2016-06-12  2:11 ` kbuild test robot
2016-07-01 12:39 ` Hans Verkuil
2016-08-17 22:08   ` Helen Koike
2016-08-17 22:09   ` [PATCH v5] " Helen Koike
2016-08-22 10:57     ` Hans Verkuil
2016-09-04 20:02       ` [PATCH v6] " Helen Koike
2016-09-06  7:33         ` Hans Verkuil
2016-09-12 12:53           ` [PATCH] [media] MAINTAINERS: add vimc entry Helen Koike
2017-01-10 19:54         ` [PATCH v6] [media] vimc: Virtual Media Controller core, capture and sensor Laurent Pinchart
2017-01-11  1:30           ` Helen Koike
2017-03-10 13:08             ` Hans Verkuil
2017-03-10 13:42               ` Helen Koike
2017-03-25 17:11                 ` [PATCH v7] " Helen Koike
2017-03-25 23:04                   ` Helen Koike
2017-03-26 13:31                   ` Sakari Ailus
2017-03-27 15:19                     ` Helen Koike
2017-03-27 18:09                       ` Mauro Carvalho Chehab
2017-03-28 10:00                         ` Hans Verkuil
2017-03-28 11:38                           ` Mauro Carvalho Chehab
2017-03-28 20:37                             ` Sakari Ailus
2017-03-29  7:49                               ` Hans Verkuil
2017-03-29  8:46                                 ` Sakari Ailus
     [not found]                               ` <CAKQmDh9QoW7qnai=i68HBBbkLBa+Ni5K7WKeYDLONjYeyhHH0A@mail.gmail.com>
2017-03-29  8:02                                 ` Hans Verkuil
2017-03-28 14:23                           ` Sakari Ailus
2017-03-28 15:25                             ` Mauro Carvalho Chehab
2017-03-28 20:39                               ` Sakari Ailus
2017-03-29  7:39                             ` Hans Verkuil
2017-03-27  9:00                   ` Hans Verkuil
2017-03-27 13:33                     ` [PATCH v8] " Helen Koike
2017-04-03 22:16                       ` [PATCH v9] " Helen Koike
2017-04-06 14:29                         ` Helen Koike
2017-04-07  9:54                         ` Hans Verkuil
2017-04-07 17:55                           ` [PATCH v10] " Helen Koike
2017-01-25 13:03         ` [PATCH v6] " Sakari Ailus
2017-01-25 15:31           ` Mauro Carvalho Chehab
2017-03-24 22:11           ` Helen Koike
2017-03-26 13:25             ` Sakari Ailus
2016-09-04 20:05       ` [PATCH v5] " Helen Koike
2016-09-05  9:01         ` Hans Verkuil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=700a9e7b-0bb6-7923-6528-12d65c4f62b4@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=helen.fornazier@gmail.com \
    --cc=helen.koike@collabora.co.uk \
    --cc=helen.koike@collabora.com \
    --cc=jgebben@codeaurora.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.