linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v8 38/55] [media] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs
Date: Tue, 8 Dec 2015 15:38:49 -0200	[thread overview]
Message-ID: <20151208153849.1d6c8ae4@recife.lan> (raw)
In-Reply-To: <5694046.QaGrXTB1hd@avalon>

Em Sun, 06 Dec 2015 03:37:59 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> escreveu:

> Hi Mauro,
> 
> Thank you for the patch.
> 
> In addition to my reply to Sakari's e-mail, please see below for a few small 
> comments.
> 
> On Sunday 06 September 2015 09:02:58 Mauro Carvalho Chehab wrote:
> > Instead of abusing MEDIA_ENT_T_V4L2_SUBDEV, initialize
> > new subdev entities as MEDIA_ENT_T_UNKNOWN.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
> > 
> > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > index 659507bce63f..134fe7510195 100644
> > --- a/drivers/media/media-device.c
> > +++ b/drivers/media/media-device.c
> > @@ -435,6 +435,12 @@ int __must_check media_device_register_entity(struct
> > media_device *mdev, {
> >  	int i;
> > 
> > +	if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN ||
> > +	    entity->type == MEDIA_ENT_T_UNKNOWN)
> > +		dev_warn(mdev->dev,
> > +			 "Entity type for entity %s was not initialized!\n",
> > +			 entity->name);
> > +
> >  	/* Warn if we apparently re-register an entity */
> >  	WARN_ON(entity->graph_obj.mdev != NULL);
> >  	entity->graph_obj.mdev = mdev;
> > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c
> > b/drivers/media/v4l2-core/v4l2-subdev.c index 60da43772de9..b3bcc8253182
> > 100644
> > --- a/drivers/media/v4l2-core/v4l2-subdev.c
> > +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> > @@ -584,7 +584,7 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const
> > struct v4l2_subdev_ops *ops) sd->host_priv = NULL;
> >  #if defined(CONFIG_MEDIA_CONTROLLER)
> >  	sd->entity.name = sd->name;
> > -	sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
> > +	sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
> >  #endif
> >  }
> >  EXPORT_SYMBOL(v4l2_subdev_init);
> > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> > index f8725b881a1d..3d6210095336 100644
> > --- a/include/uapi/linux/media.h
> > +++ b/include/uapi/linux/media.h
> > @@ -42,6 +42,14 @@ struct media_device_info {
> > 
> >  #define MEDIA_ENT_ID_FLAG_NEXT		(1 << 31)
> > 
> > +/* Used values for media_entity_desc::type */
> > +
> 
> You remove this a couple of patches later, is it worth adding it in the first 
> place ?

If you had come with that earlier, I would happily have it removed ;)
Right now, I really want to avoid changes on the patches. Handling a
83 patch series, with two ~20 patch series depending on it (Shuah's
ALSA patches and Sakari's internal entity numbering series) is not
fun.

So, as this is already removed on some other patch, I'll let this
hunk as-is.

> 
> > +/*
> > + * Initial value to be used when a new entity is created
> > + * Drivers should change it to something useful
> 
> As you warn when the value isn't change I'd say "Drivers must change...".

I'll fix this on a later patch.

> > + */
> > +#define MEDIA_ENT_T_UNKNOWN	0x00000000
> > +
> >  /*
> >   * Base numbers for entity types
> >   *
> > @@ -75,6 +83,15 @@ struct media_device_info {
> >  #define MEDIA_ENT_T_V4L2_SWRADIO	(MEDIA_ENT_T_V4L2_BASE + 6)
> > 
> >  /* V4L2 Sub-device entities */
> > +
> > +	/*
> > +	 * Subdevs are initialized with MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN,
> > +	 * in order to preserve backward compatibility.
> > +	 * Drivers should change to the proper subdev type before
> > +	 * registering the entity.
> > +	 */
> 
> Leading tabs look weird here.

Ok, I'll remove the ident here. This hunk had to be conflict solved
anyway, as we merged the MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN addition
earlier. I'll do this specific change here, and hope to not cause
context conflicts later - it will likely cause - as we renamed from
ENT_T_foo to ENT_F_foo :( Let's hope git is smart enough here...

> 
> > +#define MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN	MEDIA_ENT_T_V4L2_SUBDEV_BASE
> > +
> >  #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR	(MEDIA_ENT_T_V4L2_SUBDEV_BASE + 1)
> >  #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH	(MEDIA_ENT_T_V4L2_SUBDEV_BASE + 2)
> >  #define MEDIA_ENT_T_V4L2_SUBDEV_LENS	(MEDIA_ENT_T_V4L2_SUBDEV_BASE + 3)
> 

  reply	other threads:[~2015-12-08 17:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30  3:06 [PATCH v8 00/55] MC next generation patches Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 13/55] [media] uapi/media.h: Declare interface types for V4L2 and DVB Mauro Carvalho Chehab
     [not found]   ` <4bf60081a6756f559407052aa92e343456697a08.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-09-10 14:19     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 15/55] [media] uapi/media.h: Declare interface types for ALSA Mauro Carvalho Chehab
     [not found]   ` <ec40936d7349f390dd8b73b90fa0e0708de596a9.1441540862.git.mchehab@osg.samsung.com>
     [not found]     ` <cd69226f7f42baafbc4a3db5f8a8c387fba879dd.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
     [not found]       ` <ec40936d7349f390dd8b73b90fa0e0708de596a9.1441540862.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-09-06 12:02         ` Mauro Carvalho Chehab
2015-09-10 14:23           ` Javier Martinez Canillas
2015-09-06 12:02         ` [PATCH v8 28/55] [media] uapi/media.h: Fix entity namespace Mauro Carvalho Chehab
     [not found]           ` <9b372bed2898c86f41c6fe7b7e4e13670701feaf.1441540862.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-09-11 13:06             ` Hans Verkuil
2015-09-06 12:02         ` [PATCH v8 39/55] [media] media controller: get rid of entity subtype on Kernel Mauro Carvalho Chehab
     [not found]           ` <728826957177ee11793b6b28b4e61e94b2d3068c.1441540862.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-09-11 13:08             ` Hans Verkuil
2015-12-06  1:03             ` Laurent Pinchart
2015-09-06 12:03         ` [PATCH v8 40/55] [media] media.h: don't use legacy entity macros at Kernel Mauro Carvalho Chehab
     [not found]           ` <3f2e554613f0b1286bd72dfd08f02ac6b874c95e.1441540862.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-12-06  1:02             ` Laurent Pinchart
2015-09-06 12:03         ` [PATCH v8 44/55] [media] uapi/media.h: Add MEDIA_IOC_G_TOPOLOGY ioctl Mauro Carvalho Chehab
     [not found]           ` <297afcfe4c9c5ebc074f92d1badd34b94e8b28f9.1441540862.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-09-11 13:58             ` Hans Verkuil
2015-12-06  0:47             ` Laurent Pinchart
2015-12-08 19:23               ` Mauro Carvalho Chehab
     [not found]                 ` <20151208172340.43a76779-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org>
2015-12-08 19:48                   ` Arnd Bergmann
2015-08-30  3:06 ` [PATCH v8 28/55] [media] uapi/media.h: Fix entity namespace Mauro Carvalho Chehab
2015-08-31 11:17   ` Hans Verkuil
2015-08-31 12:12     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 38/55] [media] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs Mauro Carvalho Chehab
     [not found]   ` <662a3bb2bfb02f820f4dafa0033af2cf16d273c5.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-08-31 11:43     ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-12-06  1:37     ` Laurent Pinchart
2015-12-08 17:38       ` Mauro Carvalho Chehab [this message]
2015-08-30  3:06 ` [PATCH v8 39/55] [media] media controller: get rid of entity subtype on Kernel Mauro Carvalho Chehab
     [not found]   ` <8154aa42b993840dfde2d794e7e9e1f0c57c1e82.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-08-31 11:44     ` Hans Verkuil
     [not found] ` <cover.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-08-30  3:06   ` [PATCH v8 40/55] [media] media.h: don't use legacy entity macros at Kernel Mauro Carvalho Chehab
     [not found]     ` <720b750e2738f8c70535b01c9c3a3dddf044db69.1440902901.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-08-31 11:44       ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 44/55] [media] uapi/media.h: Add MEDIA_IOC_G_TOPOLOGY ioctl Mauro Carvalho Chehab
2015-08-31 12:00   ` Hans Verkuil
     [not found]     ` <55E441EA.4020206-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2015-08-31 13:35       ` Mauro Carvalho Chehab
2015-08-30 14:27 ` [PATCH v8 00/55] MC next generation patches Mauro Carvalho Chehab

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=20151208153849.1d6c8ae4@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=elfring@users.sourceforge.net \
    --cc=hans.verkuil@cisco.com \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=s.nawrocki@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).