1. 16 2月, 2016 4 次提交
  2. 01 2月, 2016 3 次提交
  3. 11 1月, 2016 12 次提交
    • M
      [media] dvbdev: Add RF connector if needed · 0230d60e
      Mauro Carvalho Chehab 提交于
      Several pure digital TV devices have a frontend with the tuner
      integrated on it. Add the RF connector when dvb_create_media_graph()
      is called on such devices.
      
      Tested with siano and dvb_usb_mxl111sf drivers.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0230d60e
    • M
      [media] usb: check media device errors · 9f806795
      Mauro Carvalho Chehab 提交于
      There are now two new warnings:
      
      drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_media_device_register':
      drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:433:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
        media_device_register(adap->dvb_adap.mdev);
        ^
      drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function 'dvb_usb_media_device_register':
      drivers/media/usb/dvb-usb/dvb-usb-dvb.c:128:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
        media_device_register(adap->dvb_adap.mdev);
        ^
      
      Those are because the drivers are not properly checking if the
      media device init and register were succeeded.
      
      Fix it.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9f806795
    • J
      [media] media-device: split media initialization and registration · 9832e155
      Javier Martinez Canillas 提交于
      The media device node is registered and so made visible to user-space
      before entities are registered and links created which means that the
      media graph obtained by user-space could be only partially enumerated
      if that happens too early before all the graph has been created.
      
      To avoid this race condition, split the media init and registration
      in separate functions and only register the media device node when
      all the pending subdevices have been registered, either explicitly
      by the driver or asynchronously using v4l2_async_register_subdev().
      
      The media_device_register() had a check for drivers not filling dev
      and model fields but all drivers in mainline set them and not doing
      it will be a driver bug so change the function return to void and
      add a BUG_ON() for dev being NULL instead.
      
      Also, add a media_device_cleanup() function that will destroy the
      graph_mutex that is initialized in media_device_init().
      
      [mchehab@osg.samsung.com: Fix compilation if !CONFIG_MEDIA_CONTROLLER
       and remove two warnings added by this changeset]
      Suggested-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9832e155
    • M
      [media] media framework: rename pads init function to media_entity_pads_init() · ab22e77c
      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: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      ab22e77c
    • 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] cx231xx: enforce check for graph creation · ab232e46
      Mauro Carvalho Chehab 提交于
      If the graph creation fails, don't register the device.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      ab232e46
    • M
      [media] dvb core: must check dvb_create_media_graph() · 0d3ab841
      Mauro Carvalho Chehab 提交于
      If media controller is enabled and mdev is filled, it should
      ensure that the media graph will be properly initialized.
      
      Enforce that.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0d3ab841
    • M
      [media] tuner-core: add an input pad · 188d2d55
      Mauro Carvalho Chehab 提交于
      Tuners actually have at least one connector on its input.
      
      Add a PAD to connect it.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      188d2d55
    • M
      [media] media: convert links from array to list · 57208e5e
      Mauro Carvalho Chehab 提交于
      The entire logic that represent graph links were developed on a
      time where there were no needs to dynamic remove links. So,
      although links are created/removed one by one via some
      functions, they're stored as an array inside the entity struct.
      
      As the array may grow, there's a logic inside the code that
      checks if the amount of space is not enough to store
      the needed links. If it isn't the core uses krealloc()
      to change the size of the link, with is bad, as it
      leaves the memory fragmented.
      
      So, convert links into a list.
      
      Also, currently,  both source and sink entities need the link
      at the graph traversal logic inside media_entity. So there's
      a logic duplicating all links. That makes it to spend
      twice the memory needed. This is not a big deal for today's
      usage, where the number of links are not big.
      
      Yet, if during the MC workshop discussions, it was said that
      IIO graphs could have up to 4,000 entities. So, we may
      want to remove the duplication on some future. The problem
      is that it would require a separate linked list to store
      the backlinks inside the entity, or to use a more complex
      algorithm to do graph backlink traversal, with is something
      that the current graph traversal inside the core can't cope
      with. So, let's postpone a such change if/when it is actually
      needed.
      
      It should also be noticed that the media_link structure uses
      44 bytes on 32-bit architectures and 84 bytes on 64-bit
      architecture. It will thus be allocated out of the 64-bytes and
      96-bytes pools respectively. That's a 12.5% memory waste on
      64-bit architectures and 31.25% on 32-bit architecture.
      A linked list is less efficient than an array in this case, but
      this could later be optimized if we can get rid of the reverse
      links (with would reduce memory allocation by 50%).
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      57208e5e
    • M
      [media] media: rename the function that create pad links · 8df00a15
      Mauro Carvalho Chehab 提交于
      With the new API, a link can be either between two PADs or between an interface
      and an entity. So, we need to use a better name for the function that create
      links between two pads.
      
      So, rename the such function to media_create_pad_link().
      
      No functional changes.
      
      This patch was created via this shell script:
      	for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      8df00a15
    • M
      [media] media: get rid of unused "extra_links" param on media_entity_init() · 18095107
      Mauro Carvalho Chehab 提交于
      Currently, media_entity_init() creates an array with the links,
      allocated at init time. It provides a parameter (extra_links)
      that would allocate more links than the current needs, but this
      is not used by any driver.
      
      As we want to be able to do dynamic link allocation/removal,
      we'll need to change the implementation of the links. So,
      before doing that, let's first remove that extra unused
      parameter, in order to cleanup the interface first.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      18095107
  4. 18 12月, 2015 1 次提交
  5. 03 12月, 2015 1 次提交
  6. 19 11月, 2015 1 次提交
  7. 18 11月, 2015 1 次提交
  8. 17 11月, 2015 2 次提交
    • M
      [media] include/media: move driver interface headers to a separate dir · d647f0b7
      Mauro Carvalho Chehab 提交于
      Let's not mix headers used by the core with those headers that
      are needed by some driver-specific interface header.
      
      The headers used on drivers were manually moved using:
          mkdir include/media/drv-intf/
          git mv include/media/cx2341x.h include/media/cx25840.h \
      	include/media/exynos-fimc.h include/media/msp3400.h \
      	include/media/s3c_camif.h include/media/saa7146.h \
      	include/media/saa7146_vv.h  include/media/sh_mobile_ceu.h \
      	include/media/sh_mobile_csi2.h include/media/sh_vou.h \
      	include/media/si476x.h include/media/soc_mediabus.h \
      	include/media/tea575x.h include/media/drv-intf/
      
      And the references for those headers were corrected using:
      
          MAIN_DIR="media/"
          PREV_DIR="media/"
          DIRS="drv-intf/"
      
          echo "Checking affected files" >&2
          for i in $DIRS; do
      	for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
      		 n=`basename $j`
      		git grep -l $n
      	done
          done|sort|uniq >files && (
      	echo "Handling files..." >&2;
      	echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done";
      	);
      	echo "Handling documentation..." >&2;
      	echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "  perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done"
      	);
          ) >script && . ./script
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      d647f0b7
    • M
      [media] include/media: split I2C headers from V4L2 core · b5dcee22
      Mauro Carvalho Chehab 提交于
      Currently, include/media is messy, as it contains both the V4L2 core
      headers and some driver-specific headers on the same place. That makes
      harder to identify what core headers should be documented and what
      headers belong to I2C drivers that are included only by bridge/main
      drivers that would require the functions provided by them.
      
      Let's move those i2c specific files to its own subdirectory.
      
      The files to move were produced via the following script:
      	mkdir include/media/i2c
      	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
      	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
      	for i in include/media/*.h; do n=`basename $i`;  (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done
      
      And the references corrected via this script:
          MAIN_DIR="media/"
          PREV_DIR="media/"
          DIRS="i2c/"
      
          echo "Checking affected files" >&2
          for i in $DIRS; do
      	for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
      		 n=`basename $j`
      		git grep -l $n
      	done
          done|sort|uniq >files && (
      	echo "Handling files..." >&2;
      	echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done";
      	);
      	echo "Handling documentation..." >&2;
      	echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
      	(
      		cd include/$MAIN_DIR;
      		for j in $DIRS; do
      			for i in $(ls $j); do
      				echo "  perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
      			done;
      		done;
      		echo "cat > a && mv a \$i; done"
      	);
          ) >script && . ./script
      
      Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      b5dcee22
  9. 03 10月, 2015 1 次提交
  10. 04 9月, 2015 1 次提交
  11. 10 6月, 2015 3 次提交
  12. 13 5月, 2015 1 次提交
  13. 01 5月, 2015 2 次提交
  14. 03 4月, 2015 2 次提交
    • H
      [media] cx231xx: embed video_device · 60acf187
      Hans Verkuil 提交于
      Embed the video_device struct to simplify the error handling and in
      order to (eventually) get rid of video_device_alloc/release.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      60acf187
    • H
      [media] cx231xx: fix compiler warnings · 27eb5e24
      Hans Verkuil 提交于
      If CONFIG_VIDEO_CX231XX_RC is undefined, then these compiler warnings
      are generated:
      
      In file included from drivers/media/usb/cx231xx/cx231xx-cards.c:23:0:
      drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_release_resources’:
      drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
       #define cx231xx_ir_exit(dev) (0)
                                    ^
      drivers/media/usb/cx231xx/cx231xx-cards.c:1158:2: note: in expansion of macro ‘cx231xx_ir_exit’
        cx231xx_ir_exit(dev);
        ^
      drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_init_dev’:
      drivers/media/usb/cx231xx/cx231xx.h:981:30: warning: statement with no effect [-Wunused-value]
       #define cx231xx_ir_init(dev) (0)
                                    ^
      drivers/media/usb/cx231xx/cx231xx-cards.c:1351:2: note: in expansion of macro ‘cx231xx_ir_init’
        cx231xx_ir_init(dev);
        ^
      drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
      drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
       #define cx231xx_ir_exit(dev) (0)
                                    ^
      drivers/media/usb/cx231xx/cx231xx-cards.c:1705:2: note: in expansion of macro ‘cx231xx_ir_exit’
        cx231xx_ir_exit(dev);
        ^
      drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_disconnect’:
      drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
       #define cx231xx_ir_exit(dev) (0)
                                    ^
      drivers/media/usb/cx231xx/cx231xx-cards.c:1754:3: note: in expansion of macro ‘cx231xx_ir_exit’
         cx231xx_ir_exit(dev);
         ^
      
      Fix by using static inlines instead of defines.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      27eb5e24
  15. 03 3月, 2015 2 次提交
  16. 02 3月, 2015 2 次提交
  17. 26 2月, 2015 1 次提交