linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH RFC v3 02/16] media: Add a common embeed struct for all media graph objects
Date: Fri, 14 Aug 2015 10:21:55 -0300	[thread overview]
Message-ID: <20150814102155.0db89afd@recife.lan> (raw)
In-Reply-To: <20150814130833.GD19840@valkosipuli.retiisi.org.uk>

Em Fri, 14 Aug 2015 16:08:34 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> Thank you for the patchset!
> 
> On Wed, Aug 12, 2015 at 05:14:46PM -0300, Mauro Carvalho Chehab wrote:
> > Due to the MC API proposed changes, we'll need to:
> > 	- have an unique object ID for all graph objects;
> > 	- be able to dynamically create/remove objects;
> > 	- be able to group objects;
> > 	- keep the object in memory until we stop use it.
> > 
> > Due to that, create a struct media_graph_obj and put there the
> > common elements that all media objects will have in common.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > 
> > diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> > index 0c003d817493..051aa3f8bbfe 100644
> > --- a/include/media/media-entity.h
> > +++ b/include/media/media-entity.h
> > @@ -28,10 +28,50 @@
> >  #include <linux/list.h>
> >  #include <linux/media.h>
> >  
> > +/* Enums used internally at the media controller to represent graphs */
> > +
> > +/**
> > + * enum media_graph_type - type of a graph element
> > + *
> > + * @MEDIA_GRAPH_ENTITY:		Identify a media entity
> > + * @MEDIA_GRAPH_PAD:		Identify a media PAD
> > + * @MEDIA_GRAPH_LINK:		Identify a media link
> > + */
> > +enum media_graph_type {
> > +	MEDIA_GRAPH_ENTITY,
> > +	MEDIA_GRAPH_PAD,
> > +	MEDIA_GRAPH_LINK,
> > +};
> > +
> > +
> > +/* Structs to represent the objects that belong to a media graph */
> > +
> > +/**
> > + * struct media_graph_obj - Define a graph object.
> > + *
> > + * @list:		List of media graph objects
> > + * @obj_id:		Non-zero object ID identifier. The ID should be unique
> > + *			inside a media_device
> > + * @type:		Type of the graph object
> > + * @mdev:		Media device that contains the object
> > + *			object before stopping using it
> > + *
> > + * All elements on the media graph should have this struct embedded
> > + */
> > +struct media_graph_obj {
> > +	struct list_head	list;
> > +	struct list_head	group;
> 
> What's group for?

I'm actually thinking on replacing group_id by a group list object type.

Anyway, I'm simplifying this patch series. So, I'll drop this field
for now. We can add it when needed.

> 
> > +	u32			obj_id;
> 
> I'd just call this "id".

OK.

> 
> > +	enum media_graph_type	type;
> > +	struct media_device	*mdev;
> > +};
> > +
> > +
> >  struct media_pipeline {
> >  };
> >  
> >  struct media_link {
> > +	struct media_graph_obj			graph_obj;
> >  	struct media_pad *source;	/* Source pad */
> >  	struct media_pad *sink;		/* Sink pad  */
> >  	struct media_link *reverse;	/* Link in the reverse direction */
> > @@ -39,6 +79,7 @@ struct media_link {
> >  };
> >  
> >  struct media_pad {
> > +	struct media_graph_obj			graph_obj;
> >  	struct media_entity *entity;	/* Entity this pad belongs to */
> >  	u16 index;			/* Pad index in the entity pads array */
> >  	unsigned long flags;		/* Pad flags (MEDIA_PAD_FL_*) */
> > @@ -61,6 +102,7 @@ struct media_entity_operations {
> >  };
> >  
> >  struct media_entity {
> > +	struct media_graph_obj			graph_obj;
> >  	struct list_head list;
> >  	struct media_device *parent;	/* Media device this entity belongs to*/
> >  	u32 id;				/* Entity ID, unique in the parent media
> 
> Will entity id be different from the media_graph_obj obj_id of the object?

No. I'm right now writing a patch removing entity->id.

Regards,
Mauro

  reply	other threads:[~2015-08-14 13:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12 20:14 [PATCH RFC v3 00/16] Changes on MC core due to MC workshop discussion Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 01/16] media: Add some fields to store graph objects Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 02/16] media: Add a common embeed struct for all media " Mauro Carvalho Chehab
2015-08-14 13:08   ` Sakari Ailus
2015-08-14 13:21     ` Mauro Carvalho Chehab [this message]
2015-08-14 13:28       ` Hans Verkuil
2015-08-12 20:14 ` [PATCH RFC v3 03/16] media: add functions to inialize media_graph_obj Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 04/16] media: ensure that entities will have an object ID Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 05/16] media: initialize PAD objects Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 06/16] media: initialize the graph object inside the media links Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 07/16] media: get rid of unused "extra_links" param on media_entity_init() Mauro Carvalho Chehab
2015-08-14 10:33   ` Sakari Ailus
2015-08-14 11:07     ` Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 08/16] media: convert links from array to list Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 09/16] media: use media_graph_obj for link endpoints Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 10/16] media: rename link source/sink to pad0_source/pad1_sink Mauro Carvalho Chehab
2015-08-13  7:58   ` Hans Verkuil
2015-08-12 20:14 ` [PATCH RFC v3 11/16] media: rename the function that create pad links Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 12/16] media: move __media_entity_remove_link to avoid prototype Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 13/16] media: make the internal function to create links more generic Mauro Carvalho Chehab
2015-08-12 20:14 ` [PATCH RFC v3 14/16] media: add a generic function to remove a link Mauro Carvalho Chehab
2015-08-12 20:45   ` Shuah Khan
2015-08-12 20:52     ` Mauro Carvalho Chehab
2015-08-12 21:07       ` Shuah Khan
2015-08-12 20:14 ` [PATCH RFC v3 15/16] media: rename media_entity_remove_foo functions Mauro Carvalho Chehab
2015-08-12 20:15 ` [PATCH RFC v3 16/16] media: add functions to allow creating interfaces 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=20150814102155.0db89afd@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=sakari.ailus@iki.fi \
    /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).