1. 30 3月, 2009 3 次提交
    • T
      V4L/DVB (10811): videodev: only copy needed part of RW ioctl's parameter · 19c96e4b
      Trent Piepho 提交于
      There are many RW ioctls() in v4l2 where userspace only supplies one or two
      of the first fields in the structure passed to the ioctl.  The driver then
      fills in the rest of the fields.
      
      Instead of copying the entire structure from userspace to the kernel we
      only need to copy those fields that userspace is actually supposed to
      supply.
      
      What's more, the fields that are meant to be only be output from the driver
      can be zeroed out in the videodev code, in case the driver doesn't fill
      them all in.  Many of the ioctl handlers in v4l2_ioctl do this already, but
      my patch does this at one common point and so all the memsets for each
      ioctl can be deleted.
      
      For VIDIOC_G_SLICED_VBI_CAP, which has one input field ('type') and other
      output-only fields, the input field is near the end of the structure
      instead of at the beginning.  So there is still a memset in it's ioctl
      handler to zero out the beginning of the struct.
      
      There were a couple mistakes with the existing code:
          For VIDIOC_G_AUDIO the index field was preserved, but G_AUDIO is a read
          only ioctl so nothing is copied from userspace to preserve.
      
          For VIDIOC_G_FREQUENCY the tuner field was not preserved like it should
          have been.  This would be a problem if there was any hardware with more
          than one tuner/modulator.
      
          For VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS, none of the
          fields were preserved even though each ioctl has several field that are
          supposed to be inputs to the driver!  Obviously these ioctls don't get
          used much.  The index field is needed if the driver has multiple
          discrete sizes/rates and other fields can be used too, e.g. if the size
          depends on pixel format or frame rate depends on image size for
          example.
      Signed-off-by: NTrent Piepho <xyzzy@speakeasy.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      19c96e4b
    • T
      V4L/DVB (10794): v4l2: Move code to zero querybuf output struct to v4l2_ioctl · 9cfb6a3f
      Trent Piepho 提交于
      For VIDIOC_QUERYBUF only the first two fields, size and type, are used as
      input.  The rest can be filled in by the driver as output.  Most drivers do
      not actually use all the field and unused ones should be zeroed out.  Some
      drivers have code to do this and some drivers should but don't.  So put
      some zero out code in v4l2_ioctl so that all drivers using that system get
      it.
      
      The drivers that have zeroing code get that code removed.
      
      Some drivers checked that the type field was valid, but v4l2_ioctl already
      does this so those checks can be removed as well.
      Signed-off-by: NTrent Piepho <xyzzy@speakeasy.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      9cfb6a3f
    • H
      V4L/DVB (10490): v4l2: prefill ident and revision from v4l2_dbg_chip_ident. · 80b36e0f
      Hans Verkuil 提交于
      Drivers that implement this always have to set the ident and revision
      to V4L2_IDENT_NONE and 0. Do this in the v4l2 core so drivers don't have
      to do this.
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      80b36e0f
  2. 03 1月, 2009 3 次提交
  3. 30 12月, 2008 6 次提交
  4. 22 10月, 2008 3 次提交
  5. 13 10月, 2008 1 次提交
  6. 04 9月, 2008 2 次提交
  7. 26 7月, 2008 1 次提交
  8. 24 7月, 2008 1 次提交