diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-08-30 14:53:57 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 15:18:58 +0100 |
commit | 39d1ebc6092f8266fb788733ca92b8492b1d69f2 (patch) | |
tree | 4cb4531fc744893e515cf693659ab0f353f1bacc | |
parent | [media] au0828: Create connector links (diff) | |
download | linux-39d1ebc6092f8266fb788733ca92b8492b1d69f2.tar.xz linux-39d1ebc6092f8266fb788733ca92b8492b1d69f2.zip |
[media] media-device: supress backlinks at G_TOPOLOGY ioctl
Due to the graph traversal algorithm currently in usage, we
need a copy of all data links. Those backlinks should not be
send to userspace, as otherwise, all links there will be
duplicated.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/media-device.c | 3 | ||||
-rw-r--r-- | drivers/media/media-entity.c | 1 | ||||
-rw-r--r-- | include/media/media-entity.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index c7d97190a67e..30cef8740afa 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -333,6 +333,9 @@ static long __media_device_get_topology(struct media_device *mdev, /* Get links and number of links */ i = 0; media_device_for_each_link(link, mdev) { + if (link->is_backlink) + continue; + i++; if (ret || !topo->links) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index d9d42fab22ad..246d7e65aded 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -625,6 +625,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, backlink->source = &source->pads[source_pad]; backlink->sink = &sink->pads[sink_pad]; backlink->flags = flags; + backlink->is_backlink = true; /* Initialize graph object embedded at the new link */ media_gobj_init(sink->graph_obj.mdev, MEDIA_GRAPH_LINK, diff --git a/include/media/media-entity.h b/include/media/media-entity.h index fd19aecdcbb6..3b591d72c703 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -96,6 +96,7 @@ struct media_pipeline { * @reverse: Pointer to the link for the reverse direction of a pad to pad * link. * @flags: Link flags, as defined in uapi/media.h (MEDIA_LNK_FL_*) + * @is_backlink: Indicate if the link is a backlink. */ struct media_link { struct media_gobj graph_obj; @@ -112,6 +113,7 @@ struct media_link { }; struct media_link *reverse; unsigned long flags; + bool is_backlink; }; /** |