1. 22 Mar, 2011 5 commits
    • Laurent Pinchart's avatar
      [media] media: Entity use count · 503c3d82
      Laurent Pinchart authored
      Due to the wide differences between drivers regarding power management
      needs, the media controller does not implement power management.
      However, the media_entity structure includes a use_count field that
      media drivers can use to track the number of users of every entity for
      power management needs.
      
      The use_count field is owned by media drivers and must not be touched by
      entity drivers. Access to the field must be protected by the media
      device graph_mutex lock.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      503c3d82
    • Sakari Ailus's avatar
      [media] media: Entity graph traversal · a5ccc48a
      Sakari Ailus authored
      Add media entity graph traversal. The traversal follows enabled links by
      depth first. Traversing graph backwards is prevented by comparing the next
      possible entity in the graph with the previous one. Multiply connected
      graphs are thus not supported.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarVimarsh Zutshi <vimarsh.zutshi@gmail.com>
      Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      a5ccc48a
    • Laurent Pinchart's avatar
      [media] media: Entities, pads and links · 53e269c1
      Laurent Pinchart authored
      As video hardware pipelines become increasingly complex and
      configurable, the current hardware description through v4l2 subdevices
      reaches its limits. In addition to enumerating and configuring
      subdevices, video camera drivers need a way to discover and modify at
      runtime how those subdevices are connected. This is done through new
      elements called entities, pads and links.
      
      An entity is a basic media hardware building block. It can correspond to
      a large variety of logical blocks such as physical hardware devices
      (CMOS sensor for instance), logical hardware devices (a building block
      in a System-on-Chip image processing pipeline), DMA channels or physical
      connectors.
      
      A pad is a connection endpoint through which an entity can interact with
      other entities. Data (not restricted to video) produced by an entity
      flows from the entity's output to one or more entity inputs. Pads should
      not be confused with physical pins at chip boundaries.
      
      A link is a point-to-point oriented connection between two pads, either
      on the same entity or on different entities. Data flows from a source
      pad to a sink pad.
      
      Links are stored in the source entity. To make backwards graph walk
      faster, a copy of all links is also stored in the sink entity. The copy
      is known as a backlink and is only used to help graph traversal.
      
      The entity API is made of three functions:
      
      - media_entity_init() initializes an entity. The caller must provide an
      array of pads as well as an estimated number of links. The links array
      is allocated dynamically and will be reallocated if it grows beyond the
      initial estimate.
      
      - media_entity_cleanup() frees resources allocated for an entity. It
      must be called during the cleanup phase after unregistering the entity
      and before freeing it.
      
      - media_entity_create_link() creates a link between two entities. An
      entry in the link array of each entity is allocated and stores pointers
      to source and sink pads.
      
      When a media device is unregistered, all its entities are unregistered
      automatically.
      
      The code is based on Hans Verkuil <hverkuil@xs4all.nl> initial work.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
      Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      53e269c1
    • Laurent Pinchart's avatar
      [media] media: Media device · 176fb0d1
      Laurent Pinchart authored
      The media_device structure abstracts functions common to all kind of
      media devices (v4l2, dvb, alsa, ...). It manages media entities and
      offers a userspace API to discover and configure the media device
      internal topology.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      176fb0d1
    • Laurent Pinchart's avatar
      [media] media: Media device node support · cf4b9211
      Laurent Pinchart authored
      The media_devnode structure provides support for registering and
      unregistering character devices using a dynamic major number. Reference
      counting is handled internally, making device drivers easier to write
      without having to solve the open/disconnect race condition issue over
      and over again.
      
      The code is based on video/v4l2-dev.c.
      
      [mchehab@redhat.com: Remove linux/smp_lock.h include to not break compilation on bisect]
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      cf4b9211
  2. 21 Mar, 2011 35 commits