aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-14 11:47:48 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 09:18:41 -0500
commitbfab2aacccfc144e2cceccb71ec89f1eff1b8c51 (patch)
tree815cf4b3e15e59b00710a75348184debc3619d08 /include/media
parentec6e4c950621a1d0db1e9b015ede4a3938fdfd18 (diff)
[media] media: use media_gobj inside entities
As entities are graph objects, let's embed media_gobj on it. That ensures an unique ID for entities that can be global along the entire media controller. For now, we'll keep the already existing entity ID. Such field need to be dropped at some point, but for now, let's not do this, to avoid needing to review all drivers and the userspace apps. 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 'include/media')
-rw-r--r--include/media/media-device.h3
-rw-r--r--include/media/media-entity.h9
2 files changed, 6 insertions, 6 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index a44f18fdf321..f6deef6e5820 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -41,7 +41,7 @@ struct device;
41 * @bus_info: Unique and stable device location identifier 41 * @bus_info: Unique and stable device location identifier
42 * @hw_revision: Hardware device revision 42 * @hw_revision: Hardware device revision
43 * @driver_version: Device driver version 43 * @driver_version: Device driver version
44 * @entity_id: ID of the next entity to be registered 44 * @entity_id: Unique ID used on the last entity registered
45 * @entities: List of registered entities 45 * @entities: List of registered entities
46 * @lock: Entities list lock 46 * @lock: Entities list lock
47 * @graph_mutex: Entities graph operation lock 47 * @graph_mutex: Entities graph operation lock
@@ -69,6 +69,7 @@ struct media_device {
69 u32 driver_version; 69 u32 driver_version;
70 70
71 u32 entity_id; 71 u32 entity_id;
72
72 struct list_head entities; 73 struct list_head entities;
73 74
74 /* Protects the entities list */ 75 /* Protects the entities list */
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 96626356b8f3..4faa4d830da4 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -33,10 +33,10 @@
33/** 33/**
34 * enum media_gobj_type - type of a graph object 34 * enum media_gobj_type - type of a graph object
35 * 35 *
36 * @MEDIA_GRAPH_ENTITY: Identify a media entity
36 */ 37 */
37enum media_gobj_type { 38enum media_gobj_type {
38 /* FIXME: add the types here, as we embed media_gobj */ 39 MEDIA_GRAPH_ENTITY,
39 MEDIA_GRAPH_NONE
40}; 40};
41 41
42#define MEDIA_BITS_PER_TYPE 8 42#define MEDIA_BITS_PER_TYPE 8
@@ -94,10 +94,9 @@ struct media_entity_operations {
94}; 94};
95 95
96struct media_entity { 96struct media_entity {
97 struct media_gobj graph_obj;
97 struct list_head list; 98 struct list_head list;
98 struct media_device *parent; /* Media device this entity belongs to*/ 99 struct media_device *parent; /* Media device this entity belongs to*/
99 u32 id; /* Entity ID, unique in the parent media
100 * device context */
101 const char *name; /* Entity name */ 100 const char *name; /* Entity name */
102 u32 type; /* Entity type (MEDIA_ENT_T_*) */ 101 u32 type; /* Entity type (MEDIA_ENT_T_*) */
103 u32 revision; /* Entity revision, driver specific */ 102 u32 revision; /* Entity revision, driver specific */
@@ -148,7 +147,7 @@ static inline u32 media_entity_subtype(struct media_entity *entity)
148 147
149static inline u32 media_entity_id(struct media_entity *entity) 148static inline u32 media_entity_id(struct media_entity *entity)
150{ 149{
151 return entity->id; 150 return entity->graph_obj.id;
152} 151}
153 152
154static inline enum media_gobj_type media_type(struct media_gobj *gobj) 153static inline enum media_gobj_type media_type(struct media_gobj *gobj)