1. 28 7月, 2011 4 次提交
    • H
      [media] v4l2-ctrls: fix and improve volatile control handling · ddac5c10
      Hans Verkuil 提交于
      If you have a cluster of controls that is a mix of volatile and non-volatile
      controls, then requesting the value of the volatile control would fail if the
      master control of that cluster was non-volatile. The code assumed that the
      volatile state of the master control was the same for all other controls in
      the cluster.
      
      This is now fixed.
      
      In addition, it was clear from bugs in some drivers that it was confusing that
      the ctrl->cur union had to be used in g_volatile_ctrl. Several drivers used the
      'new' values instead. The framework was changed so that drivers now set the new
      value instead of the current value.
      
      This has an additional benefit as well: the volatile values are now only stored
      in the 'new' value, leaving the current value alone. This is useful for
      autofoo/foo control clusters where you want to have a 'foo' control act like a
      volatile control if 'autofoo' is on, but as a normal control when it is off.
      
      Since with this change the cur value is no longer overwritten when g_volatile_ctrl
      is called, you can use it to remember the original 'foo' value. For example:
      
      autofoo = 0, foo = 10 and foo is non-volatile.
      
      Now autofoo is set to 1 and foo is marked volatile. Retrieving the foo value
      will get the volatile value. Set autofoo back to 0, which marks foo as non-
      volatile again, and retrieving foo will get the old current value of 10.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ddac5c10
    • H
      [media] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag · 7ebbc39f
      Hans Verkuil 提交于
      When applications try to set READ_ONLY controls an error should
      be returned. However, when drivers do that it should be accepted.
      
      Those controls could reflect some driver status which the application
      can't change but the driver obviously has to be able to change it.
      
      This is needed among others for future HDMI status controls.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      7ebbc39f
    • H
      [media] v4l2-ctrls: simplify error_idx handling · 37cd3b73
      Hans Verkuil 提交于
      The lower-level prepare functions just set error_idx for each control that
      might have an error. The high-level functions will override this with
      cs->count in the get and set cases. Only try will keep the error_idx.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      37cd3b73
    • H
      [media] v4l2-ctrls: introduce call_op define · 54c911eb
      Hans Verkuil 提交于
      Add the call_op define to safely call the control ops. This also allows
      for controls without any ops such as the 'control class' controls.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      54c911eb
  2. 22 3月, 2011 1 次提交
  3. 19 1月, 2011 4 次提交
  4. 30 12月, 2010 2 次提交
  5. 21 10月, 2010 1 次提交
  6. 13 8月, 2010 1 次提交
  7. 09 8月, 2010 3 次提交
    • M
      V4L/DVB: v4l2-ctrls: Whitespace cleanups · 6dd5aff3
      Mauro Carvalho Chehab 提交于
      Fixes 37 checkpatch.pl warnings like:
      
      WARNING: please, no space before tabs
      +^Icase V4L2_CID_MPEG_VIDEO_PULLDOWN: ^Ireturn "Video Pulldown";$
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      6dd5aff3
    • H
      V4L/DVB: v4l2-ctrls: reorder 'case' statements to match order in header · 6c8d6111
      Hans Verkuil 提交于
      To make it easier to determine whether all controls are added in v4l2-ctrls.c
      the case statements inside the switch are re-ordered to match the header.
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      6c8d6111
    • H
      V4L/DVB: v4l2: Add new control handling framework · 0996517c
      Hans Verkuil 提交于
      Add a new framework to handle controls which makes life for driver
      developers much easier.
      
      Note that this patch moves some of the control support that used to be in
      v4l2-common.c to v4l2-ctrls.c. The tables were copied unchanged. The body
      of v4l2_ctrl_query_fill() was copied to a new v4l2_ctrl_fill() function
      in v4l2-ctrls.c. This new function doesn't use the v4l2_queryctrl
      struct anymore, which makes it more general.
      
      The remainder of v4l2-ctrls.c is all new. Highlights include:
      
      - No need to implement VIDIOC_QUERYCTRL, QUERYMENU, S_CTRL, G_CTRL,
        S_EXT_CTRLS, G_EXT_CTRLS or TRY_EXT_CTRLS in either bridge drivers
        or subdevs. New wrapper functions are provided that can just be plugged in.
        Once everything has been converted these wrapper functions can be removed as well.
      
      - When subdevices are added their controls can be automatically merged
        with the bridge driver's controls.
      
      - Most drivers just need to implement s_ctrl to set the controls.
        The framework handles the locking and tries to be as 'atomic' as possible.
      
      - Ready for the subdev device nodes: the same mechanism applies to subdevs
        and their device nodes as well. Sub-device drivers can make controls
        local, preventing them from being merged with bridge drivers.
      
      - Takes care of backwards compatibility handling of VIDIOC_S_CTRL and
        VIDIOC_G_CTRL. Handling of V4L2_CID_PRIVATE_BASE is fully transparent.
        CTRL_CLASS controls are automatically added.
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      0996517c