diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-08-14 17:54:36 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 15:18:42 +0100 |
commit | 6b6a42780597028135f82c96e42c6d2bcd83fbae (patch) | |
tree | 36121532964b98be43ad2afe041d1cd0a54a63eb /drivers/media/media-entity.c | |
parent | [media] media: use media_gobj inside pads (diff) | |
download | linux-6b6a42780597028135f82c96e42c6d2bcd83fbae.tar.xz linux-6b6a42780597028135f82c96e42c6d2bcd83fbae.zip |
[media] media: use media_gobj inside links
Just like entities and pads, links also need to have unique
Object IDs along a given media controller.
So, let's add a media_gobj inside it and initialize
the object then a new link is created.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r-- | drivers/media/media-entity.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 2d94c859057b..63fd293a3fb8 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -51,6 +51,9 @@ void media_gobj_init(struct media_device *mdev, case MEDIA_GRAPH_PAD: gobj->id = media_gobj_gen_id(type, ++mdev->pad_id); break; + case MEDIA_GRAPH_LINK: + gobj->id = media_gobj_gen_id(type, ++mdev->link_id); + break; } } @@ -491,6 +494,9 @@ media_entity_create_link(struct media_entity *source, u16 source_pad, link->sink = &sink->pads[sink_pad]; link->flags = flags; + /* Initialize graph object embedded at the new link */ + media_gobj_init(source->parent, MEDIA_GRAPH_LINK, &link->graph_obj); + /* Create the backlink. Backlinks are used to help graph traversal and * are not reported to userspace. */ @@ -504,6 +510,9 @@ media_entity_create_link(struct media_entity *source, u16 source_pad, backlink->sink = &sink->pads[sink_pad]; backlink->flags = flags; + /* Initialize graph object embedded at the new link */ + media_gobj_init(sink->parent, MEDIA_GRAPH_LINK, &backlink->graph_obj); + link->reverse = backlink; backlink->reverse = link; |