Re: [PATCH 6/7] [RFC] [media]: v4l2: introduce v4l2_timeval

2015-09-15 Thread Hans Verkuil
On 09/15/2015 10:26 PM, Arnd Bergmann wrote: > On Tuesday 15 September 2015 18:27:19 Hans Verkuil wrote: >> On 09/15/2015 05:49 PM, Arnd Bergmann wrote: >>> The v4l2 API uses a 'struct timeval' to communicate time stamps to user >>> space. This is broken on 32-bit architectures as soon as we have a

cron job: media_tree daily build: OK

2015-09-15 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Wed Sep 16 04:00:18 CEST 2015 git branch: test git hash: 9ddf9071ea17b83954358b2dac42b34e5857a9af gcc versi

[PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree

2015-09-15 Thread Bryan Wu
Following device tree support for Tegra VI now: - "vi" node which might have 6 ports/endpoints - in TPG mode, "vi" node don't need to define any ports/endpoints - ports/endpoints defines the link between VI and external sensors. Signed-off-by: Bryan Wu --- arch/arm64/boot/dts/nvidia/tegra210-

[PATCH 3/3] Documentation: DT bindings: add VI and CSI bindings

2015-09-15 Thread Bryan Wu
Signed-off-by: Bryan Wu --- .../bindings/gpu/nvidia,tegra20-host1x.txt | 211 - 1 file changed, 205 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1

[PATCH 1/3] [media] v4l: tegra: Add NVIDIA Tegra VI driver

2015-09-15 Thread Bryan Wu
NVIDIA Tegra processor contains a powerful Video Input (VI) hardware controller which can support up to 6 MIPI CSI camera sensors. This patch adds a V4L2 media controller and capture driver to support Tegra VI hardware. It's verified with Tegra built-in test pattern generator. Signed-off-by: Brya

[PATCH 0/3 RFC v2] media: platform: add NVIDIA Tegra VI driver

2015-09-15 Thread Bryan Wu
This patchset add and enable V4L2 driver for latest NVIDIA Tegra Video Input hardware controller. It's based on the staging/work branch of Thierry Reding Tegra upstream kernel github repo, which is based on 4.2-rc1. (https://github.com/thierryreding/linux/tree/staging/work) v2: - allocate kthr

Re: [Y2038] [PATCH 1/7] [media] dvb: use ktime_t for internal timeout

2015-09-15 Thread Arnd Bergmann
On Tuesday 15 September 2015 19:55:35 Andreas Oberritter wrote: > > /* show speed every SPEED_PKTS_INTERVAL packets */ > > if (!(demux->speed_pkts_cnt % SPEED_PKTS_INTERVAL)) { > > - cur_time = current_kernel_time(); > > + cur_time = ktim

Re: [Y2038] [PATCH 7/7] [RFC] [media] introduce v4l2_timespec type for timestamps

2015-09-15 Thread Arnd Bergmann
On Tuesday 15 September 2015 18:32:36 Hans Verkuil wrote: > > > > - ktime_get_ts(×tamp); > > + ktime_get_ts64(×tamp); > > + vts.tv_sec = timestamp.tv_sec; > > + vts.tv_nsec = timestamp.tv_nsec; > > I prefer to take this opportunity to create a v4l2_get_timespec helper > function,

Re: [PATCH 6/7] [RFC] [media]: v4l2: introduce v4l2_timeval

2015-09-15 Thread Arnd Bergmann
On Tuesday 15 September 2015 18:27:19 Hans Verkuil wrote: > On 09/15/2015 05:49 PM, Arnd Bergmann wrote: > > The v4l2 API uses a 'struct timeval' to communicate time stamps to user > > space. This is broken on 32-bit architectures as soon as we have a C library > > that defines time_t as 64 bit, wh

Re: [PATCH 1/7] [media] dvb: use ktime_t for internal timeout

2015-09-15 Thread Andreas Oberritter
Hello Arnd, On 15.09.2015 17:49, Arnd Bergmann wrote: > The dvb demuxer code uses a 'struct timespec' to pass a timeout > as absolute time. This will cause problems on 32-bit architectures > in 2038 when time_t overflows, and it is racy with a concurrent > settimeofday() call. > > This patch chan

randconfig build errors with next-20150915, in drivers/media/i2c

2015-09-15 Thread Jim Davis
Building with the attached random configuration file, warning: (VIDEO_COBALT) selects VIDEO_ADV7511 which has unmet direct dependencies (MEDIA_SUPPORT && VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API) warning: (VIDEO_COBALT) selects VIDEO_ADV7604 which has unmet direct dependencies (MEDIA_SUPPORT &&

Re: [PATCH 7/7] [RFC] [media] introduce v4l2_timespec type for timestamps

2015-09-15 Thread Hans Verkuil
On 09/15/2015 05:49 PM, Arnd Bergmann wrote: > The v4l2 event queue uses a 'struct timespec' to pass monotonic > timestamps. This is not a problem by itself, but it breaks when user > space redefines timespec to use 'long long' on 32-bit systems. > > To avoid that problem, we define our own replac

Re: [PATCH 6/7] [RFC] [media]: v4l2: introduce v4l2_timeval

2015-09-15 Thread Hans Verkuil
On 09/15/2015 05:49 PM, Arnd Bergmann wrote: > The v4l2 API uses a 'struct timeval' to communicate time stamps to user > space. This is broken on 32-bit architectures as soon as we have a C library > that defines time_t as 64 bit, which then changes the structure layout of > struct v4l2_buffer. >

[PATCH 0/7] [media] y2038 conversion for subsystem

2015-09-15 Thread Arnd Bergmann
Hi everyone, This is a conversion of all subsystem-wide v4l2 code to avoid the use of types based on time_t. The first five patches should all be harmless and obvious, so they can get applied for 4.3 after normal review. The last two patches are marked RFC for now because their possible impact on

[PATCH 1/7] [media] dvb: use ktime_t for internal timeout

2015-09-15 Thread Arnd Bergmann
The dvb demuxer code uses a 'struct timespec' to pass a timeout as absolute time. This will cause problems on 32-bit architectures in 2038 when time_t overflows, and it is racy with a concurrent settimeofday() call. This patch changes the code to use ktime_get() instead, using the monotonic time b

[PATCH 5/7] [media] use v4l2_get_timestamp where possible

2015-09-15 Thread Arnd Bergmann
This is a preparation for a change to the type of v4l2 timestamps. v4l2_get_timestamp() is a helper function that reads the monotonic time and stores it into a 'struct timeval'. Multiple drivers implement the same thing themselves for historic reasons. Changing them all to use v4l2_get_timestamp()

[PATCH 7/7] [RFC] [media] introduce v4l2_timespec type for timestamps

2015-09-15 Thread Arnd Bergmann
The v4l2 event queue uses a 'struct timespec' to pass monotonic timestamps. This is not a problem by itself, but it breaks when user space redefines timespec to use 'long long' on 32-bit systems. To avoid that problem, we define our own replacement for timespec here, using 'long' tv_sec and tv_nse

[PATCH 6/7] [RFC] [media]: v4l2: introduce v4l2_timeval

2015-09-15 Thread Arnd Bergmann
The v4l2 API uses a 'struct timeval' to communicate time stamps to user space. This is broken on 32-bit architectures as soon as we have a C library that defines time_t as 64 bit, which then changes the structure layout of struct v4l2_buffer. Fortunately, almost all v4l2 drivers use monotonic time

[PATCH 2/7] [media] dvb: remove unused systime() function

2015-09-15 Thread Arnd Bergmann
The systime function uses struct timespec, which we want to stop using in the kernel because it overflows in 2038. Fortunately, this use in dibx000_common is in a function that is never called, so we can just remove it. Signed-off-by: Arnd Bergmann --- drivers/media/dvb-frontends/dibx000_common.

[PATCH 3/7] [media] dvb: don't use 'time_t' in event ioctl

2015-09-15 Thread Arnd Bergmann
'struct video_event' is used for the VIDEO_GET_EVENT ioctl, implemented by drivers/media/pci/ivtv/ivtv-ioctl.c and drivers/media/pci/ttpci/av7110_av.c. The structure contains a 'time_t', which will be redefined in the future to be 64-bit wide, causing an incompatible ABI change for this ioctl. As

[PATCH 4/7] [media] exynos4-is: use monotonic timestamps as advertized

2015-09-15 Thread Arnd Bergmann
The exynos4 fimc capture driver claims to use monotonic timestamps but calls ktime_get_real_ts(). This is both an incorrect API use, and a bad idea because of the y2038 problem and the fact that the wall clock time is not reliable for timestamps across suspend or settimeofday(). This changes the d

Re: Terratec H7 Rev. 4 is DVBSky

2015-09-15 Thread Olli Salonen
Hi Erik, Your patch looks good to my eyes. I heard already earlier that the new H7 is the same as the DVBSky receiver and your experience seems to confirm that. Could you resend the patch again with a proper title and a signed-off line to the mailing list? https://www.kernel.org/doc/Documentation/

[PATCH] media: fix kernel-doc warnings in v4l2-dv-timings.h

2015-09-15 Thread Geliang Tang
Fix the following 'make htmldocs' warnings: .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'frame_height' .//include/media/v4l2-dv-timings.h:147: warning: No description found for parameter 'hfreq' .//include/media/v4l2-dv-timings.h:147: warning: No des

[PATCH] [media] c8sectpfe: fix ininitialized error return on firmware load failure

2015-09-15 Thread Colin King
From: Colin Ian King static analysis with cppcheck detected the following error: [drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1210]: (error) Uninitialized variable: ret ret is never initialised, so garbage is being returned. Instead return the error return from the call of request_f

Re: [PATCH v4 2/2] [media] media-device: split media initialization and registration

2015-09-15 Thread Sakari Ailus
Hi Javier, Javier Martinez Canillas wrote: > 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

[PATCH v4 2/2] [media] media-device: split media initialization and registration

2015-09-15 Thread 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 cond

[PATCH v4 1/2] [media] media-device: check before unregister if mdev was registered

2015-09-15 Thread Javier Martinez Canillas
Most media functions that unregister, check if the corresponding register function succeed before. So these functions can safely be called even if a registration was never made or the component as already been unregistered. Add the same check to media_device_unregister() function for consistency.

[PATCH v4 0/2] [media] Fix race between graph enumeration and entities registration

2015-09-15 Thread Javier Martinez Canillas
Hello, The Media Controller framework has an issue in which the media device node is registered before all the media entities and pads links are created so if user-space tries to enumerate the graph too early, it may get a partial graph since not everything has been registered yet. This series fi

Re: [RFC RESEND 05/11] v4l2-core: Don't sync cache for a buffer if so requested

2015-09-15 Thread Hans Verkuil
On 09/15/15 10:22, Sakari Ailus wrote: > Could you rebase and re-post what's not in upstream of that set, please? Done. Available here: http://git.linuxtv.org/cgit.cgi/hverkuil/media_tree.git/log/?h=vb2-cpu-access These drivers need work to replace vb2_plane_vaddr by vb2_plane_begin/end_cpu_acce

[PATCH v3 1/2] [media] media-device: check before unregister if mdev was registered

2015-09-15 Thread Javier Martinez Canillas
Most media functions that unregister, check if the corresponding register function succeed before. So these functions can safely be called even if a registration was never made or the component as already been unregistered. Add the same check to media_device_unregister() function for consistency.

[PATCH v3 2/2] [media] media-device: split media initialization and registration

2015-09-15 Thread 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 cond

[PATCH v3 0/2] [media] Fix race between graph enumeration and entities registration

2015-09-15 Thread Javier Martinez Canillas
Hello, The Media Controller framework has an issue in which the media device node is registered before all the media entities and pads links are created so if user-space tries to enumerate the graph too early, it may get a partial graph since not everything has been registered yet. This series fi

Re: [RFC RESEND 07/11] vb2: dma-contig: Remove redundant sgt_base field

2015-09-15 Thread Sakari Ailus
Hi Hans, Hans Verkuil wrote: > On 09/11/2015 01:50 PM, Sakari Ailus wrote: >> The struct vb2_dc_buf contains two struct sg_table fields: sgt_base and >> dma_sgt. The former is used by DMA-BUF buffers whereas the latter is used >> by USERPTR. >> >> Unify the two, leaving dma_sgt. >> >> MMAP buffers

Re: [RFC RESEND 05/11] v4l2-core: Don't sync cache for a buffer if so requested

2015-09-15 Thread Sakari Ailus
Hi Hans, Hans Verkuil wrote: > On 09/11/2015 01:50 PM, Sakari Ailus wrote: >> From: Samu Onkalo >> >> The user may request to the driver (vb2) to skip the cache maintenance >> operations in case the buffer does not need cache synchronisation, e.g. in >> cases where the buffer is passed between ha

Re: [RFC RESEND 03/11] vb2: Move cache synchronisation from buffer done to dqbuf handler

2015-09-15 Thread Sakari Ailus
Hi Hans, Thank you for the review! Hans Verkuil wrote: > On 09/11/2015 01:50 PM, Sakari Ailus wrote: >> The cache synchronisation may be a time consuming operation and thus not >> best performed in an interrupt which is a typical context for >> vb2_buffer_done() calls. This may consume up to tens