Re: v4l2: circular locking between mmap_sem and device mutex
On 05/23/2014 04:53 AM, Sasha Levin wrote: ping? I've reproduced it and plan to look at it soon. Regards, Hans On 05/05/2014 11:49 AM, Sasha Levin wrote: Hi all, While fuzzing with trinity inside a KVM tools guest running latest -next kernel I've stumbled on the following: [ 2179.111265] == [ 2179.112228] [ INFO: possible circular locking dependency detected ] [ 2179.113144] 3.15.0-rc3-next-20140502-sasha-00020-g3183c20 #432 Tainted: G W [ 2179.114325] --- [ 2179.115286] trinity-c15/27050 is trying to acquire lock: [ 2179.116071] (dev-mutex#3){+.+.+.}, at: vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.117347] [ 2179.117347] but task is already holding lock: [ 2179.118185] (mm-mmap_sem){++}, at: vm_mmap_pgoff (mm/util.c:398) [ 2179.120023] [ 2179.120023] which lock already depends on the new lock. [ 2179.120023] [ 2179.120036] [ 2179.120036] the existing dependency chain (in reverse order) is: [ 2179.120036] - #1 (mm-mmap_sem){++}: [ 2179.120036] lock_acquire (arch/x86/include/asm/current.h:14 kernel/locking/lockdep.c:3602) [ 2179.120036] might_fault (mm/memory.c:4368) [ 2179.120036] video_usercopy (arch/x86/include/asm/uaccess.h:713 drivers/media/v4l2-core/v4l2-ioctl.c:2369) [ 2179.120036] video_ioctl2 (drivers/media/v4l2-core/v4l2-ioctl.c:2445) [ 2179.120036] v4l2_ioctl (drivers/media/v4l2-core/v4l2-dev.c:355) [ 2179.120036] do_vfs_ioctl (fs/ioctl.c:44 fs/ioctl.c:598) [ 2179.120036] SyS_ioctl (include/linux/file.h:38 fs/ioctl.c:614 fs/ioctl.c:604) [ 2179.120036] tracesys (arch/x86/kernel/entry_64.S:746) [ 2179.120036] - #0 (dev-mutex#3){+.+.+.}: [ 2179.120036] __lock_acquire (kernel/locking/lockdep.c:1840 kernel/locking/lockdep.c:1945 kernel/locking/lockdep.c:2131 kernel/locking/lockdep.c:3182) [ 2179.120036] lock_acquire (arch/x86/include/asm/current.h:14 kernel/locking/lockdep.c:3602) [ 2179.120036] mutex_lock_interruptible_nested (kernel/locking/mutex.c:486 kernel/locking/mutex.c:616) [ 2179.120036] vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.120036] v4l2_mmap (drivers/media/v4l2-core/v4l2-dev.c:427) [ 2179.120036] mmap_region (mm/mmap.c:1577) [ 2179.120036] do_mmap_pgoff (mm/mmap.c:1369) [ 2179.120036] vm_mmap_pgoff (mm/util.c:400) [ 2179.120036] SyS_mmap_pgoff (mm/mmap.c:1418 mm/mmap.c:1378) [ 2179.120036] SyS_mmap (arch/x86/kernel/sys_x86_64.c:72) [ 2179.120036] tracesys (arch/x86/kernel/entry_64.S:746) [ 2179.120036] [ 2179.120036] other info that might help us debug this: [ 2179.120036] [ 2179.120036] Possible unsafe locking scenario: [ 2179.120036] [ 2179.120036]CPU0CPU1 [ 2179.120036] [ 2179.120036] lock(mm-mmap_sem); [ 2179.120036]lock(dev-mutex#3); [ 2179.120036]lock(mm-mmap_sem); [ 2179.120036] lock(dev-mutex#3); [ 2179.120036] [ 2179.120036] *** DEADLOCK *** [ 2179.120036] [ 2179.120036] 1 lock held by trinity-c15/27050: [ 2179.120036] #0: (mm-mmap_sem){++}, at: vm_mmap_pgoff (mm/util.c:398) [ 2179.120036] [ 2179.120036] stack backtrace: [ 2179.120036] CPU: 1 PID: 27050 Comm: trinity-c15 Tainted: GW 3.15.0-rc3-next-20140502-sasha-00020-g3183c20 #432 [ 2179.120036] baa718e0 88065df9dab8 b75326bb 0002 [ 2179.120036] baa718e0 88065df9db08 b7525488 0001 [ 2179.120036] 88065df9db98 88065df9db08 88065dd63cf0 88065dd63d28 [ 2179.120036] Call Trace: [ 2179.120036] dump_stack (lib/dump_stack.c:52) [ 2179.120036] print_circular_bug (kernel/locking/lockdep.c:1216) [ 2179.120036] __lock_acquire (kernel/locking/lockdep.c:1840 kernel/locking/lockdep.c:1945 kernel/locking/lockdep.c:2131 kernel/locking/lockdep.c:3182) [ 2179.120036] ? mmap_region (mm/mmap.c:1556) [ 2179.120036] lock_acquire (arch/x86/include/asm/current.h:14 kernel/locking/lockdep.c:3602) [ 2179.120036] ? vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.120036] mutex_lock_interruptible_nested (kernel/locking/mutex.c:486 kernel/locking/mutex.c:616) [ 2179.120036] ? vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.120036] ? vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.120036] ? get_parent_ip (kernel/sched/core.c:2485) [ 2179.120036] vb2_fop_mmap (drivers/media/v4l2-core/videobuf2-core.c:3029 (discriminator 1)) [ 2179.120036] ? mmap_region (mm/mmap.c:1556) [ 2179.120036] ? mmap_region (mm/mmap.c:1556) [ 2179.120036] v4l2_mmap (drivers/media/v4l2-core/v4l2-dev.c:427) [ 2179.120036] mmap_region (mm/mmap.c:1577) [ 2179.120036] do_mmap_pgoff (mm/mmap.c:1369) [
Re: V4L2 control API - choosing base CID for private controls
On 05/22/2014 01:33 PM, Krzysztof Czarnowski wrote: Hi, I got completely confused while trying to create private controls with control API and when I finally got down to sanity checks in v4l2_ctrl_new() in v4l2-ctrls.c... It would be nice if the following explanation by Hans (archive msg69922) or maybe some more elaborate version could somehow make its way to Documentation/video4linux/v4l2-controls.txt :-) Yeah, I need to improve that. But basically you add a 'driver base' to include/uapi/linux/v4l2-controls.h (see e.g. V4L2_CID_USER_SAA7134_BASE) where you reserve a range of private controls for your driver and you use that base to define your controls. See drivers/media/pci/saa7134/saa7134.h how that's done for the saa7134. You probably tried to use V4L2_CID_PRIVATE_BASE which is not allowed in combination with the control framework. The control framework will emulate V4L2_CID_PRIVATE_BASE internally so old applications still work, but it's not how they should be defined in the drivers. Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue
On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote: Fixed the ERROR thrown off by checkpatch.pl. Put the error message here, or say what it was. Signed-off-by: Chaitanya Hazarey c...@24.io Could you change your email client so it has your last in the From: header? This patch doesn't apply. Read this: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] mt9v032: fix hblank calculation
Since (min_row_time - crop-width) can be negative, we have to do a signed comparison here. Otherwise max_t casts the negative value to unsigned int and sets min_hblank to that invalid value. Signed-off-by: Philipp Zabel p.za...@pengutronix.de --- drivers/media/i2c/mt9v032.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c index 40172b8..4d7afad 100644 --- a/drivers/media/i2c/mt9v032.c +++ b/drivers/media/i2c/mt9v032.c @@ -305,7 +305,7 @@ mt9v032_update_hblank(struct mt9v032 *mt9v032) if (mt9v032-version-version == MT9V034_CHIP_ID_REV1) min_hblank += (mt9v032-hratio - 1) * 10; - min_hblank = max_t(unsigned int, (int)mt9v032-model-data-min_row_time - crop-width, + min_hblank = max_t(int, (int)mt9v032-model-data-min_row_time - crop-width, (int)min_hblank); hblank = max_t(unsigned int, mt9v032-hblank, min_hblank); -- 2.0.0.rc0 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 00/49] DaVinci: vpif: upgrade with v4l helpers and v4l compliance fixes
Hi Prabhakar, Thanks for this patch series, it looks good to me and I'll make a pull request for this. I did find a few issues, but they are all pre-existing problems, so they can be fixed in follow-up patches. I'll comment on those in the relevant patches. Since display and capture are so similar I will only comment on the display patches, but it's valid for both. Regards, Hans On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com Hi, This patch series upgrades the vpif capture display driver with the all the helpers provided by v4l, this makes the driver much simpler and cleaner. This also includes few checkpatch issues. Changes for v2: a Added a copyright. b Dropped buf_init() callback from vb2_ops. c Fixed enabling disabling of interrupts in case of HD formats. Changes for v3: a Fixed review comments pointed by Hans. Changes for v4: Rebased the patches on media tree. Changes for v5: Split up the patches Following is the output of v4l-compliance for capture: -- ./v4l2-compliance -d /dev/video0 -i 0 -s -v --expbuf-device=2 Driver Info: Driver name : vpif_capture Card type : DA850/OMAP-L138 Video Capture Bus info : platform:vpif_capture Driver version: 3.15.0 Capabilities : 0x8401 Video Capture Streaming Device Capabilities Device Caps : 0x0401 Video Capture Streaming Compliance test for device /dev/video0 (not using libv4l2): Required ioctls: test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second video open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 1 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Test input 0: Control ioctls: test VIDIOC_QUERYCTRL/MENU: OK (Not Supported) test VIDIOC_G/S_CTRL: OK (Not Supported) test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0 Format ioctls: info: found 1 formats for buftype 1 test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK fail: v4l2-test-formats.cpp(1003): cap-readbuffers test VIDIOC_G/S_PARM: FAIL test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: info: test buftype Video Capture test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test read/write: OK (Not Supported) Video Capture: Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.509130s Buffer: 1 Sequence: 0 Field: Interlaced Timestamp: 145.549125s Buffer: 2 Sequence: 0 Field: Interlaced Timestamp: 145.589148s Buffer: 3 Sequence: 0 Field: Interlaced Timestamp: 145.629106s Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.669110s Buffer: 1 Sequence: 0 Field: Interlaced Timestamp: 145.709102s Buffer: 2 Sequence: 0 Field: Interlaced Timestamp: 145.749099s Buffer: 3 Sequence: 0 Field: Interlaced Timestamp: 145.789128s Buffer: 0 Sequence: 0 Field: Interlaced
Re: [PATCH v5 04/49] media: davinci: vpif_display: release buffers in case start_streaming() call back fails
On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com this patch adds support to release the buffer by calling vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED if start_streaming() call back fails. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com --- drivers/media/platform/davinci/vpif_display.c | 42 +++-- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 8bb9f02..1a17a45 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -196,26 +196,16 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) struct channel_obj *ch = vb2_get_drv_priv(vq); struct common_obj *common = ch-common[VPIF_VIDEO_INDEX]; struct vpif_params *vpif = ch-vpifparams; - unsigned long addr = 0; - unsigned long flags; + struct vpif_disp_buffer *buf, *tmp; + unsigned long addr, flags; int ret; spin_lock_irqsave(common-irqlock, flags); - /* Get the next frame from the buffer queue */ - common-next_frm = common-cur_frm = - list_entry(common-dma_queue.next, -struct vpif_disp_buffer, list); - - list_del(common-cur_frm-list); - spin_unlock_irqrestore(common-irqlock, flags); - /* Mark state of the current frame to active */ - common-cur_frm-vb.state = VB2_BUF_STATE_ACTIVE; - /* Initialize field_id and started member */ ch-field_id = 0; common-started = 1; - addr = vb2_dma_contig_plane_dma_addr(common-cur_frm-vb, 0); + /* Calculate the offset for Y and C data in the buffer */ vpif_calculate_offsets(ch); @@ -225,7 +215,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) || (!ch-vpifparams.std_info.frm_fmt (common-fmt.fmt.pix.field == V4L2_FIELD_NONE))) { vpif_err(conflict in field format and std format\n); - return -EINVAL; + ret = -EINVAL; + goto err; } /* clock settings */ @@ -234,17 +225,28 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ycmux_mode, ch-vpifparams.std_info.hd_sd); if (ret 0) { vpif_err(can't set clock\n); - return ret; + goto err; } } /* set the parameters and addresses */ ret = vpif_set_video_params(vpif, ch-channel_id + 2); if (ret 0) - return ret; + goto err; common-started = ret; vpif_config_addr(ch, ret); + /* Get the next frame from the buffer queue */ + common-next_frm = common-cur_frm = + list_entry(common-dma_queue.next, +struct vpif_disp_buffer, list); + + list_del(common-cur_frm-list); + spin_unlock_irqrestore(common-irqlock, flags); + /* Mark state of the current frame to active */ + common-cur_frm-vb.state = VB2_BUF_STATE_ACTIVE; There is no need to set this, all buffers queued to the driver are always in state ACTIVE. The vb2 core sets that for you. In general drivers never need to change the state manually. It happens twice in this driver and in both cases the assignment can be removed. Regards, Hans + + addr = vb2_dma_contig_plane_dma_addr(common-cur_frm-vb, 0); common-set_addr((addr + common-ytop_off), (addr + common-ybtm_off), (addr + common-ctop_off), @@ -271,6 +273,14 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) } return 0; + +err: + list_for_each_entry_safe(buf, tmp, common-dma_queue, list) { + list_del(buf-list); + vb2_buffer_done(buf-vb, VB2_BUF_STATE_QUEUED); + } + + return ret; } /* abort streaming and wait for last buffer */ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 21/49] media: davinci: vpif_display: use SIMPLE_DEV_PM_OPS
On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com this patch uses SIMPLE_DEV_PM_OPS, and drops unneeded members from io_usrs, usrs and makes use of vb2 helepers instead. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com --- drivers/media/platform/davinci/vpif_display.c | 64 - drivers/media/platform/davinci/vpif_display.h |4 -- 2 files changed, 30 insertions(+), 38 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 401d03a..81d955a 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -1124,10 +1124,8 @@ static int vpif_probe_complete(void) for (j = 0; j VPIF_DISPLAY_MAX_DEVICES; j++) { ch = vpif_obj.dev[j]; /* Initialize field of the channel objects */ - atomic_set(ch-usrs, 0); for (k = 0; k VPIF_NUMOBJECTS; k++) { common = ch-common[k]; - common-io_usrs = 0; spin_lock_init(common-irqlock); mutex_init(common-lock); common-set_addr = NULL; @@ -1371,7 +1369,7 @@ static int vpif_remove(struct platform_device *device) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int vpif_suspend(struct device *dev) { struct common_obj *common; @@ -1382,18 +1380,20 @@ static int vpif_suspend(struct device *dev) /* Get the pointer to the channel object */ ch = vpif_obj.dev[i]; common = ch-common[VPIF_VIDEO_INDEX]; + + if (!vb2_is_streaming(common-buffer_queue)) + continue; The use of vb2_is_streaming here is not correct. It is possible to call STREAMON without having any buffers queued. So vb2_is_streaming() can return true without start_streaming() having been called. Only after at least one buffer has been queued will start_streaming be called. So this code will fail if you call STREAMON without any buffers queued and then suspend and resume. The resume callback will start the DMA without having proper DMA pointers set up. Probably not a good idea. The fix is to check the vb2_queue-start_streaming_called flag. I think we need a vb2_start_streaming_called() inline function as that's a bit cleaner than checking that flag directly. Regards, Hans + mutex_lock(common-lock); - if (atomic_read(ch-usrs) common-io_usrs) { - /* Disable channel */ - if (ch-channel_id == VPIF_CHANNEL2_VIDEO) { - enable_channel2(0); - channel2_intr_enable(0); - } - if (ch-channel_id == VPIF_CHANNEL3_VIDEO || - ycmux_mode == 2) { - enable_channel3(0); - channel3_intr_enable(0); - } + /* Disable channel */ + if (ch-channel_id == VPIF_CHANNEL2_VIDEO) { + enable_channel2(0); + channel2_intr_enable(0); + } + if (ch-channel_id == VPIF_CHANNEL3_VIDEO || + ycmux_mode == 2) { + enable_channel3(0); + channel3_intr_enable(0); } mutex_unlock(common-lock); } @@ -1412,18 +1412,20 @@ static int vpif_resume(struct device *dev) /* Get the pointer to the channel object */ ch = vpif_obj.dev[i]; common = ch-common[VPIF_VIDEO_INDEX]; + + if (!vb2_is_streaming(common-buffer_queue)) + continue; + mutex_lock(common-lock); - if (atomic_read(ch-usrs) common-io_usrs) { - /* Enable channel */ - if (ch-channel_id == VPIF_CHANNEL2_VIDEO) { - enable_channel2(1); - channel2_intr_enable(1); - } - if (ch-channel_id == VPIF_CHANNEL3_VIDEO || - ycmux_mode == 2) { - enable_channel3(1); - channel3_intr_enable(1); - } + /* Enable channel */ + if (ch-channel_id == VPIF_CHANNEL2_VIDEO) { + enable_channel2(1); + channel2_intr_enable(1); + } + if (ch-channel_id == VPIF_CHANNEL3_VIDEO || + ycmux_mode == 2) { + enable_channel3(1); + channel3_intr_enable(1); } mutex_unlock(common-lock); } @@ -1431,21 +1433,15 @@ static int
[PATCH] [media] V4L2: soc_camera: add run-time dependencies to R-Car VIN driver
The R-Car Video Input driver is only useful on shmobile unless build testing. Signed-off-by: Jean Delvare jdelv...@suse.de Cc: Vladimir Barinov vladimir.bari...@cogentembedded.com Cc: Sergei Shtylyov sergei.shtyl...@cogentembedded.com Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/platform/soc_camera/Kconfig |1 + 1 file changed, 1 insertion(+) --- linux-3.15-rc6.orig/drivers/media/platform/soc_camera/Kconfig 2014-05-23 10:35:06.650728184 +0200 +++ linux-3.15-rc6/drivers/media/platform/soc_camera/Kconfig2014-05-23 10:36:36.373633190 +0200 @@ -47,6 +47,7 @@ config VIDEO_PXA27x config VIDEO_RCAR_VIN tristate R-Car Video Input (VIN) support depends on VIDEO_DEV SOC_CAMERA + depends on ARCH_SHMOBILE || COMPILE_TEST select VIDEOBUF2_DMA_CONTIG select SOC_CAMERA_SCALE_CROP ---help--- -- Jean Delvare SUSE L3 Support -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 00/49] DaVinci: vpif: upgrade with v4l helpers and v4l compliance fixes
On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com Hi, This patch series upgrades the vpif capture display driver with the all the helpers provided by v4l, this makes the driver much simpler and cleaner. This also includes few checkpatch issues. Changes for v2: a Added a copyright. b Dropped buf_init() callback from vb2_ops. c Fixed enabling disabling of interrupts in case of HD formats. Changes for v3: a Fixed review comments pointed by Hans. Changes for v4: Rebased the patches on media tree. Changes for v5: Split up the patches Following is the output of v4l-compliance for capture: -- ./v4l2-compliance -d /dev/video0 -i 0 -s -v --expbuf-device=2 Driver Info: Driver name : vpif_capture Card type : DA850/OMAP-L138 Video Capture Bus info : platform:vpif_capture Driver version: 3.15.0 Capabilities : 0x8401 Video Capture Streaming Device Capabilities Device Caps : 0x0401 Video Capture Streaming Compliance test for device /dev/video0 (not using libv4l2): Required ioctls: test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second video open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 1 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Test input 0: Control ioctls: test VIDIOC_QUERYCTRL/MENU: OK (Not Supported) test VIDIOC_G/S_CTRL: OK (Not Supported) test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0 Format ioctls: info: found 1 formats for buftype 1 test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK fail: v4l2-test-formats.cpp(1003): cap-readbuffers Just set readbuffers to 3, which is what queue_setup uses as well as the minimum number of buffers. test VIDIOC_G/S_PARM: FAIL test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: info: test buftype Video Capture test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test read/write: OK (Not Supported) Video Capture: Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.509130s This is strange: the sequence number is not updated for each field, but why doesn't v4l2-compliance fail on that? If I hack vivi to always return sequence 0 the compliance tool immediately fails on that. Can you find out why v4l2-compliance doesn't fail here? The check happens in v4l2-test-buffers.cpp, line 321. Buffer: 1 Sequence: 0 Field: Interlaced Timestamp: 145.549125s Buffer: 2 Sequence: 0 Field: Interlaced Timestamp: 145.589148s Buffer: 3 Sequence: 0 Field: Interlaced Timestamp: 145.629106s Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.669110s Buffer: 1 Sequence: 0 Field: Interlaced Timestamp: 145.709102s Buffer: 2 Sequence: 0 Field: Interlaced Timestamp: 145.749099s Buffer: 3 Sequence: 0 Field: Interlaced Timestamp: 145.789128s Buffer: 0 Sequence: 0
[GIT PULL FOR v3.16] davinci updates
Hi Mauro, These are cleanup patches for the davinci drivers. A total of about 1200 lines of code are removed. Not bad! Regards, Hans The following changes since commit e899966f626f1f657a4a7bac736c0b9ae5a243ea: Merge tag 'v3.15-rc6' into patchwork (2014-05-21 23:03:15 -0300) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git davinci for you to fetch changes up to c1022cd59bb34dbb435cda9a2fc98bb6fb931f61: media: davinci: vpif: add Copyright message (2014-05-23 10:12:34 +0200) Lad, Prabhakar (49): media: davinci: vpif_display: initialize vb2 queue and DMA context during probe media: davinci: vpif_display: drop buf_init() callback media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions media: davinci: vpif_display: release buffers in case start_streaming() call back fails media: davinci: vpif_display: drop buf_cleanup() callback media: davinci: vpif_display: improve vpif_buffer_prepare() callback media: davinci: vpif_display: improve vpif_buffer_queue_setup() function media: davinci: vpif_display: improve start/stop_streaming callbacks media: davinci: vpif_display: use vb2_fop_mmap/poll media: davinci: vpif_display: use v4l2_fh_open and vb2_fop_release media: davinci: vpif_display: use vb2_ioctl_* helpers media: davinci: vpif_display: drop unused member fbuffers media: davinci: vpif_display: drop reserving memory for device media: davinci: vpif_display: drop unnecessary field memory media: davinci: vpif_display: drop numbuffers field from common_obj media: davinic: vpif_display: drop started member from struct common_obj media: davinci: vpif_display: initialize the video device in single place media: davinci: vpif_display: drop unneeded module params media: davinci: vpif_display: drop cropcap media: davinci: vpif_display: group v4l2_ioctl_ops media: davinci: vpif_display: use SIMPLE_DEV_PM_OPS media: davinci: vpif_display: return -ENODATA for *dv_timings calls media: davinci: vpif_display: return -ENODATA for *std calls media: davinci; vpif_display: fix checkpatch error media: davinci: vpif_display: fix v4l-complinace issues media: davinci: vpif_capture: initalize vb2 queue and DMA context during probe media: davinci: vpif_capture: drop buf_init() callback media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper functions media: davinci: vpif_capture: release buffers in case start_streaming() call back fails media: davinci: vpif_capture: drop buf_cleanup() callback media: davinci: vpif_capture: improve vpif_buffer_prepare() callback media: davinci: vpif_capture: improve vpif_buffer_queue_setup() function media: davinci: vpif_capture: improve start/stop_streaming callbacks media: davinci: vpif_capture: use vb2_fop_mmap/poll media: davinci: vpif_capture: use v4l2_fh_open and vb2_fop_release media: davinci: vpif_capture: use vb2_ioctl_* helpers media: davinci: vpif_capture: drop reserving memory for device media: davinci: vpif_capture: drop unnecessary field memory media: davinic: vpif_capture: drop started member from struct common_obj media: davinci: vpif_capture: initialize the video device in single place media: davinci: vpif_capture: drop unneeded module params media: davinci: vpif_capture: drop cropcap media: davinci: vpif_capture: group v4l2_ioctl_ops media: davinci: vpif_capture: use SIMPLE_DEV_PM_OPS media: davinci: vpif_capture: return -ENODATA for *dv_timings calls media: davinci: vpif_capture: return -ENODATA for *std calls media: davinci: vpif_capture: drop check __KERNEL__ media: davinci: vpif_capture: fix v4l-complinace issues media: davinci: vpif: add Copyright message drivers/media/platform/davinci/vpif_capture.c | 1420 + drivers/media/platform/davinci/vpif_capture.h | 39 --- drivers/media/platform/davinci/vpif_display.c | 1196 +++-- drivers/media/platform/davinci/vpif_display.h | 44 +-- 4 files changed, 746 insertions(+), 1953 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/1] v4l: Check pad arguments for [gs]_frame_interval
Hi Sakari, Thank you for the patch. On Monday 31 March 2014 11:23:08 Sakari Ailus wrote: VIDIOC_SUBDEV_[GS]_FRAME_INTERVAL IOCTLs argument structs contain the pad field but the validity check was missing. There should be no implications security-wise from this since no driver currently uses the pad field in the struct. Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/v4l2-core/v4l2-subdev.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index aea84ac..0ed4c5b 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -305,11 +305,23 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) fse); } - case VIDIOC_SUBDEV_G_FRAME_INTERVAL: + case VIDIOC_SUBDEV_G_FRAME_INTERVAL: { + struct v4l2_subdev_frame_interval *fi = arg; + + if (fi-pad = sd-entity.num_pads) + return -EINVAL; + return v4l2_subdev_call(sd, video, g_frame_interval, arg); + } + + case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { + struct v4l2_subdev_frame_interval *fi = arg; + + if (fi-pad = sd-entity.num_pads) + return -EINVAL; - case VIDIOC_SUBDEV_S_FRAME_INTERVAL: return v4l2_subdev_call(sd, video, s_frame_interval, arg); + } case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: { struct v4l2_subdev_frame_interval_enum *fie = arg; -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/1] v4l: Check pad arguments for [gs]_frame_interval
Laurent Pinchart wrote: Hi Sakari, Thank you for the patch. On Monday 31 March 2014 11:23:08 Sakari Ailus wrote: VIDIOC_SUBDEV_[GS]_FRAME_INTERVAL IOCTLs argument structs contain the pad field but the validity check was missing. There should be no implications security-wise from this since no driver currently uses the pad field in the struct. Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Mauro has already pulled the set which this patch was a part of. Good that no problems were found. Thanks. :-) -- Sakari Ailus sakari.ai...@linux.intel.com -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] media: stk1160: Avoid stack-allocated buffer for control URBs
On 05/17/2014 02:21 PM, Ezequiel Garcia wrote: Hi Hans, On 09 May 12:34 PM, Hans Verkuil wrote: On 04/17/2014 02:28 PM, Ezequiel Garcia wrote: Currently stk1160_read_reg() uses a stack-allocated char to get the read control value. This is wrong because usb_control_msg() requires a kmalloc-ed buffer. This commit fixes such issue by kmalloc'ating a 1-byte buffer to receive the read value. While here, let's remove the urb_buf array which was meant for a similar purpose, but never really used. Rather than allocating and freeing a buffer for every read_reg I would allocate this buffer in the probe function. That way this allocation is done only once. Hm... sorry for being so stubborn, but I've just noticed that having a shared buffer would require adding a spinlock to protect it, where the current proposal doesn't need it. Do you still think that's the right thing to do? I'm still not entirely happy, but I've decided to accept it. It's a bug and it needs to be fixed. Adding a mutex to protect the datastructure adds only more complexity and it not really worth the effort. Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL FOR v3.16] Various fixes
Hi Mauro, For the most part these are assorted fixes. The exception is the patch from Arun that adds a new V4L2 event type. The addition of that event is long overdue so I'm happy to see it go in. Regards, Hans The following changes since commit e899966f626f1f657a4a7bac736c0b9ae5a243ea: Merge tag 'v3.15-rc6' into patchwork (2014-05-21 23:03:15 -0300) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git for-v3.16g for you to fetch changes up to ba9a629032de6d0e8c3ff1448972061e25ef6619: media: stk1160: Avoid stack-allocated buffer for control URBs (2014-05-23 12:33:43 +0200) Arun Kumar K (1): v4l: Add source change event Dan Carpenter (1): Staging: dt3155v4l: set error code on failure Ezequiel Garcia (1): media: stk1160: Avoid stack-allocated buffer for control URBs Ismael Luceno (2): solo6x10: Reduce OSD writes to the minimum necessary solo6x10: Kconfig: Add supported card list to the SOLO6X10 knob Laurent Pinchart (3): Documentation: media: Remove double 'struct' tvp5150: Replace container_of() with to_tvp5150() v4l: subdev: Move [gs]_std operation to video ops Luis R. Rodriguez (2): technisat-usb2: rename led enums to be specific to driver bt8xx: make driver routines fit into its own namespcae Pawel Osciak (1): s5p-mfc: Add support for resolution change event Victor Lambret (1): videobuf2-core: remove duplicated code Documentation/DocBook/media/v4l/io.xml | 2 +- Documentation/DocBook/media/v4l/media-ioc-enum-links.xml | 8 Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 33 + Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml | 20 drivers/media/i2c/adv7180.c| 2 +- drivers/media/i2c/adv7183.c| 4 ++-- drivers/media/i2c/adv7842.c| 4 ++-- drivers/media/i2c/bt819.c | 2 +- drivers/media/i2c/cx25840/cx25840-core.c | 4 ++-- drivers/media/i2c/ks0127.c | 6 +- drivers/media/i2c/ml86v7667.c | 2 +- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/i2c/saa6752hs.c | 2 +- drivers/media/i2c/saa7110.c| 2 +- drivers/media/i2c/saa7115.c| 2 +- drivers/media/i2c/saa717x.c| 2 +- drivers/media/i2c/saa7191.c| 2 +- drivers/media/i2c/soc_camera/tw9910.c | 4 ++-- drivers/media/i2c/sony-btf-mpx.c | 10 +- drivers/media/i2c/tvaudio.c| 6 +- drivers/media/i2c/tvp514x.c| 2 +- drivers/media/i2c/tvp5150.c| 6 +++--- drivers/media/i2c/tw2804.c | 2 +- drivers/media/i2c/tw9903.c | 2 +- drivers/media/i2c/tw9906.c | 2 +- drivers/media/i2c/vp27smpx.c | 6 +- drivers/media/i2c/vpx3220.c| 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/bt8xx/dst.c | 20 ++-- drivers/media/pci/cx18/cx18-av-core.c | 2 +- drivers/media/pci/cx18/cx18-fileops.c | 2 +- drivers/media/pci/cx18/cx18-gpio.c | 6 +- drivers/media/pci/cx18/cx18-ioctl.c| 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 ++-- drivers/media/pci/cx88/cx88-core.c | 2 +- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c| 2 +- drivers/media/pci/saa7134/saa7134-video.c | 4 ++-- drivers/media/pci/saa7146/mxb.c| 14 +++--- drivers/media/pci/sta2x11/sta2x11_vip.c| 4 ++-- drivers/media/pci/zoran/zoran_device.c | 2 +- drivers/media/pci/zoran/zoran_driver.c | 2 +- drivers/media/platform/blackfin/bfin_capture.c | 4 ++-- drivers/media/platform/davinci/vpfe_capture.c | 2 +- drivers/media/platform/davinci/vpif_capture.c | 2 +- drivers/media/platform/davinci/vpif_display.c | 2 +- drivers/media/platform/fsl-viu.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc.c | 8 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
Re: [PATCH v7] media: vb2: Take queue or device lock in mmap-related vb2 ioctl handlers
Hi Laurent, This patch caused a circular locking dependency as reported by Sasha Levin: https://lkml.org/lkml/2014/5/5/366 The reason is that copy_to/from_user is called in video_usercopy() with the core lock held. The copy functions can fault which takes the mmap_sem. If it was just video_usercopy() then it would be fairly easy to solve this, but the copy_to_/from_user functions are also called from read and write and they can be used in other unexpected places. I'm not sure if vb2_fop_get_unmapped_area() is a problem. I suspect (but I'm not sure) that when that one is called the mmap_sem isn't taken, in which case taking the lock is fine. But taking the lock in vb2_fop_mmap() does cause lockdep problems. Ideally I would like to drop taking that lock in vb2_fop_mmap and resolve the race condition that it intended to fix in a different way. Regards, Hans On 08/06/2013 10:10 PM, Laurent Pinchart wrote: The vb2_fop_mmap() and vb2_fop_get_unmapped_area() functions are plug-in implementation of the mmap() and get_unmapped_area() file operations that calls vb2_mmap() and vb2_get_unmapped_area() on the queue associated with the video device. Neither the vb2_fop_mmap/vb2_fop_get_unmapped_area nor the v4l2_mmap/vb2_get_unmapped_area functions in the V4L2 core take any lock, leading to race conditions between mmap/get_unmapped_area and other buffer-related ioctls such as VIDIOC_REQBUFS. Fix it by taking the queue or device lock around the vb2_mmap() and vb2_get_unmapped_area() calls. Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com --- drivers/media/v4l2-core/videobuf2-core.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 9fc4bab..c9b50c7 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -2578,8 +2578,15 @@ EXPORT_SYMBOL_GPL(vb2_ioctl_expbuf); int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma) { struct video_device *vdev = video_devdata(file); + struct mutex *lock = vdev-queue-lock ? vdev-queue-lock : vdev-lock; + int err; - return vb2_mmap(vdev-queue, vma); + if (lock mutex_lock_interruptible(lock)) + return -ERESTARTSYS; + err = vb2_mmap(vdev-queue, vma); + if (lock) + mutex_unlock(lock); + return err; } EXPORT_SYMBOL_GPL(vb2_fop_mmap); @@ -2685,8 +2692,15 @@ unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct video_device *vdev = video_devdata(file); + struct mutex *lock = vdev-queue-lock ? vdev-queue-lock : vdev-lock; + int ret; - return vb2_get_unmapped_area(vdev-queue, addr, len, pgoff, flags); + if (lock mutex_lock_interruptible(lock)) + return -ERESTARTSYS; + ret = vb2_get_unmapped_area(vdev-queue, addr, len, pgoff, flags); + if (lock) + mutex_unlock(lock); + return ret; } EXPORT_SYMBOL_GPL(vb2_fop_get_unmapped_area); #endif -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.16] Various fixes
Em Mon, 12 May 2014 10:31:10 +0200 Hans Verkuil hverk...@xs4all.nl escreveu: (Updated version of my pull request of May 9th, adding the remaining em28xx patches from Frank.) Hi Mauro, I went through my pending patches queue and managed to go through most of it. Most patches are fairly trivial, but you should take a close look at the videobuf-dma-contig patch from Ma Haijun since you introduced the vm_iomap_memory() change. I reviewed it carefully and tested it and it seems sound to me, but that's one patch that needs an extra pair of eyeballs. Also note that I tested the saa7134 querybuf patch from Mikhail Domrachev successfully using my signal generator. Regards, Hans The following changes since commit 393cbd8dc532c1ebed60719da8d379f50d445f28: [media] smiapp: Use %u for printing u32 value (2014-04-23 16:05:06 -0300) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git for-v3.16d for you to fetch changes up to 87b3628098449bb09e2bebf14bf9ce1978cec524: em28xx: move fields wq_trigger and streaming_started from struct em28xx to struct em28xx_audio (2014-05-12 10:27:00 +0200) Alexander Shiyan (1): media: coda: Use full device name for request_irq() Bartlomiej Zolnierkiewicz (1): v4l: ti-vpe: fix devm_ioremap_resource() return value checking Daeseok Youn (1): s2255drv: fix memory leak s2255_probe() Dan Carpenter (1): av7110: fix confusing indenting Frank Schaefer (24): em28xx: fix indenting in em28xx_usb_probe() em28xx: remove some unused fields from struct em28xx em28xx: remove function em28xx_compression_disable() and its call em28xx: move norm_maxw() and norm_maxh() from em28xx.h to em28xx-video.c em28xx: remove the i2c_set_adapdata() call in em28xx_i2c_register() em28xx: move sub-module data structs to a common place in the main struct em28xx-video: simplify usage of the pointer to struct v4l2_ctrl_handler in em28xx_v4l2_init() em28xx: start moving em28xx-v4l specific data to its own struct em28xx: move struct v4l2_ctrl_handler ctrl_handler from struct em28xx to struct v4l2 em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2 em28xx: move video_device structs from struct em28xx to struct v4l2 em28xx: move videobuf2 related data from struct em28xx to struct v4l2 em28xx: move v4l2 frame resolutions and scale data from struct em28xx to struct v4l2 em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2 em28xx: move TV norm from struct em28xx to struct v4l2 em28xx: move struct em28xx_fmt *format from struct em28xx to struct v4l2 em28xx: move progressive/interlaced fields from struct em28xx to struct v4l2 em28xx: move sensor parameter fields from struct em28xx to struct v4l2 em28xx: move capture state tracking fields from struct em28xx to struct v4l2 em28xx: move v4l2 user counting fields from struct em28xx to struct v4l2 em28xx: move tuner frequency field from struct em28xx to struct v4l2 em28xx: remove field tda9887_conf from struct em28xx em28xx: remove field tuner_addr from struct em28xx em28xx: move fields wq_trigger and streaming_started from struct em28xx to struct em28xx_audio Hans, Almost all those em28xx patches don't have any description! Please either enforce with the patch author for them to add a description for each patch or add yourself some description for them. I'm really annoyed by merging this series, due to that, especially when some answers why certain design decisions taken on some of those patches are not answered... For example, on em28xx: move sensor parameter fields from struct em28xx to struct v4l2, We have 3 fields being moved to em28xx_v4l2 struct: - int sensor_xres, sensor_yres; - int sensor_xtal; But this one was kept there: + enum em28xx_sensor em28xx_sensor; /* camera specific */ I would be expecting, on this particular, changeset, a comment like: [media] em28xx: move sensor parameter fields from struct em28xx to struct v4l2 Move camera sensor resolution and xtal out of em28xx common struct, as thore are used only by the em28xx v4l2 submodule. The em28xx_sensor firmware, however, couldn't be moved there because *some reason*. Btw, probably several of those data merging stuff would be better handled if merged into a single patch, stating how much memory was saved on digital-only devices where all those V4L2-specific data are not allocated anymore. Thanks, Mauro -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue
Hey Dan, Sorry my bad, will resubmit the patch in a proper manner with the required corrections. Thanks for looking into this. Thanks, Chaitanya On Fri, May 23, 2014 at 12:10 AM, Dan Carpenter dan.carpen...@oracle.com wrote: On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote: Fixed the ERROR thrown off by checkpatch.pl. Put the error message here, or say what it was. Signed-off-by: Chaitanya Hazarey c...@24.io Could you change your email client so it has your last in the From: header? This patch doesn't apply. Read this: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue
On 05/23/2014 06:59 PM, Chaitanya Hazarey wrote: Hey Dan, Sorry my bad, will resubmit the patch in a proper manner with the required corrections. Don't bother. This patch: http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/48570 has just been merged and that has the same fixes as your patch. But thanks anyway :-) Regards, Hans Thanks for looking into this. Thanks, Chaitanya On Fri, May 23, 2014 at 12:10 AM, Dan Carpenter dan.carpen...@oracle.com wrote: On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote: Fixed the ERROR thrown off by checkpatch.pl. Put the error message here, or say what it was. Signed-off-by: Chaitanya Hazarey c...@24.io Could you change your email client so it has your last in the From: header? This patch doesn't apply. Read this: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Up to 76% off on watches
You will be the envy of the people at the office with your new watch http://blakematthews.ca/kgpytya.php -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] usbtv: fix leak at failure path in usbtv_probe()
Error handling code in usbtv_probe() misses usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/media/usb/usbtv/usbtv-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c index 2f87ddfa469f..473fab81b602 100644 --- a/drivers/media/usb/usbtv/usbtv-core.c +++ b/drivers/media/usb/usbtv/usbtv-core.c @@ -91,6 +91,8 @@ static int usbtv_probe(struct usb_interface *intf, return 0; usbtv_video_fail: + usb_set_intfdata(intf, NULL); + usb_put_dev(usbtv-udev); kfree(usbtv); return ret; -- 1.8.3.2 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 41/49] media: davinci: vpif_capture: drop unneeded module params
Em Fri, 16 May 2014 19:03:47 +0530 Lad, Prabhakar prabhakar.cse...@gmail.com escreveu: From: Lad, Prabhakar prabhakar.cse...@gmail.com Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com -ENOPATCHDESCRIPTION Why to remove those parameters? Please _ALWAYS_ describe your patches. My crystal ball is malfunctioning today, so I was unable to scry the reasons for this patch. Thanks, Mauro --- drivers/media/platform/davinci/vpif_capture.c | 54 + drivers/media/platform/davinci/vpif_capture.h | 11 - 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index d452eaf..e967cf7 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -38,32 +38,10 @@ MODULE_VERSION(VPIF_CAPTURE_VERSION); v4l2_dbg(level, debug, vpif_obj.v4l2_dev, fmt, ## arg) static int debug = 1; -static u32 ch0_numbuffers = 3; -static u32 ch1_numbuffers = 3; -static u32 ch0_bufsize = 1920 * 1080 * 2; -static u32 ch1_bufsize = 720 * 576 * 2; module_param(debug, int, 0644); -module_param(ch0_numbuffers, uint, S_IRUGO); -module_param(ch1_numbuffers, uint, S_IRUGO); -module_param(ch0_bufsize, uint, S_IRUGO); -module_param(ch1_bufsize, uint, S_IRUGO); MODULE_PARM_DESC(debug, Debug level 0-1); -MODULE_PARM_DESC(ch2_numbuffers, Channel0 buffer count (default:3)); -MODULE_PARM_DESC(ch3_numbuffers, Channel1 buffer count (default:3)); -MODULE_PARM_DESC(ch2_bufsize, Channel0 buffer size (default:1920 x 1080 x 2)); -MODULE_PARM_DESC(ch3_bufsize, Channel1 buffer size (default:720 x 576 x 2)); - -static struct vpif_config_params config_params = { - .min_numbuffers = 3, - .numbuffers[0] = 3, - .numbuffers[1] = 3, - .min_bufsize[0] = 720 * 480 * 2, - .min_bufsize[1] = 720 * 480 * 2, - .channel_bufsize[0] = 1920 * 1080 * 2, - .channel_bufsize[1] = 720 * 576 * 2, -}; #define VPIF_DRIVER_NAME vpif_capture @@ -609,9 +587,6 @@ static void vpif_config_format(struct channel_obj *ch) vpif_dbg(2, debug, vpif_config_format\n); common-fmt.fmt.pix.field = V4L2_FIELD_ANY; - common-fmt.fmt.pix.sizeimage - = config_params.channel_bufsize[ch-channel_id]; - if (ch-vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) common-fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; else @@ -1358,36 +1333,9 @@ static struct v4l2_file_operations vpif_fops = { */ static int initialize_vpif(void) { - int err = 0, i, j; + int err, i, j; int free_channel_objects_index; - /* Default number of buffers should be 3 */ - if ((ch0_numbuffers 0) - (ch0_numbuffers config_params.min_numbuffers)) - ch0_numbuffers = config_params.min_numbuffers; - if ((ch1_numbuffers 0) - (ch1_numbuffers config_params.min_numbuffers)) - ch1_numbuffers = config_params.min_numbuffers; - - /* Set buffer size to min buffers size if it is invalid */ - if (ch0_bufsize config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]) - ch0_bufsize = - config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]; - if (ch1_bufsize config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]) - ch1_bufsize = - config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]; - - config_params.numbuffers[VPIF_CHANNEL0_VIDEO] = ch0_numbuffers; - config_params.numbuffers[VPIF_CHANNEL1_VIDEO] = ch1_numbuffers; - if (ch0_numbuffers) { - config_params.channel_bufsize[VPIF_CHANNEL0_VIDEO] - = ch0_bufsize; - } - if (ch1_numbuffers) { - config_params.channel_bufsize[VPIF_CHANNEL1_VIDEO] - = ch1_bufsize; - } - /* Allocate memory for six channel objects */ for (i = 0; i VPIF_CAPTURE_MAX_DEVICES; i++) { vpif_obj.dev[i] = diff --git a/drivers/media/platform/davinci/vpif_capture.h b/drivers/media/platform/davinci/vpif_capture.h index 4960504..537076a 100644 --- a/drivers/media/platform/davinci/vpif_capture.h +++ b/drivers/media/platform/davinci/vpif_capture.h @@ -125,16 +125,5 @@ struct vpif_device { struct vpif_capture_config *config; }; -struct vpif_config_params { - u8 min_numbuffers; - u8 numbuffers[VPIF_CAPTURE_NUM_CHANNELS]; - s8 device_type; - u32 min_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; - u32 channel_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; - u8 default_device[VPIF_CAPTURE_NUM_CHANNELS]; - u32 video_limit[VPIF_CAPTURE_NUM_CHANNELS]; - u8 max_device_type; -}; - #endif /* End of __KERNEL__ */ #endif /* VPIF_CAPTURE_H */ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to
Re: [GIT PULL FOR v3.16] davinci updates
Em Fri, 23 May 2014 11:07:25 +0200 Hans Verkuil hverk...@xs4all.nl escreveu: Hi Mauro, These are cleanup patches for the davinci drivers. A total of about 1200 lines of code are removed. Not bad! Regards, Hans The following changes since commit e899966f626f1f657a4a7bac736c0b9ae5a243ea: Merge tag 'v3.15-rc6' into patchwork (2014-05-21 23:03:15 -0300) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git davinci for you to fetch changes up to c1022cd59bb34dbb435cda9a2fc98bb6fb931f61: media: davinci: vpif: add Copyright message (2014-05-23 10:12:34 +0200) Lad, Prabhakar (49): media: davinci: vpif_display: initialize vb2 queue and DMA context during probe media: davinci: vpif_display: drop buf_init() callback media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions media: davinci: vpif_display: release buffers in case start_streaming() call back fails media: davinci: vpif_display: drop buf_cleanup() callback media: davinci: vpif_display: improve vpif_buffer_prepare() callback media: davinci: vpif_display: improve vpif_buffer_queue_setup() function media: davinci: vpif_display: improve start/stop_streaming callbacks media: davinci: vpif_display: use vb2_fop_mmap/poll media: davinci: vpif_display: use v4l2_fh_open and vb2_fop_release media: davinci: vpif_display: use vb2_ioctl_* helpers media: davinci: vpif_display: drop unused member fbuffers media: davinci: vpif_display: drop reserving memory for device media: davinci: vpif_display: drop unnecessary field memory media: davinci: vpif_display: drop numbuffers field from common_obj media: davinic: vpif_display: drop started member from struct common_obj media: davinci: vpif_display: initialize the video device in single place media: davinci: vpif_display: drop unneeded module params media: davinci: vpif_display: drop cropcap media: davinci: vpif_display: group v4l2_ioctl_ops media: davinci: vpif_display: use SIMPLE_DEV_PM_OPS media: davinci: vpif_display: return -ENODATA for *dv_timings calls media: davinci: vpif_display: return -ENODATA for *std calls media: davinci; vpif_display: fix checkpatch error media: davinci: vpif_display: fix v4l-complinace issues media: davinci: vpif_capture: initalize vb2 queue and DMA context during probe media: davinci: vpif_capture: drop buf_init() callback media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper functions media: davinci: vpif_capture: release buffers in case start_streaming() call back fails media: davinci: vpif_capture: drop buf_cleanup() callback media: davinci: vpif_capture: improve vpif_buffer_prepare() callback media: davinci: vpif_capture: improve vpif_buffer_queue_setup() function media: davinci: vpif_capture: improve start/stop_streaming callbacks media: davinci: vpif_capture: use vb2_fop_mmap/poll media: davinci: vpif_capture: use v4l2_fh_open and vb2_fop_release media: davinci: vpif_capture: use vb2_ioctl_* helpers media: davinci: vpif_capture: drop reserving memory for device media: davinci: vpif_capture: drop unnecessary field memory media: davinic: vpif_capture: drop started member from struct common_obj media: davinci: vpif_capture: initialize the video device in single place media: davinci: vpif_capture: drop unneeded module params Enough! I'm tired of guessing why those bad commented are needed and what them are actually doing. In this particular case: Why those module parameters were needed before, but aren't needed anymore? What changed? The removal of module parameters is a sort of API change. So, I _DO_ expect them to be very well justified. Please, properly describe _ALL_ patches, or I'll NACK the pull requests. This time, I applied everything up to the patch before this one. On a next pull request without proper descriptions, I'll likely just stop on the first patch missing description (or with a crappy one). Regards, Mauro -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cron job: media_tree daily build: ERRORS
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: Sat May 24 04:00:26 CEST 2014 git branch: test git hash: 12bd10c79bd8f65698660e992b8656e9a48eeca1 gcc version:i686-linux-gcc (GCC) 4.8.2 sparse version: v0.5.0-11-g38d1124 host hardware: x86_64 host os:3.14-1.slh.1-amd64 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-exynos: ERRORS linux-git-arm-mx: OK linux-git-arm-omap: OK linux-git-arm-omap1: OK linux-git-arm-pxa: OK linux-git-blackfin: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: OK linux-2.6.31.14-i686: ERRORS linux-2.6.32.27-i686: ERRORS linux-2.6.33.7-i686: ERRORS linux-2.6.34.7-i686: ERRORS linux-2.6.35.9-i686: ERRORS linux-2.6.36.4-i686: ERRORS linux-2.6.37.6-i686: ERRORS linux-2.6.38.8-i686: ERRORS linux-2.6.39.4-i686: ERRORS linux-3.0.60-i686: ERRORS linux-3.1.10-i686: ERRORS linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: OK linux-3.5.7-i686: OK linux-3.6.11-i686: OK linux-3.7.4-i686: OK linux-3.8-i686: OK linux-3.9.2-i686: OK linux-3.10.1-i686: OK linux-3.11.1-i686: OK linux-3.12-i686: OK linux-3.13-i686: OK linux-3.14-i686: OK linux-3.15-rc1-i686: OK linux-2.6.31.14-x86_64: ERRORS linux-2.6.32.27-x86_64: ERRORS linux-2.6.33.7-x86_64: ERRORS linux-2.6.34.7-x86_64: ERRORS linux-2.6.35.9-x86_64: ERRORS linux-2.6.36.4-x86_64: ERRORS linux-2.6.37.6-x86_64: ERRORS linux-2.6.38.8-x86_64: ERRORS linux-2.6.39.4-x86_64: ERRORS linux-3.0.60-x86_64: ERRORS linux-3.1.10-x86_64: ERRORS linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: OK linux-3.5.7-x86_64: OK linux-3.6.11-x86_64: OK linux-3.7.4-x86_64: OK linux-3.8-x86_64: OK linux-3.9.2-x86_64: OK linux-3.10.1-x86_64: OK linux-3.11.1-x86_64: OK linux-3.12-x86_64: OK linux-3.13-x86_64: OK linux-3.14-x86_64: OK linux-3.15-rc1-x86_64: OK apps: OK spec-git: OK ABI WARNING: change for arm-at91 ABI WARNING: change for arm-davinci ABI WARNING: change for arm-exynos ABI WARNING: change for arm-mx ABI WARNING: change for arm-omap ABI WARNING: change for arm-omap1 ABI WARNING: change for arm-pxa ABI WARNING: change for blackfin ABI WARNING: change for i686 ABI WARNING: change for m32r ABI WARNING: change for mips ABI WARNING: change for powerpc64 ABI WARNING: change for sh ABI WARNING: change for x86_64 sparse version: v0.5.0-11-g38d1124 sparse: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Saturday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 04/49] media: davinci: vpif_display: release buffers in case start_streaming() call back fails
Hi Hans, Thanks for the review. On Fri, May 23, 2014 at 2:05 PM, Hans Verkuil hverk...@xs4all.nl wrote: On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com this patch adds support to release the buffer by calling vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED if start_streaming() call back fails. Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com --- drivers/media/platform/davinci/vpif_display.c | 42 +++-- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 8bb9f02..1a17a45 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -196,26 +196,16 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) struct channel_obj *ch = vb2_get_drv_priv(vq); struct common_obj *common = ch-common[VPIF_VIDEO_INDEX]; struct vpif_params *vpif = ch-vpifparams; - unsigned long addr = 0; - unsigned long flags; + struct vpif_disp_buffer *buf, *tmp; + unsigned long addr, flags; int ret; spin_lock_irqsave(common-irqlock, flags); - /* Get the next frame from the buffer queue */ - common-next_frm = common-cur_frm = - list_entry(common-dma_queue.next, -struct vpif_disp_buffer, list); - - list_del(common-cur_frm-list); - spin_unlock_irqrestore(common-irqlock, flags); - /* Mark state of the current frame to active */ - common-cur_frm-vb.state = VB2_BUF_STATE_ACTIVE; - /* Initialize field_id and started member */ ch-field_id = 0; common-started = 1; - addr = vb2_dma_contig_plane_dma_addr(common-cur_frm-vb, 0); + /* Calculate the offset for Y and C data in the buffer */ vpif_calculate_offsets(ch); @@ -225,7 +215,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) || (!ch-vpifparams.std_info.frm_fmt (common-fmt.fmt.pix.field == V4L2_FIELD_NONE))) { vpif_err(conflict in field format and std format\n); - return -EINVAL; + ret = -EINVAL; + goto err; } /* clock settings */ @@ -234,17 +225,28 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ycmux_mode, ch-vpifparams.std_info.hd_sd); if (ret 0) { vpif_err(can't set clock\n); - return ret; + goto err; } } /* set the parameters and addresses */ ret = vpif_set_video_params(vpif, ch-channel_id + 2); if (ret 0) - return ret; + goto err; common-started = ret; vpif_config_addr(ch, ret); + /* Get the next frame from the buffer queue */ + common-next_frm = common-cur_frm = + list_entry(common-dma_queue.next, +struct vpif_disp_buffer, list); + + list_del(common-cur_frm-list); + spin_unlock_irqrestore(common-irqlock, flags); + /* Mark state of the current frame to active */ + common-cur_frm-vb.state = VB2_BUF_STATE_ACTIVE; There is no need to set this, all buffers queued to the driver are always in state ACTIVE. The vb2 core sets that for you. In general drivers never need to change the state manually. It happens twice in this driver and in both cases the assignment can be removed. OK, will drop this. Regards, --Prabhakar Lad -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 00/49] DaVinci: vpif: upgrade with v4l helpers and v4l compliance fixes
Hi Hans, Thanks for the review from 2 patches to 50 :) On Fri, May 23, 2014 at 2:00 PM, Hans Verkuil hverk...@xs4all.nl wrote: Hi Prabhakar, Thanks for this patch series, it looks good to me and I'll make a pull request for this. Thanks. I did find a few issues, but they are all pre-existing problems, so they can be fixed in follow-up patches. I'll comment on those in the relevant patches. Since display and capture are so similar I will only comment on the display patches, but it's valid for both. Ok will fix them up soon I am relocating next week so will take me at-least 2-3 weeks for me to get back the boards and get in action. Regards, --Prabhakar Lad Regards, Hans On 05/16/2014 03:33 PM, Lad, Prabhakar wrote: From: Lad, Prabhakar prabhakar.cse...@gmail.com Hi, This patch series upgrades the vpif capture display driver with the all the helpers provided by v4l, this makes the driver much simpler and cleaner. This also includes few checkpatch issues. Changes for v2: a Added a copyright. b Dropped buf_init() callback from vb2_ops. c Fixed enabling disabling of interrupts in case of HD formats. Changes for v3: a Fixed review comments pointed by Hans. Changes for v4: Rebased the patches on media tree. Changes for v5: Split up the patches Following is the output of v4l-compliance for capture: -- ./v4l2-compliance -d /dev/video0 -i 0 -s -v --expbuf-device=2 Driver Info: Driver name : vpif_capture Card type : DA850/OMAP-L138 Video Capture Bus info : platform:vpif_capture Driver version: 3.15.0 Capabilities : 0x8401 Video Capture Streaming Device Capabilities Device Caps : 0x0401 Video Capture Streaming Compliance test for device /dev/video0 (not using libv4l2): Required ioctls: test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second video open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 1 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Test input 0: Control ioctls: test VIDIOC_QUERYCTRL/MENU: OK (Not Supported) test VIDIOC_G/S_CTRL: OK (Not Supported) test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0 Format ioctls: info: found 1 formats for buftype 1 test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK fail: v4l2-test-formats.cpp(1003): cap-readbuffers test VIDIOC_G/S_PARM: FAIL test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: info: test buftype Video Capture test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test read/write: OK (Not Supported) Video Capture: Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.509130s Buffer: 1 Sequence: 0 Field: Interlaced Timestamp: 145.549125s Buffer: 2 Sequence: 0 Field: Interlaced Timestamp: 145.589148s Buffer: 3 Sequence: 0 Field: Interlaced Timestamp: 145.629106s Buffer: 0 Sequence: 0 Field: Interlaced Timestamp: 145.669110s
Re: [PATCH v5 41/49] media: davinci: vpif_capture: drop unneeded module params
Hi Mauro, On Sat, May 24, 2014 at 4:08 AM, Mauro Carvalho Chehab m.che...@samsung.com wrote: Em Fri, 16 May 2014 19:03:47 +0530 Lad, Prabhakar prabhakar.cse...@gmail.com escreveu: From: Lad, Prabhakar prabhakar.cse...@gmail.com Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com -ENOPATCHDESCRIPTION Why to remove those parameters? Please _ALWAYS_ describe your patches. My bad! will take care next time. Thanks, --Prabhakar Lad My crystal ball is malfunctioning today, so I was unable to scry the reasons for this patch. Thanks, Mauro --- drivers/media/platform/davinci/vpif_capture.c | 54 + drivers/media/platform/davinci/vpif_capture.h | 11 - 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index d452eaf..e967cf7 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -38,32 +38,10 @@ MODULE_VERSION(VPIF_CAPTURE_VERSION); v4l2_dbg(level, debug, vpif_obj.v4l2_dev, fmt, ## arg) static int debug = 1; -static u32 ch0_numbuffers = 3; -static u32 ch1_numbuffers = 3; -static u32 ch0_bufsize = 1920 * 1080 * 2; -static u32 ch1_bufsize = 720 * 576 * 2; module_param(debug, int, 0644); -module_param(ch0_numbuffers, uint, S_IRUGO); -module_param(ch1_numbuffers, uint, S_IRUGO); -module_param(ch0_bufsize, uint, S_IRUGO); -module_param(ch1_bufsize, uint, S_IRUGO); MODULE_PARM_DESC(debug, Debug level 0-1); -MODULE_PARM_DESC(ch2_numbuffers, Channel0 buffer count (default:3)); -MODULE_PARM_DESC(ch3_numbuffers, Channel1 buffer count (default:3)); -MODULE_PARM_DESC(ch2_bufsize, Channel0 buffer size (default:1920 x 1080 x 2)); -MODULE_PARM_DESC(ch3_bufsize, Channel1 buffer size (default:720 x 576 x 2)); - -static struct vpif_config_params config_params = { - .min_numbuffers = 3, - .numbuffers[0] = 3, - .numbuffers[1] = 3, - .min_bufsize[0] = 720 * 480 * 2, - .min_bufsize[1] = 720 * 480 * 2, - .channel_bufsize[0] = 1920 * 1080 * 2, - .channel_bufsize[1] = 720 * 576 * 2, -}; #define VPIF_DRIVER_NAME vpif_capture @@ -609,9 +587,6 @@ static void vpif_config_format(struct channel_obj *ch) vpif_dbg(2, debug, vpif_config_format\n); common-fmt.fmt.pix.field = V4L2_FIELD_ANY; - common-fmt.fmt.pix.sizeimage - = config_params.channel_bufsize[ch-channel_id]; - if (ch-vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) common-fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; else @@ -1358,36 +1333,9 @@ static struct v4l2_file_operations vpif_fops = { */ static int initialize_vpif(void) { - int err = 0, i, j; + int err, i, j; int free_channel_objects_index; - /* Default number of buffers should be 3 */ - if ((ch0_numbuffers 0) - (ch0_numbuffers config_params.min_numbuffers)) - ch0_numbuffers = config_params.min_numbuffers; - if ((ch1_numbuffers 0) - (ch1_numbuffers config_params.min_numbuffers)) - ch1_numbuffers = config_params.min_numbuffers; - - /* Set buffer size to min buffers size if it is invalid */ - if (ch0_bufsize config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]) - ch0_bufsize = - config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]; - if (ch1_bufsize config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]) - ch1_bufsize = - config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]; - - config_params.numbuffers[VPIF_CHANNEL0_VIDEO] = ch0_numbuffers; - config_params.numbuffers[VPIF_CHANNEL1_VIDEO] = ch1_numbuffers; - if (ch0_numbuffers) { - config_params.channel_bufsize[VPIF_CHANNEL0_VIDEO] - = ch0_bufsize; - } - if (ch1_numbuffers) { - config_params.channel_bufsize[VPIF_CHANNEL1_VIDEO] - = ch1_bufsize; - } - /* Allocate memory for six channel objects */ for (i = 0; i VPIF_CAPTURE_MAX_DEVICES; i++) { vpif_obj.dev[i] = diff --git a/drivers/media/platform/davinci/vpif_capture.h b/drivers/media/platform/davinci/vpif_capture.h index 4960504..537076a 100644 --- a/drivers/media/platform/davinci/vpif_capture.h +++ b/drivers/media/platform/davinci/vpif_capture.h @@ -125,16 +125,5 @@ struct vpif_device { struct vpif_capture_config *config; }; -struct vpif_config_params { - u8 min_numbuffers; - u8 numbuffers[VPIF_CAPTURE_NUM_CHANNELS]; - s8 device_type; - u32 min_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; - u32 channel_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; - u8 default_device[VPIF_CAPTURE_NUM_CHANNELS]; - u32 video_limit[VPIF_CAPTURE_NUM_CHANNELS]; - u8 max_device_type; -}; - #endif /* End of __KERNEL__ */ #endif
[PATCH RESEND] media: m2m-deinterlace: Convert to devm* API
Replace resource handling in the driver with managed device resource. Signed-off-by: Alexander Shiyan shc_w...@mail.ru --- drivers/media/platform/m2m-deinterlace.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index c21d14f..d36c507 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -1002,7 +1002,7 @@ static int deinterlace_probe(struct platform_device *pdev) dma_cap_mask_t mask; int ret = 0; - pcdev = kzalloc(sizeof *pcdev, GFP_KERNEL); + pcdev = devm_kzalloc(pdev-dev, sizeof(*pcdev), GFP_KERNEL); if (!pcdev) return -ENOMEM; @@ -1012,7 +1012,7 @@ static int deinterlace_probe(struct platform_device *pdev) dma_cap_set(DMA_INTERLEAVE, mask); pcdev-dma_chan = dma_request_channel(mask, NULL, pcdev); if (!pcdev-dma_chan) - goto free_dev; + return -ENODEV; if (!dma_has_cap(DMA_INTERLEAVE, pcdev-dma_chan-device-cap_mask)) { v4l2_err(pcdev-v4l2_dev, DMA does not support INTERLEAVE\n); @@ -1078,8 +1078,6 @@ unreg_dev: v4l2_device_unregister(pcdev-v4l2_dev); rel_dma: dma_release_channel(pcdev-dma_chan); -free_dev: - kfree(pcdev); return ret; } @@ -1094,7 +1092,6 @@ static int deinterlace_remove(struct platform_device *pdev) v4l2_device_unregister(pcdev-v4l2_dev); vb2_dma_contig_cleanup_ctx(pcdev-alloc_ctx); dma_release_channel(pcdev-dma_chan); - kfree(pcdev); return 0; } -- 1.8.5.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] media: mx2_camera: Change Kconfig dependency
This patch change MACH_MX27 dependency to SOC_IMX27 for MX2 camera driver, since MACH_MX27 symbol is scheduled for removal. Signed-off-by: Alexander Shiyan shc_w...@mail.ru --- drivers/media/platform/soc_camera/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/soc_camera/Kconfig b/drivers/media/platform/soc_camera/Kconfig index 122e03a..fc62897 100644 --- a/drivers/media/platform/soc_camera/Kconfig +++ b/drivers/media/platform/soc_camera/Kconfig @@ -63,7 +63,7 @@ config VIDEO_OMAP1 config VIDEO_MX2 tristate i.MX27 Camera Sensor Interface driver - depends on VIDEO_DEV SOC_CAMERA MACH_MX27 + depends on VIDEO_DEV SOC_CAMERA SOC_IMX27 select VIDEOBUF2_DMA_CONTIG ---help--- This is a v4l2 driver for the i.MX27 Camera Sensor Interface -- 1.8.5.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] media: mx1_camera: Remove driver
That driver hasn't been really maintained for a long time. It doesn't compile in any way, it includes non-existent headers, has no users, and marked as BROKEN more than year. Due to these factors, mx1_camera is now removed from the tree. Signed-off-by: Alexander Shiyan shc_w...@mail.ru --- drivers/media/platform/soc_camera/Kconfig | 13 - drivers/media/platform/soc_camera/Makefile | 1 - drivers/media/platform/soc_camera/mx1_camera.c | 866 - 3 files changed, 880 deletions(-) delete mode 100644 drivers/media/platform/soc_camera/mx1_camera.c diff --git a/drivers/media/platform/soc_camera/Kconfig b/drivers/media/platform/soc_camera/Kconfig index af39c46..122e03a 100644 --- a/drivers/media/platform/soc_camera/Kconfig +++ b/drivers/media/platform/soc_camera/Kconfig @@ -17,19 +17,6 @@ config SOC_CAMERA_PLATFORM help This is a generic SoC camera platform driver, useful for testing -config MX1_VIDEO - bool - -config VIDEO_MX1 - tristate i.MX1/i.MXL CMOS Sensor Interface driver - depends on BROKEN - depends on VIDEO_DEV ARCH_MX1 SOC_CAMERA - select FIQ - select VIDEOBUF_DMA_CONTIG - select MX1_VIDEO - ---help--- - This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface - config VIDEO_MX3 tristate i.MX3x Camera Sensor Interface driver depends on VIDEO_DEV MX3_IPU SOC_CAMERA diff --git a/drivers/media/platform/soc_camera/Makefile b/drivers/media/platform/soc_camera/Makefile index 8aed26d..2826382 100644 --- a/drivers/media/platform/soc_camera/Makefile +++ b/drivers/media/platform/soc_camera/Makefile @@ -7,7 +7,6 @@ obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o # soc-camera host drivers have to be linked after camera drivers obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o -obj-$(CONFIG_VIDEO_MX1)+= mx1_camera.o obj-$(CONFIG_VIDEO_MX2)+= mx2_camera.o obj-$(CONFIG_VIDEO_MX3)+= mx3_camera.o obj-$(CONFIG_VIDEO_OMAP1) += omap1_camera.o diff --git a/drivers/media/platform/soc_camera/mx1_camera.c b/drivers/media/platform/soc_camera/mx1_camera.c deleted file mode 100644 index fea3e61..000 --- a/drivers/media/platform/soc_camera/mx1_camera.c +++ /dev/null @@ -1,866 +0,0 @@ -/* - * V4L2 Driver for i.MXL/i.MXL camera (CSI) host - * - * Copyright (C) 2008, Paulius Zaleckas paulius.zalec...@teltonika.lt - * Copyright (C) 2009, Darius Augulis augulis.dar...@gmail.com - * - * Based on PXA SoC camera driver - * Copyright (C) 2006, Sascha Hauer, Pengutronix - * Copyright (C) 2008, Guennadi Liakhovetski ker...@pengutronix.de - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include linux/clk.h -#include linux/delay.h -#include linux/device.h -#include linux/dma-mapping.h -#include linux/errno.h -#include linux/fs.h -#include linux/init.h -#include linux/interrupt.h -#include linux/io.h -#include linux/kernel.h -#include linux/mm.h -#include linux/module.h -#include linux/moduleparam.h -#include linux/platform_device.h -#include linux/sched.h -#include linux/slab.h -#include linux/time.h -#include linux/videodev2.h - -#include media/soc_camera.h -#include media/v4l2-common.h -#include media/v4l2-dev.h -#include media/videobuf-dma-contig.h -#include media/soc_mediabus.h - -#include asm/dma.h -#include asm/fiq.h -#include mach/dma-mx1-mx2.h -#include mach/hardware.h -#include mach/irqs.h -#include linux/platform_data/camera-mx1.h - -/* - * CSI registers - */ -#define CSICR1 0x00/* CSI Control Register 1 */ -#define CSISR 0x08/* CSI Status Register */ -#define CSIRXR 0x10/* CSI RxFIFO Register */ - -#define CSICR1_RXFF_LEVEL(x) (((x) 0x3) 19) -#define CSICR1_SOF_POL (1 17) -#define CSICR1_SOF_INTEN (1 16) -#define CSICR1_MCLKDIV(x) (((x) 0xf) 12) -#define CSICR1_MCLKEN (1 9) -#define CSICR1_FCC (1 8) -#define CSICR1_BIG_ENDIAN (1 7) -#define CSICR1_CLR_RXFIFO (1 5) -#define CSICR1_GCLK_MODE (1 4) -#define CSICR1_DATA_POL(1 2) -#define CSICR1_REDGE (1 1) -#define CSICR1_EN (1 0) - -#define CSISR_SFF_OR_INT (1 25) -#define CSISR_RFF_OR_INT (1 24) -#define CSISR_STATFF_INT (1 21) -#define CSISR_RXFF_INT (1 18) -#define CSISR_SOF_INT (1 16) -#define CSISR_DRDY (1 0) - -#define DRIVER_VERSION 0.0.2 -#define DRIVER_NAME mx1-camera - -#define CSI_IRQ_MASK (CSISR_SFF_OR_INT | CSISR_RFF_OR_INT | \ - CSISR_STATFF_INT | CSISR_RXFF_INT | CSISR_SOF_INT) - -#define CSI_BUS_FLAGS (V4L2_MBUS_MASTER | V4L2_MBUS_HSYNC_ACTIVE_HIGH | \ -