1. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  2. 28 11月, 2017 1 次提交
  3. 20 6月, 2017 1 次提交
    • T
      [media] v4l2-core: Use kvmalloc() for potentially big allocations · 758d90e1
      Tomasz Figa 提交于
      There are multiple places where arrays or otherwise variable sized
      buffer are allocated through V4L2 core code, including things like
      controls, memory pages, staging buffers for ioctls and so on. Such
      allocations can potentially require an order > 0 allocation from the
      page allocator, which is not guaranteed to be fulfilled and is likely to
      fail on a system with severe memory fragmentation (e.g. a system with
      very long uptime).
      
      Since the memory being allocated is intended to be used by the CPU
      exclusively, we can consider using vmalloc() as a fallback and this is
      exactly what the recently merged kvmalloc() helpers do. A kmalloc() call
      is still attempted, even for order > 0 allocations, but it is done
      with __GFP_NORETRY and __GFP_NOWARN, with expectation of failing if
      requested memory is not available instantly. Only then the vmalloc()
      fallback is used. This should give us fast and more reliable allocations
      even on systems with higher memory pressure and/or more fragmentation,
      while still retaining the same performance level on systems not
      suffering from such conditions.
      
      While at it, replace explicit array size calculations on changed
      allocations with kvmalloc_array().
      
      Purposedly not touching videobuf1, as it is deprecated, has only few
      users remaining and would rather be seen removed instead.
      Signed-off-by: NTomasz Figa <tfiga@chromium.org>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      758d90e1
  4. 27 1月, 2017 1 次提交
    • S
      [media] media: Drop FSF's postal address from the source code files · bcb63314
      Sakari Ailus 提交于
      Drop the FSF's postal address from the source code files that typically
      contain mostly the license text. Of the 628 removed instances, 578 are
      outdated.
      
      The patch has been created with the following command without manual edits:
      
      git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
      	drivers/media/ include/media|while read i; do i=$i perl -e '
      open(F,"< $ENV{i}");
      $a=join("", <F>);
      $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
      	&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
      close(F);
      open(F, "> $ENV{i}");
      print F $a;
      close(F);'; done
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      bcb63314
  5. 23 7月, 2016 1 次提交
  6. 29 4月, 2016 1 次提交
  7. 14 4月, 2016 2 次提交
  8. 11 1月, 2016 5 次提交
    • M
      [media] uapi/media.h: Rename entities types to functions · 4ca72efa
      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: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      4ca72efa
    • M
      [media] media-entity.h: rename entity.type to entity.function · 0e576b76
      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: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0e576b76
    • M
      [media] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs · b50bde4e
      Mauro Carvalho Chehab 提交于
      Instead of abusing MEDIA_ENT_T_V4L2_SUBDEV, initialize
      new subdev entities as MEDIA_ENT_T_UNKNOWN.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      b50bde4e
    • M
      [media] media: use macros to check for V4L2 subdev entities · 3efdf62c
      Mauro Carvalho Chehab 提交于
      Instead of relying on media subtype, use the new macros to detect
      if an entity is a subdev or an A/V DMA entity.
      
      Please note that most drivers assume that there's just AV_DMA or
      V4L2 subdevs. This is not true anymore, as we've added MC support
      for DVB, and there are plans to add support for ALSA and FB/DRM
      too.
      
      Ok, on the current pipelines supported by those drivers, just V4L
      stuff are there, but, assuming that some day a pipeline that also
      works with other subsystems will ever added, it is better to add
      explicit checks for the AV_DMA stuff.
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      3efdf62c
    • M
      [media] replace all occurrences of MEDIA_ENT_T_DEVNODE_V4L · cf490661
      Mauro Carvalho Chehab 提交于
      Now that interfaces and entities are distinct, it makes no sense
      of keeping something named as MEDIA_ENT_T_DEVNODE.
      
      This change was done with this script:
      
      	for i in $(git grep -l MEDIA_ENT_T|grep -v uapi/linux/media.h); do sed s,MEDIA_ENT_T_DEVNODE_V4L,MEDIA_ENT_T_V4L2_VIDEO, <$i >a && mv a $i; done
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      cf490661
  9. 17 7月, 2015 1 次提交
  10. 08 4月, 2015 1 次提交
  11. 24 3月, 2015 2 次提交
  12. 23 12月, 2014 1 次提交
  13. 22 8月, 2014 1 次提交
  14. 22 7月, 2014 2 次提交
    • M
      [media] v4l2-subdev: Fix compilation when !VIDEO_V4L2_SUBDEV_API · d352bcc9
      Mauro Carvalho Chehab 提交于
      As reported by Kbuildtest:
      
         drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_format':
         drivers/media/v4l2-core/v4l2-subdev.c:136:23: error: 'struct v4l2_subdev' has no member named 'entity'
           if (format->pad >= sd->entity.num_pads)
                                ^
         drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_crop':
         drivers/media/v4l2-core/v4l2-subdev.c:148:21: error: 'struct v4l2_subdev' has no member named 'entity'
           if (crop->pad >= sd->entity.num_pads)
                              ^
         drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_selection':
         drivers/media/v4l2-core/v4l2-subdev.c:161:20: error: 'struct v4l2_subdev' has no member named 'entity'
           if (sel->pad >= sd->entity.num_pads)
                             ^
         drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_edid':
         drivers/media/v4l2-core/v4l2-subdev.c:169:21: error: 'struct v4l2_subdev' has no member named 'entity'
           if (edid->pad >= sd->entity.num_pads)
                              ^
         drivers/media/v4l2-core/v4l2-subdev.c: In function 'subdev_do_ioctl':
      >> drivers/media/v4l2-core/v4l2-subdev.c:186:6: warning: unused variable 'rval' [-Wunused-variable]
           int rval;
               ^
         drivers/media/v4l2-core/v4l2-subdev.c: At top level:
         drivers/media/v4l2-core/v4l2-subdev.c:129:12: warning: 'check_format' defined but not used [-Wunused-function]
          static int check_format(struct v4l2_subdev *sd,
                     ^
         drivers/media/v4l2-core/v4l2-subdev.c:142:12: warning: 'check_crop' defined but not used [-Wunused-function]
          static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop)
                     ^
         drivers/media/v4l2-core/v4l2-subdev.c:154:12: warning: 'check_selection' defined but not used [-Wunused-function]
          static int check_selection(struct v4l2_subdev *sd,
                     ^
         drivers/media/v4l2-core/v4l2-subdev.c:167:12: warning: 'check_edid' defined but not used [-Wunused-function]
          static int check_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
      
      The above warnins happen because those functions are used only
      when the V4L2 subdev API is enabled.
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      d352bcc9
    • S
      [media] v4l: subdev: Unify argument validation across IOCTLs · b225e398
      Sakari Ailus 提交于
      Separate validation of different argument types. There's no reason to do
      this separately for every IOCTL.
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b225e398
  15. 17 7月, 2014 1 次提交
  16. 25 5月, 2014 2 次提交
  17. 14 5月, 2014 1 次提交
  18. 11 3月, 2014 1 次提交
  19. 24 2月, 2014 1 次提交
  20. 22 11月, 2012 1 次提交
  21. 14 9月, 2012 1 次提交
  22. 14 8月, 2012 1 次提交
  23. 07 7月, 2012 2 次提交
  24. 14 5月, 2012 1 次提交
  25. 11 4月, 2012 2 次提交
  26. 15 2月, 2012 1 次提交
  27. 06 1月, 2012 1 次提交
  28. 01 11月, 2011 1 次提交
  29. 24 9月, 2011 1 次提交
  30. 28 7月, 2011 1 次提交
    • H
      [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh · f1e393de
      Hans Verkuil 提交于
      The driver had to decide how many events to allocate when the v4l2_fh struct
      was created. It was possible to add more events afterwards, but there was no
      way to ensure that you wouldn't miss important events if the event queue
      would fill up for that filehandle.
      
      In addition, once there were no more free events, any new events were simply
      dropped on the floor.
      
      For the control event in particular this made life very difficult since
      control status/value changes could just be missed if the number of allocated
      events and the speed at which the application read events was too low to keep
      up with the number of generated events. The application would have no idea
      what the latest state was for a control since it could have missed the latest
      control change.
      
      So this patch makes some major changes in how events are allocated. Instead
      of allocating events per-filehandle they are now allocated when subscribing an
      event. So for that particular event type N events (determined by the driver)
      are allocated. Those events are reserved for that particular event type.
      This ensures that you will not miss events for a particular type altogether.
      
      In addition, if there are N events in use and a new event is raised, then
      the oldest event is dropped and the new one is added. So the latest event
      is always available.
      
      This can be further improved by adding the ability to merge the state of
      two events together, ensuring that no data is lost at all. This will be
      added in the next patch.
      
      This also makes it possible to allow the user to determine the number of
      events that will be allocated. This is not implemented at the moment, but
      would be trivial.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      f1e393de