Commit 2521fdac authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media_device: add a topology version field

Every time a graph object is added or removed, the version
of the topology changes. That's a requirement for the new
MEDIA_IOC_G_TOPOLOGY, in order to allow userspace to know
that the topology has changed after a previous call to it.
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9155d859
...@@ -173,6 +173,9 @@ void media_gobj_init(struct media_device *mdev, ...@@ -173,6 +173,9 @@ void media_gobj_init(struct media_device *mdev,
list_add_tail(&gobj->list, &mdev->interfaces); list_add_tail(&gobj->list, &mdev->interfaces);
break; break;
} }
mdev->topology_version++;
dev_dbg_obj(__func__, gobj); dev_dbg_obj(__func__, gobj);
} }
...@@ -187,6 +190,8 @@ void media_gobj_remove(struct media_gobj *gobj) ...@@ -187,6 +190,8 @@ void media_gobj_remove(struct media_gobj *gobj)
{ {
dev_dbg_obj(__func__, gobj); dev_dbg_obj(__func__, gobj);
gobj->mdev->topology_version++;
/* Remove the object from mdev list */ /* Remove the object from mdev list */
list_del(&gobj->list); list_del(&gobj->list);
} }
......
...@@ -41,6 +41,8 @@ struct device; ...@@ -41,6 +41,8 @@ struct device;
* @bus_info: Unique and stable device location identifier * @bus_info: Unique and stable device location identifier
* @hw_revision: Hardware device revision * @hw_revision: Hardware device revision
* @driver_version: Device driver version * @driver_version: Device driver version
* @topology_version: Monotonic counter for storing the version of the graph
* topology. Should be incremented each time the topology changes.
* @entity_id: Unique ID used on the last entity registered * @entity_id: Unique ID used on the last entity registered
* @pad_id: Unique ID used on the last pad registered * @pad_id: Unique ID used on the last pad registered
* @link_id: Unique ID used on the last link registered * @link_id: Unique ID used on the last link registered
...@@ -74,6 +76,8 @@ struct media_device { ...@@ -74,6 +76,8 @@ struct media_device {
u32 hw_revision; u32 hw_revision;
u32 driver_version; u32 driver_version;
u32 topology_version;
u32 entity_id; u32 entity_id;
u32 pad_id; u32 pad_id;
u32 link_id; u32 link_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment