22 Sep, 2016

1 commit

  • As warned by linuxdoc[1] tool, using:

    $ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

    include/media/v4l2-dev.h:118 :WARN: function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs: if_vid_dec_index if_vid_dec_pad_index
    include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs: if_aud_dec_index if_aud_dec_pad_index
    include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs: v4l2_m2m_num_src_bufs_ready v4l2_m2m_num_dst_bufs_ready
    drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs: cintlog2 intlog2
    include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs: s_radio v4l2_subdev_tuner_ops
    include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs: v4l2_set_subdevdata v4l2_set_subdev_hostdata
    include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs: v4l2_get_subdevdata v4l2_get_subdev_hostdata
    drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs: dvb_ringbuffer_writeuser dvb_ringbuffer_write_user
    include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs: vb2_ops vb2_buf_ops
    include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
    include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs: media_entity_enum_test media_entity_enum_test_and_set
    include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_pad
    include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_link
    include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_intf
    include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs: gobj_to_entity intf_to_devnode
    include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs: rc_open rc_close
    include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
    include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

    [1] https://return42.github.io/linuxdoc/linux.html

    The above are real issues at the documentation. On several cases,
    caused by cut-and-paste.

    Fix them.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

09 Sep, 2016

1 commit

  • There are several issues on the documentation:
    - the media.h header were not properly referenced;
    - verbatim expressions were not properly marked as such;
    - struct member references were wrong;
    - some notes were not using the right markup;
    - a comment that were moved to the kernel-doc markup were
    duplicated as a comment inside the struct media_entity;
    - some args were not pointing to the struct they're using;
    - macros weren't documented.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

25 Aug, 2016

3 commits


23 Jul, 2016

3 commits


18 Jul, 2016

1 commit

  • There were lots of issues at the media controller side,
    after the conversion:

    - Some documentation at the header files weren't using the
    kernel-doc start block;

    - Now, the C files with the exported symbols also need to be
    added. So, all headers need to be included twice: one to
    get the structs/enums/.. and another one for the functions;

    - Notes should use the ReST tag, as kernel-doc doesn't
    recognizes it anymore;

    - Identation needs to be fixed, as ReST uses it to identify
    when a format "tag" ends.

    - Fix the cross-references at the media controller description.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

21 Apr, 2016

1 commit


14 Apr, 2016

2 commits

  • All users of is_media_entity_v4l2_io() (the exynos4-is, omap3isp,
    davince_vpfe and omap4iss drivers and the v4l2-mc power management code)
    use the function to check whether entities are video_device instances,
    either to ensure they can cast the entity to a struct video_device, or
    to count the number of video nodes users.

    The purpose of the function is thus to identify whether the media entity
    instance is an instance of the video_device object, not to check whether
    it can perform I/O. Rename it accordingly, we will introduce a more
    specific is_media_entity_v4l2_io() check when needed.

    Signed-off-by: Laurent Pinchart
    Acked-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     
  • Code that processes media entities can require knowledge of the
    structure type that embeds a particular media entity instance in order
    to cast the entity to the proper object type. This needs is shown by the
    presence of the is_media_entity_v4l2_io and is_media_entity_v4l2_subdev
    functions.

    The implementation of those two functions relies on the entity function
    field, which is both a wrong and an inefficient design, without even
    mentioning the maintenance issue involved in updating the functions
    every time a new entity function is added. Fix this by adding add an
    obj_type field to the media entity structure to carry the information.

    Signed-off-by: Laurent Pinchart
    Acked-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

03 Mar, 2016

1 commit


27 Feb, 2016

1 commit


11 Jan, 2016

26 commits

  • Sometimes, it is desired to create 1:n and n:1 or even
    n:n links between different entities with the same
    function.

    This is actually needed to support DVB devices that
    have multiple frontends. While we could do a function
    like that internally at the DVB core, such function is
    generic enough to be at media-entity, and it could be
    useful on some other places.

    So, add such function.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • There are two ancillary functions that are missing comments.

    While those are used only internally at media-entity.c,
    document them, for completeness.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Instead of using one u32 counter per type for object IDs, use
    just one counter. With such change, it makes sense to simplify
    the debug logs too.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Several parameters added by the media_ent_enum patches
    were declared with wrong argument names:
    include/media/media-device.h:333: warning: No description found for parameter 'entity_internal_idx_max'
    include/media/media-device.h:354: warning: No description found for parameter 'ent_enum'
    include/media/media-device.h:354: warning: Excess function parameter 'e' description in 'media_entity_enum_init'
    include/media/media-device.h:333: warning: No description found for parameter 'entity_internal_idx_max'
    include/media/media-device.h:354: warning: No description found for parameter 'ent_enum'
    include/media/media-device.h:354: warning: Excess function parameter 'e' description in 'media_entity_enum_init'
    include/media/media-entity.h:397: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:397: warning: Excess function parameter 'e' description in 'media_entity_enum_zero'
    include/media/media-entity.h:409: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:409: warning: Excess function parameter 'e' description in 'media_entity_enum_set'
    include/media/media-entity.h:424: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:424: warning: Excess function parameter 'e' description in 'media_entity_enum_clear'
    include/media/media-entity.h:441: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:441: warning: Excess function parameter 'e' description in 'media_entity_enum_test'
    include/media/media-entity.h:458: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:458: warning: Excess function parameter 'e' description in 'media_entity_enum_test_and_set'
    include/media/media-entity.h:474: warning: No description found for parameter 'ent_enum'
    include/media/media-entity.h:474: warning: Excess function parameter 'e' description in 'media_entity_enum_empty'
    include/media/media-entity.h:474: warning: Excess function parameter 'entity' description in 'media_entity_enum_empty'
    include/media/media-entity.h:489: warning: No description found for parameter 'ent_enum1'
    include/media/media-entity.h:489: warning: No description found for parameter 'ent_enum2'
    include/media/media-entity.h:489: warning: Excess function parameter 'e' description in 'media_entity_enum_intersects'
    include/media/media-entity.h:489: warning: Excess function parameter 'f' description in 'media_entity_enum_intersects'

    Fix them.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This function was added recently, but weren't documented.
    Add documentation for it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Some exported functions were still documented at the .c file,
    instead of documenting at the .h one.

    Move the documentation to the right place, as we only use headers
    at media device-drivers.xml DocBook.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This isn't really a part of any interface drivers are expected to use. In
    order to keep drivers from using it, hide it in media-entity.c. This was
    always an arbitrary number and should be removed in the long run.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The bitmaps for entity enumerations used to be statically allocated. Now
    that the drivers have been converted to use the new interface which
    explicitly initialises the enum objects, drop the pre-allocated bitmaps.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • Initialise a given graph walk object once, and then keep using it whilst
    the same pipeline is running. Once the pipeline is stopped, release the
    graph walk object.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • This will also mean that the necessary graph related data structures will
    be allocated dynamically, removing the need for maximum ID checks.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • Add media_entity_graph_walk_init() and media_entity_graph_walk_cleanup()
    functions in order to dynamically allocate memory for the graph. This is
    not done in media_entity_graph_walk_start() as there are situations where
    e.g. correct error handling, that itself may not fail, requires successful
    graph walk.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The struct media_entity_graph was allocated in the stack, limiting the
    number of entities that could be reasonably allocated. Instead, move the
    struct to struct media_pipeline which is typically allocated using
    kmalloc() instead.

    The intent is to keep the enumeration around for later use for the
    duration of the streaming. As streaming is eventually stopped, an
    unfortunate memory allocation failure would prevent stopping the
    streaming. As no memory will need to be allocated, the problem is avoided
    altogether.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Mauro Carvalho Chehab
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • KernelDoc doesn't appear to handle anonymous structs defined inside
    another gracefully. As the struct is internal to the framework graph walk
    algorithm, detailed documentation isn't seen very important.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • It will be needed in struct media_pipeline shortly.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • This is useful in e.g. knowing whether certain operations have already
    been performed for an entity. The users include the framework itself (for
    graph walking) and a number of drivers.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The internal index can be used internally by the framework in order to keep
    track of entities for a purpose or another. The internal index is constant
    while it's registered to a media device, but the same index may be re-used
    once the entity having that index is unregistered.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • Add a basic documentation for most ancillary functions.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Several additional functions are described at media-entity.c.
    Moving them to the header file, to make the code cleaner and
    to have all such macros at the same place.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Those media_obj_* functions are actually creating/destroying
    media graph objects. So, rename them to better represent
    what they're actually doing.

    No functional changes.

    This was created via this small shell script:

    for i in $(git grep -l media_gobj_init); do sed s,media_gobj_init,media_gobj_create,g a && mv a $i; done
    for i in $(git grep -l media_gobj_remove); do sed s,media_gobj_remove,media_gobj_destroy,g a && mv a $i; done

    Suggested-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Now that we moved the content of the media-framework.txt into
    the kerneldoc documentation, move the per-function specific
    documentation to the corresponding functions and clean it up.

    It would be good if we had already the markdown kernel-doc
    patches merged upstream, but, while we doesn't have it,
    let's make it less ugly at device-drivers.xml.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This function was used in the past to free the links
    that were allocated by the media controller core.

    However, this is not needed anymore. We should likely
    get rid of the funcion on some function, but, for now,
    let's just convert into an inlined function and let the
    compiler to get rid of it.

    Suggested-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Both revision and group_id fields were never used and were always
    initialized to zero. Remove them.

    Suggested-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • With the MC next gen rework, what's left for media_entity_init()
    is to just initialize the PADs. However, certain devices, like
    a FLASH led/light doesn't have any input or output PAD.

    So, there's no reason why calling media_entity_init() would be
    mandatory. Also, despite its name, what this function actually
    does is to initialize the PADs data. So, rename it to
    media_entity_pads_init() in order to reflect that.

    The media entity actual init happens during entity register,
    at media_device_register_entity(). We should move init of
    num_links and num_backlinks to it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • We should not be creating device nodes at IRQ contexts. So,
    the only flags we'll be using will be GFP_KERNEL. Let's
    remove the gfp_flags, in order to make the interface simpler.

    If we ever need it, it would be easy to revert those changes.

    While here, remove an extra blank line.

    Suggested-by: Sakari Ailus
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Rename the userspace types from MEDIA_ENT_T_ to MEDIA_ENT_F_
    and add the backward compatibility bits.

    The changes at the .c files was generated by the following
    coccinelle script:

    @@
    @@
    -MEDIA_ENT_T_UNKNOWN
    +MEDIA_ENT_F_UNKNOWN
    @@
    @@
    -MEDIA_ENT_T_DVB_BASE
    +MEDIA_ENT_F_DVB_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_BASE
    +MEDIA_ENT_F_V4L2_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_BASE
    +MEDIA_ENT_F_V4L2_SUBDEV_BASE
    @@
    @@
    -MEDIA_ENT_T_CONNECTOR_BASE
    +MEDIA_ENT_F_CONNECTOR_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_VIDEO
    +MEDIA_ENT_F_IO_V4L
    @@
    @@
    -MEDIA_ENT_T_V4L2_VBI
    +MEDIA_ENT_F_IO_VBI
    @@
    @@
    -MEDIA_ENT_T_V4L2_SWRADIO
    +MEDIA_ENT_F_IO_SWRADIO
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN
    +MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
    @@
    @@
    -MEDIA_ENT_T_CONN_RF
    +MEDIA_ENT_F_CONN_RF
    @@
    @@
    -MEDIA_ENT_T_CONN_SVIDEO
    +MEDIA_ENT_F_CONN_SVIDEO
    @@
    @@
    -MEDIA_ENT_T_CONN_COMPOSITE
    +MEDIA_ENT_F_CONN_COMPOSITE
    @@
    @@
    -MEDIA_ENT_T_CONN_TEST
    +MEDIA_ENT_F_CONN_TEST
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
    +MEDIA_ENT_F_CAM_SENSOR
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_FLASH
    +MEDIA_ENT_F_FLASH
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_LENS
    +MEDIA_ENT_F_LENS
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_DECODER
    +MEDIA_ENT_F_ATV_DECODER
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_TUNER
    +MEDIA_ENT_F_TUNER
    @@
    @@
    -MEDIA_ENT_T_DVB_DEMOD
    +MEDIA_ENT_F_DTV_DEMOD
    @@
    @@
    -MEDIA_ENT_T_DVB_DEMUX
    +MEDIA_ENT_F_TS_DEMUX
    @@
    @@
    -MEDIA_ENT_T_DVB_TSOUT
    +MEDIA_ENT_F_IO_DTV
    @@
    @@
    -MEDIA_ENT_T_DVB_CA
    +MEDIA_ENT_F_DTV_CA
    @@
    @@
    -MEDIA_ENT_T_DVB_NET_DECAP
    +MEDIA_ENT_F_DTV_NET_DECAP

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Entities should have one or more functions. Calling it as a
    type proofed to not be correct, as an entity could eventually
    have more than one type.

    So, rename the field as function.

    Please notice that this patch doesn't extend support for
    multiple function entities. Such change will happen when
    we have real case drivers using it.

    No functional changes.

    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab