From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: hverkuil-cisco@xs4all.nl
Cc: linux-media@vger.kernel.org, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv5 PATCH 4/4] vimc: add property test code
Date: Thu, 13 Dec 2018 15:31:32 -0200 [thread overview]
Message-ID: <20181213153132.42ccd4e5@coco.lan> (raw)
In-Reply-To: <20181213134113.15247-5-hverkuil-cisco@xs4all.nl>
Em Thu, 13 Dec 2018 14:41:13 +0100
hverkuil-cisco@xs4all.nl escreveu:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> Add properties to entities and pads to be able to test the
> properties API.
Looks OK to me.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/platform/vimc/vimc-common.c | 50 +++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c
> index 867e24dbd6b5..e3d5d4b3b44d 100644
> --- a/drivers/media/platform/vimc/vimc-common.c
> +++ b/drivers/media/platform/vimc/vimc-common.c
> @@ -417,6 +417,7 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
> const unsigned long *pads_flag,
> const struct v4l2_subdev_ops *sd_ops)
> {
> + struct media_prop *prop = NULL;
> int ret;
>
> /* Allocate the pads */
> @@ -454,6 +455,55 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
> goto err_clean_m_ent;
> }
>
> + ret = media_entity_add_prop_u64(&sd->entity, "u64", ~1);
> + if (!ret)
> + ret = media_entity_add_prop_s64(&sd->entity, "s64", -5);
> + if (!ret)
> + ret = media_entity_add_prop_string(&sd->entity, "string",
> + sd->name);
> + if (!ret) {
> + prop = media_entity_add_prop_group(&sd->entity, "empty-group");
> + ret = PTR_ERR_OR_ZERO(prop);
> + }
> + if (!ret) {
> + prop = media_entity_add_prop_group(&sd->entity, "group");
> + ret = PTR_ERR_OR_ZERO(prop);
> + }
> + if (!ret)
> + ret = media_prop_add_prop_u64(prop, "u64", 42);
> + if (!ret)
> + ret = media_prop_add_prop_s64(prop, "s64", -42);
> + if (!ret)
> + ret = media_prop_add_prop_string(prop, "string", "42");
> + if (!ret)
> + ret = media_pad_add_prop_u64(&sd->entity.pads[num_pads - 1],
> + "u64", ~1);
> + if (!ret)
> + ret = media_pad_add_prop_s64(&sd->entity.pads[num_pads - 1],
> + "s64", -5);
> + if (!ret) {
> + prop = media_pad_add_prop_group(&sd->entity.pads[num_pads - 1],
> + "group");
> + ret = PTR_ERR_OR_ZERO(prop);
> + }
> + if (!ret)
> + ret = media_prop_add_prop_u64(prop, "u64", 24);
> + if (!ret)
> + ret = media_prop_add_prop_s64(prop, "s64", -24);
> + if (!ret)
> + ret = media_pad_add_prop_string(&sd->entity.pads[0],
> + "string", sd->name);
> + if (!ret)
> + ret = media_prop_add_prop_string(prop, "string", "24");
> + if (!ret) {
> + prop = media_prop_add_prop_group(prop, "subgroup");
> + ret = PTR_ERR_OR_ZERO(prop);
> + }
> + if (!ret)
> + ret = media_prop_add_prop_string(prop, "string", "substring");
> + if (ret)
> + goto err_clean_m_ent;
> +
> return 0;
>
> err_clean_m_ent:
Thanks,
Mauro
prev parent reply other threads:[~2018-12-13 17:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 13:41 [RFCv5 PATCH 0/4] Add properties support to the media controller hverkuil-cisco
2018-12-13 13:41 ` [RFCv5 PATCH 1/4] uapi/linux/media.h: add property support hverkuil-cisco
2018-12-13 16:41 ` Mauro Carvalho Chehab
2018-12-13 17:13 ` Hans Verkuil
2018-12-13 17:54 ` Mauro Carvalho Chehab
2018-12-13 17:17 ` Mauro Carvalho Chehab
2018-12-13 13:41 ` [RFCv5 PATCH 2/4] media controller: add properties support hverkuil-cisco
2018-12-13 17:14 ` Mauro Carvalho Chehab
2018-12-13 17:35 ` Hans Verkuil
2018-12-13 18:01 ` Mauro Carvalho Chehab
2018-12-13 13:41 ` [RFCv5 PATCH 3/4] media: add functions to add properties to objects hverkuil-cisco
2018-12-13 17:30 ` Mauro Carvalho Chehab
2018-12-13 13:41 ` [RFCv5 PATCH 4/4] vimc: add property test code hverkuil-cisco
2018-12-13 17:31 ` Mauro Carvalho Chehab [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=20181213153132.42ccd4e5@coco.lan \
--to=mchehab+samsung@kernel.org \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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.