summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* media: dt-bindings: rcar-vin: Add R8A774C0 supportFabrizio Castro2019-01-161-4/+5
| | | | | | | | | | | | Add the compatible string for RZ/G2E (a.k.a. R8A774C0) to the list of SoCs supported by rcar-vin driver. Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dt-bindings: rcar-csi2: Add r8a774c0Fabrizio Castro2019-01-161-1/+2
| | | | | | | | | | | | Add the compatible string for RZ/G2E (a.k.a. R8A774C0) to the list of supported SoCs. Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv748x: configure number of lanes used for TXA CSI-2 transmitterNiklas Söderlund2019-01-161-69/+70
| | | | | | | | | | | | | | | | | | | The driver fixed the TXA CSI-2 transmitter in 4-lane mode while it could operate using 1-, 2- and 4-lanes. Update the driver to support all available modes. The driver makes use of large tables of static register/value writes when powering up/down the TXA and TXB transmitters which include the write to the NUM_LANES register. By converting the tables into functions and using parameters the power up/down functions for TXA and TXB power up/down can be merged and used for both transmitters. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv748x: store number of CSI-2 lanes described in device treeNiklas Söderlund2019-01-162-0/+51
| | | | | | | | | | | | | | | | The adv748x CSI-2 transmitters TXA and TXB can use different number of lanes to transmit data. In order to be able to configure the device correctly this information need to be parsed from device tree and stored in each TX private data structure. TXA supports 1, 2 and 4 lanes while TXB supports 1 lane. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv748x: reuse power up sequence when initializing CSI-2Niklas Söderlund2019-01-161-37/+13
| | | | | | | | | | | | | | Extend the MIPI CSI-2 power up sequence to match the power up sequence in the hardware manual chapter "9.5.1 Power Up Sequence". This change allows the power up functions to be reused when initializing the hardware reducing code duplicating as well aligning with the documentation. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dt-bindings: adv748x: make data-lanes property mandatory for CSI-2 ↵Niklas Söderlund2019-01-161-1/+10
| | | | | | | | | | | | | | endpoints The CSI-2 transmitters can use a different number of lanes to transmit data. Make the data-lanes mandatory for the endpoints that describe the transmitters as no good default can be set to fallback on. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dvb: Add check on sp8870_readregAditya Pakki2019-01-161-1/+3
| | | | | | | | | | In sp8870_set_frontend_parameters, the function sp8870_readreg may return an error when i2c_transfer fails. The fix checks for this error and returns upstream consistent with other invocations. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dvb: add return value check on Write16Aditya Pakki2019-01-161-11/+19
| | | | | | | | | Write16 can return an error code -1 when the i2c_write fails. The fix checks for these failures and returns the error upstream Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: secocec: fix ir address shiftEttore Chimenti2019-01-161-1/+1
| | | | | | | | | | The actual value of the RC5 System Number (address) is stored in the IR_READ_DATA common register masked with 0x1F00 so it have to be shifted by 8 bits. Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: cxd2880-spi: fix two memory leaks of dvb_spiColin Ian King2019-01-161-3/+5
| | | | | | | | | | | | | | | There are two return paths that do not kfree dvb_spi. Fix the memory leaks by returning via the exit label fail_adapter that will free dvi_spi. Detected by CoverityScan, CID#1475991 ("Resource Leak") Fixes: cb496cd472af ("media: cxd2880-spi: Add optional vcc regulator") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>? Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mt312: fix a missing check of mt312 resetKangjie Lu2019-01-161-1/+3
| | | | | | | | | | | mt312_reset() may fail. Although it is called in the end of mt312_set_frontend(), we better check its status and return its error code upstream instead of 0. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Reviewed-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: lgdt3306a: fix a missing check of return valueKangjie Lu2019-01-161-1/+4
| | | | | | | | | | If lgdt3306a_read_reg() fails, the read data in "val" is incorrect, thus shouldn't be further used. The fix inserts a check for the return value of lgdt3306a_read_reg(). If it fails, goto fail. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: seco-cec: fix RC_CORE dependencyArnd Bergmann2019-01-161-1/+1
| | | | | | | | | | | | | | | | | All other drivers that need RC_CORE have a dependency rather than using 'select', so we should do the same here to avoid circular dependencies as well as this warning about missing dependencies: WARNING: unmet direct dependencies detected for RC_CORE Depends on [n]: INPUT [=n] Selected by [y]: - VIDEO_SECO_RC [=y] && MEDIA_SUPPORT [=y] && CEC_PLATFORM_DRIVERS [=y] && VIDEO_SECO_CEC [=y] Fixes: daef95769b3a ("media: seco-cec: add Consumer-IR support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rcar-vin: remove unneeded locking in async callbacksNiklas Söderlund2019-01-161-14/+0
| | | | | | | | | | | | | | The locking implemented in the async notifier callbacks are unnecessary as the global list_lock in v4l2-async.c is held whenever one of the callbacks are called. The locking in itself is not harmful however it produces a LOCKDEP warning between the global v4l2-async list_lock and the rcar-vin local locking schema. Remove the rcar-vin locking for the async callbacks to reduce complexity and silent the false LOCKDEP warning. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: staging: bcm2835-camera: use V4L2_FRACT_COMPAREAkinobu Mita2019-01-161-6/+2
| | | | | | | | Now the equivalent of FRACT_CMP() is added in v4l2 common internal API header. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: tw9910: add helper function for setting gpiod valueAlexey Khoroshilov2019-01-161-17/+13
| | | | | | | | | tw9910 driver tries to sleep for the same period of time after each gpiod_set_value(). The patch moves duplicated code to a helper function. Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: tw9910: fix failure handling in tw9910_power_on()Alexey Khoroshilov2019-01-161-0/+5
| | | | | | | | | If gpiod_get_optional() fails in tw9910_power_on(), clk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumerationPawe? Chmiel2019-01-161-8/+11
| | | | | | | | | | | | | | | | | | | | | Previously when doing format enumeration, it was returning all formats supported by driver, even if they're not supported by hw. Add missing check for fmt_ver_flag, so it'll be fixed and only those supported by hw will be returned. Similar thing is already done in s5p_jpeg_find_format. It was found by using v4l2-compliance tool and checking result of VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS test and using v4l2-ctl to get list of all supported formats. Tested on s5pv210-galaxys (Samsung i9000 phone). Fixes: bb677f3ac434 ("[media] Exynos4 JPEG codec v4l2 driver") Signed-off-by: Pawe? Chmiel <pawel.mikolaj.chmiel@gmail.com> Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> [hverkuil-cisco@xs4all.nl: fix a few alignment issues] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: gspca: mt9m111: Check write_bridge for timeoutAditya Pakki2019-01-161-3/+5
| | | | | | | | In mt9m111_probe, m5602_write_bridge can timeout and return a negative error value. The fix checks for this error and passes it upstream. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: gspca: Check the return value of write_bridge for timeoutAditya Pakki2019-01-161-2/+6
| | | | | | | | | In po1030_probe(), m5602_write_bridge() can timeout and return an error value. The fix checks for the return value and propagates upstream consistent with other usb drivers. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: usb: gspca: add a missed check for goto_low_powerKangjie Lu2019-01-161-1/+5
| | | | | | | | The fix checks if goto_low_power() fails, and if so, issues an error message. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: usb: gspca: add a missed return-value check for do_commandKangjie Lu2019-01-161-2/+6
| | | | | | | | do_command() may fail. The fix adds the missed return value of do_command(). If it fails, returns its error code. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sunxi: cedrus: Fix missing error message contextOndrej Jirman2019-01-161-14/+14
| | | | | | | | | When cedrus_hw_probe is called, v4l2_dev is not yet initialized. Use dev_err instead. Signed-off-by: Ondrej Jirman <megous@megous.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-ctrls.c/uvc: zero v4l2_eventHans Verkuil2019-01-162-2/+2
| | | | | | | | | | | | | | Control events can leak kernel memory since they do not fully zero the event. The same code is present in both v4l2-ctrls.c and uvc_ctrl.c, so fix both. It appears that all other event code is properly zeroing the structure, it's these two places. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: syzbot+4f021cf3697781dbd9fb@syzkaller.appspotmail.com Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vicodec: bugfix - replace '=' with '|='Dafna Hirschfeld2019-01-161-4/+4
| | | | | | | | | In the fwht_encode_frame, 'encoding = encode_plane' should be replaced with 'encoding |= encode_plane' so existing flags won't be overwrriten. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: MAINTAINERS: Change s5p-jpeg maintainer information.Andrzej Pietrasiewicz2019-01-161-1/+2
| | | | | | | | | | | My @samsung.com address is going to cease existing soon, so change it to an address which can actually be used to contact me. Adding Sylwester Nawrocki, who still has access to a wide spectrum of Exynos-based hardware. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: Change Andrzej Pietrasiewicz's e-mail addressAndrzej Pietrasiewicz2019-01-167-8/+8
| | | | | | | | My @samsung.com address is going to cease existing soon, so change it to an address which can actually be used to contact me. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rcar-csi2: Fix PHTW table values for E3/V3MJacopo Mondi2019-01-161-31/+31
| | | | | | | | | | | | The PHTW selection algorithm implemented in rcsi2_phtw_write_mbps() checks for lower bound of the interval used to match the desired bandwidth. Use that in place of the currently used upper bound. Fixes: 10c08812fe60 ("media: rcar: rcar-csi2: Update V3M/E3 PHTW tables") Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vsp1: Fix trivial documentationKieran Bingham2019-01-161-1/+1
| | | | | | | | | | In the partition sizing the term 'prevents' is inappropriately pluralized. Simplify to 'prevent'. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: MAINTAINERS: added include/trace/events/pwc.hHans Verkuil2019-01-161-0/+1
| | | | | | | Added include/trace/events/pwc.h to the list of files. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: usb: pwc: Don't use coherent DMA buffers for ISO transferMatwey V. Kornilov2019-01-161-13/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DMA cocherency slows the transfer down on systems without hardware coherent DMA. Instead we use noncocherent DMA memory and explicit sync at data receive handler. Based on previous commit the following performance benchmarks have been carried out. Average memcpy() data transfer rate (rate) and handler completion time (time) have been measured when running video stream at 640x480 resolution at 10fps. x86_64 based system (Intel Core i5-3470). This platform has hardware coherent DMA support and proposed change doesn't make big difference here. * kmalloc: rate = (2.0 +- 0.4) GBps time = (5.0 +- 3.0) usec * usb_alloc_coherent: rate = (3.4 +- 1.2) GBps time = (3.5 +- 3.0) usec We see that the measurements agree within error ranges in this case. So theoretically predicted performance downgrade cannot be reliably measured here. armv7l based system (TI AM335x BeagleBone Black @ 300MHz). This platform has no hardware coherent DMA support. DMA coherence is implemented via disabled page caching that slows down memcpy() due to memory controller behaviour. * kmalloc: rate = ( 94 +- 4) MBps time = (101 +- 4) usec * usb_alloc_coherent: rate = (28.1 +- 0.1) MBps time = (341 +- 2) usec Note, that quantative difference leads (this commit leads to 3.3 times acceleration) to qualitative behavior change in this case. As it was stated before, the video stream cannot be successfully received at AM335x platforms with MUSB based USB host controller due to performance issues [1]. [1] https://www.spinics.net/lists/linux-usb/msg165735.html Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: usb: pwc: Introduce TRACE_EVENTs for pwc_isoc_handler()Matwey V. Kornilov2019-01-162-0/+72
| | | | | | | | | | | | | | | | | There were reports that PWC-based webcams don't work at some embedded ARM platforms. [1] Isochronous transfer handler seems to work too long leading to the issues in MUSB USB host subsystem. Also note, that urb->giveback() handlers are still called with disabled interrupts. In order to be able to measure performance of PWC driver, traces are introduced in URB handler section. [1] https://www.spinics.net/lists/linux-usb/msg165735.html Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-mfc: fix incorrect bus assignment in virtual child deviceMarek Szyprowski2019-01-071-1/+0
| | | | | | | | | | | | | | | Virtual MFC codec's child devices must not be assigned to platform bus, because they are allocated as raw 'struct device' and don't have the corresponding 'platform' part. This fixes NULL pointer access revealed recently by commit a66d972465d1 ("devres: Align data[] to ARCH_KMALLOC_MINALIGN"). Fixes: c79667dd93b0 ("media: s5p-mfc: replace custom reserved memory handling code with generic one") Reported-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: platform: Fix missing spin_lock_init()Wei Yongjun2019-01-071-0/+1
| | | | | | | | | | | | The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: Documentation: staging/ipu3-imgu: Add license informationSakari Ailus2019-01-072-1/+26
| | | | | | | | The driver documentation is under GPL v2 and the uAPI documentation under GNU FDL 1.1+ (without invariant sections) or GPL v2. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: Documentation: staging/ipu3-imgu: Fix reference file nameSakari Ailus2019-01-071-1/+1
| | | | | | | | The intel-ipu3.h intended-to-be-uAPI header is currently under drivers/staging/media/ipu3/include/, not include/uapi/linux. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: lgdt330x: fix lock status reportingFrench, Nicholas A2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | A typo in code cleanup commit db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic") broke the FE_HAS_LOCK reporting for 3303 chips by inadvertently modifying the register mask. The broken lock status is critial as it prevents video capture cards from reporting signal strength, scanning for channels, and capturing video. Fix regression by reverting mask change. Cc: stable@vger.kernel.org # Kernel 4.17+ Fixes: db9c1007bc07 ("media: lgdt330x: do some cleanups at status logic") Signed-off-by: Nick French <naf@ou.edu> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Adam Stylinski <kungfujesus06@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: extended-controls.rst: update the mpeg2 compound controlsHans Verkuil2019-01-071-11/+17
| | | | | | | | | The layout of the compound controls has changed to fix 32/64 bit alignment issues and the use of timestamps instead of buffer indices to refer to buffers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: cedrus: identify buffers by timestampHans Verkuil2019-01-075-33/+24
| | | | | | | | | | | | | Use the new v4l2_m2m_buf_copy_data helper function and use timestamps to refer to reference frames instead of using buffer indices. Also remove the padding fields in the structs, that's a bad idea. Just use the right types to keep everything aligned. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Tested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vb2: add vb2_find_timestamp()Hans Verkuil2019-01-072-1/+35
| | | | | | | | | | | | | | | Use v4l2_timeval_to_ns instead of timeval_to_ns to ensure that both kernelspace and userspace will use the same conversion function. Next add a new vb2_find_timestamp() function to find buffers with a specific timestamp. This function will only look at DEQUEUED and DONE buffers, i.e. buffers that are already processed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: videodev2.h: add v4l2_timeval_to_ns inline functionHans Verkuil2019-01-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | We want to be able to uniquely identify buffers for stateless codecs. The internal timestamp (a u64) as stored internally in the kernel is a suitable candidate for that, but in struct v4l2_buffer it is represented as a struct timeval. Add a v4l2_timeval_to_ns() function that converts the struct timeval into a u64 in the same way that the kernel does. This makes it possible to use this u64 elsewhere as a unique identifier of the buffer. Since timestamps are also copied from the output buffer to the corresponding capture buffer(s) by M2M devices, the u64 can be used to refer to both output and capture buffers. The plan is that in the future we redesign struct v4l2_buffer and use u64 for the timestamp instead of a struct timeval (which has lots of problems with 32 vs 64 bit and y2038 layout changes), and then there is no more need to use this function. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: buffer.rst: clean up timecode documentationHans Verkuil2019-01-071-6/+5
| | | | | | | | | | | | V4L2_BUF_FLAG_TIMECODE is not video capture specific, so drop that part. The 'Timecodes' section was a bit messy, so that's cleaned up. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vicodec: use v4l2_m2m_buf_copy_dataHans Verkuil2019-01-071-11/+1
| | | | | | | Use the new v4l2_m2m_buf_copy_data() function in vicodec. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vim2m: use v4l2_m2m_buf_copy_dataHans Verkuil2019-01-071-11/+1
| | | | | | | Use the new v4l2_m2m_buf_copy_data() function in vim2m. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-mem2mem: add v4l2_m2m_buf_copy_data helper functionHans Verkuil2019-01-072-0/+40
| | | | | | | | | | | | Memory-to-memory devices should copy various parts of struct v4l2_buffer from the output buffer to the capture buffer. Add a helper function that does that to simplify the driver code. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* ipu3: add missing #includeMauro Carvalho Chehab2019-01-072-0/+2
| | | | | | | Lots of warning due to non-static functions are generated because the headers with define them were not included. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Linux 5.0-rc1v5.0-rc1Linus Torvalds2019-01-061-3/+3
|
* Merge tag 'kbuild-v4.21-3' of ↵Linus Torvalds2019-01-0694-694/+150
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - improve boolinit.cocci and use_after_iter.cocci semantic patches - fix alignment for kallsyms - move 'asm goto' compiler test to Kconfig and clean up jump_label CONFIG option - generate asm-generic wrappers automatically if arch does not implement mandatory UAPI headers - remove redundant generic-y defines - misc cleanups * tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: rename generated .*conf-cfg to *conf-cfg kbuild: remove unnecessary stubs for archheader and archscripts kbuild: use assignment instead of define ... endef for filechk_* rules arch: remove redundant UAPI generic-y defines kbuild: generate asm-generic wrappers if mandatory headers are missing arch: remove stale comments "UAPI Header export list" riscv: remove redundant kernel-space generic-y kbuild: change filechk to surround the given command with { } kbuild: remove redundant target cleaning on failure kbuild: clean up rule_dtc_dt_yaml kbuild: remove UIMAGE_IN and UIMAGE_OUT jump_label: move 'asm goto' support test to Kconfig kallsyms: lower alignment on ARM scripts: coccinelle: boolinit: drop warnings on named constants scripts: coccinelle: check for redeclaration kconfig: remove unused "file" field of yylval union nds32: remove redundant kernel-space generic-y nios2: remove unneeded HAS_DMA define
| * kconfig: rename generated .*conf-cfg to *conf-cfgMasahiro Yamada2019-01-062-18/+19
| | | | | | | | | | | | | | Remove the dot-prefixing since it is just a matter of the .gitignore file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
| * kbuild: remove unnecessary stubs for archheader and archscriptsMasahiro Yamada2019-01-061-5/+1
| | | | | | | | | | | | | | Make simply skips a missing rule when it is marked as .PHONY. Remove the dummy targets. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>