[media] lmedm04: fix the range for relative measurements
Relative measurements are typically between 0 and 0xffff. However,
for some tuners (TUNER_S7395 and TUNER_S0194), the range were from
0 to 0xff00, with means that 100% is never archived.
Also, TUNER_RS2000 uses a more complex math.
So, create a macro that does the conversion using bit operations
and use it for all conversions.
[media] lmedm04: use u32 instead of u64 for relative stats
Cleanup this sparse warning:
drivers/media/usb/dvb-usb-v2/lmedm04.c:302 lme2510_update_stats() warn: should '((255 - st->signal_sn - 161) * 3) << 8' be a 64 bit type?
Both c_tmp and s_tmp actually stores a u16 stat. Using a u64 data
there is a waste, specially on u32 archs, as 64 ints there are more
expensive.
So, change the types to u32 and do the typecast only when storing
the result.
On some archs, like tile, the PAGE_SIZE is not 4K. In the case
of tile arch, it can be either 16KB or 64KB.
Due to that, a warning is produced:
drivers/media/pci/saa7134/saa7134.h:678:43: warning: large integer implicitly truncated to unsigned type [-Woverflow]
This is actually an error, as it will write trach to the DMA size
registers. The logic at saa7134-ts already does the right thing:
Using CONFIG_PM_SLEEP suppress the warnings when the driver is
compiled without PM sleep functions:
drivers/media/rc/st_rc.c:338:12: warning: ‘st_rc_suspend’ defined but not used [-Wunused-function]
drivers/media/rc/st_rc.c:359:12: warning: ‘st_rc_resume’ defined but not used [-Wunused-function]
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
[media] tuner-i2c: be consistent with I2C declaration
On alpha, gcc warns a log about signed/unsigned ballance, with
produces 3185 warnings. Ok, this is bogus, but it indicates that
the declaration at V4L2 side is not consistent with the one at
I2C.
With this trivial patch, the number of errors reduce to 2959
warnings. Still too much, but it is 7.1% less. So let's do it.
This driver requires support for DMA attrs function, and not
just DMA. Change the options accordingly to remove those errors:
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c: In function ‘bdisp_hw_free_nodes’:
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c:132:3: error: implicit declaration of function ‘dma_free_attrs’ [-Werror=implicit-function-declaration]
dma_free_attrs(ctx->bdisp_dev->dev,
^
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c: In function ‘bdisp_hw_alloc_nodes’:
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c:157:9: error: implicit declaration of function ‘dma_alloc_attrs’ [-Werror=implicit-function-declaration]
base = dma_alloc_attrs(dev, node_size * MAX_NB_NODE, &paddr,
^
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c:157:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
base = dma_alloc_attrs(dev, node_size * MAX_NB_NODE, &paddr,
^
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c: In function ‘bdisp_hw_alloc_filters’:
/devel/v4l/to_next/drivers/media/platform/sti/bdisp/bdisp-hw.c:219:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
base = dma_alloc_attrs(dev, size, &paddr, GFP_KERNEL | GFP_DMA, &attrs);
Also, get rid of bogus, unused and duplicated symbol declaration
for the config option done at bdisp/Kconfig.
Laurent Pinchart [Fri, 19 Jun 2015 11:50:07 +0000 (08:50 -0300)]
[media] vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers
Commit f61bf13b6a07 ("[media] vb2: add allow_zero_bytesused flag to the
vb2_queue struct") added a WARN_ONCE to catch usage of a deprecated API
using a zero value for v4l2_buffer.bytesused.
However, the condition is checked incorrectly, as the v4L2_buffer
bytesused field is supposed to be ignored for multiplanar buffers. This
results in spurious warnings when using the multiplanar API.
Fix it by checking v4l2_buffer.bytesused for uniplanar buffers and
v4l2_plane.bytesused for multiplanar buffers.
Fixes: f61bf13b6a07 ("[media] vb2: add allow_zero_bytesused flag to the vb2_queue struct") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: stable@vger.kernel.org # for v4.0 Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
That commit caused two regressions. The first is a BUG:
Jun 14 18:42:15 test-media kernel: [ 115.972299] BUG: unable to handle kernel NULL pointer dereference at 0000000000000100
Jun 14 18:42:15 test-media kernel: [ 115.972307] IP: [<ffffffff810d5cd0>] __lock_acquire+0x2f0/0x2070
Jun 14 18:42:15 test-media kernel: [ 115.972316] PGD 0
Jun 14 18:42:15 test-media kernel: [ 115.972318] Oops: 0000 [#1] PREEMPT SMP
Jun 14 18:42:15 test-media kernel: [ 115.972321] Modules linked in: vivid v4l2_dv_timings videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media vmw_balloon vmw_vmci acpi_cpufreq processor button
Jun 14 18:42:15 test-media kernel: [ 115.972333] CPU: 0 PID: 1542 Comm: v4l2-ctl Not tainted 4.1.0-rc3-test-media #1190
Jun 14 18:42:15 test-media kernel: [ 115.972336] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
Jun 14 18:42:15 test-media kernel: [ 115.972337] task: ffff880220ce4200 ti: ffff88021d16c000 task.ti: ffff88021d16c000
Jun 14 18:42:15 test-media kernel: [ 115.972339] RIP: 0010:[<ffffffff810d5cd0>] [<ffffffff810d5cd0>] __lock_acquire+0x2f0/0x2070
Jun 14 18:42:15 test-media kernel: [ 115.972342] RSP: 0018:ffff88021d16f9b8 EFLAGS: 00010002
Jun 14 18:42:15 test-media kernel: [ 115.972343] RAX: 0000000000000046 RBX: 0000000000000292 RCX: 0000000000000001
Jun 14 18:42:15 test-media kernel: [ 115.972345] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000100
Jun 14 18:42:15 test-media kernel: [ 115.972346] RBP: ffff88021d16fa88 R08: 0000000000000001 R09: 0000000000000000
Jun 14 18:42:15 test-media kernel: [ 115.972347] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
Jun 14 18:42:15 test-media kernel: [ 115.972348] R13: ffff880220ce4200 R14: 0000000000000100 R15: 0000000000000000
Jun 14 18:42:15 test-media kernel: [ 115.972350] FS: 00007f2441e7f740(0000) GS:ffff880236e00000(0000) knlGS:0000000000000000
Jun 14 18:42:15 test-media kernel: [ 115.972351] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Jun 14 18:42:15 test-media kernel: [ 115.972353] CR2: 0000000000000100 CR3: 0000000001e0b000 CR4: 00000000001406f0
Jun 14 18:42:15 test-media kernel: [ 115.972424] Stack:
Jun 14 18:42:15 test-media kernel: [ 115.972427] ffff88021d16fa98ffffffff810d654300000000000000060000000000000246
Jun 14 18:42:15 test-media kernel: [ 115.972431] ffff88021d16fa08ffffffff810d532dffff880220ce4a78ffff880200000000
Jun 14 18:42:15 test-media kernel: [ 115.972433] ffff88020000000100000000000000000000000000000001000000000093a4a0
Jun 14 18:42:15 test-media kernel: [ 115.972436] Call Trace:
Jun 14 18:42:15 test-media kernel: [ 115.972440] [<ffffffff810d6543>] ? __lock_acquire+0xb63/0x2070
Jun 14 18:42:15 test-media kernel: [ 115.972443] [<ffffffff810d532d>] ? mark_held_locks+0x6d/0xa0
Jun 14 18:42:15 test-media kernel: [ 115.972445] [<ffffffff810d37a8>] ? __lock_is_held+0x58/0x80
Jun 14 18:42:15 test-media kernel: [ 115.972447] [<ffffffff810d852c>] lock_acquire+0x6c/0xa0
Jun 14 18:42:15 test-media kernel: [ 115.972452] [<ffffffffa039f1f6>] ? vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:42:15 test-media kernel: [ 115.972458] [<ffffffff819b1a92>] down_read+0x42/0x60
Jun 14 18:42:15 test-media kernel: [ 115.972460] [<ffffffffa039f1f6>] ? vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:42:15 test-media kernel: [ 115.972463] [<ffffffff819af1b1>] ? mutex_lock_nested+0x2b1/0x560
Jun 14 18:42:15 test-media kernel: [ 115.972467] [<ffffffffa038fdc5>] ? vb2_queue_release+0x25/0x40 [videobuf2_core]
Jun 14 18:42:15 test-media kernel: [ 115.972469] [<ffffffffa039f1f6>] vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:42:15 test-media kernel: [ 115.972472] [<ffffffffa038b626>] __vb2_queue_free+0x146/0x5e0 [videobuf2_core]
Jun 14 18:42:15 test-media kernel: [ 115.972475] [<ffffffffa038fdd3>] vb2_queue_release+0x33/0x40 [videobuf2_core]
Jun 14 18:42:15 test-media kernel: [ 115.972478] [<ffffffffa038fe75>] _vb2_fop_release+0x95/0xb0 [videobuf2_core]
Jun 14 18:42:15 test-media kernel: [ 115.972481] [<ffffffffa038feb9>] vb2_fop_release+0x29/0x50 [videobuf2_core]
Jun 14 18:42:15 test-media kernel: [ 115.972485] [<ffffffffa03ad372>] vivid_fop_release+0x92/0x230 [vivid]
Jun 14 18:42:15 test-media kernel: [ 115.972491] [<ffffffffa0358460>] v4l2_release+0x30/0x80 [videodev]
Jun 14 18:42:15 test-media kernel: [ 115.972496] [<ffffffff811a51d5>] __fput+0xe5/0x200
Jun 14 18:42:15 test-media kernel: [ 115.972498] [<ffffffff811a5339>] ____fput+0x9/0x10
Jun 14 18:42:15 test-media kernel: [ 115.972501] [<ffffffff810a9fa4>] task_work_run+0xc4/0xf0
Jun 14 18:42:15 test-media kernel: [ 115.972504] [<ffffffff8108c670>] do_exit+0x3a0/0xaf0
Jun 14 18:42:15 test-media kernel: [ 115.972507] [<ffffffff819b3a9b>] ? _raw_spin_unlock_irq+0x2b/0x60
Jun 14 18:42:15 test-media kernel: [ 115.972509] [<ffffffff8108e0ff>] do_group_exit+0x4f/0xe0
Jun 14 18:42:15 test-media kernel: [ 115.972511] [<ffffffff8109a170>] get_signal+0x200/0x8c0
Jun 14 18:42:15 test-media kernel: [ 115.972514] [<ffffffff819b14b5>] ? __mutex_unlock_slowpath+0xf5/0x240
Jun 14 18:42:15 test-media kernel: [ 115.972518] [<ffffffff81002593>] do_signal+0x23/0x820
Jun 14 18:42:15 test-media kernel: [ 115.972521] [<ffffffff819b1609>] ? mutex_unlock+0x9/0x10
Jun 14 18:42:15 test-media kernel: [ 115.972524] [<ffffffffa0358648>] ? v4l2_ioctl+0x78/0xf0 [videodev]
Jun 14 18:42:15 test-media kernel: [ 115.972526] [<ffffffff819b4653>] ? int_very_careful+0x5/0x46
Jun 14 18:42:15 test-media kernel: [ 115.972529] [<ffffffff810d54bd>] ? trace_hardirqs_on_caller+0x15d/0x200
Jun 14 18:42:15 test-media kernel: [ 115.972531] [<ffffffff81002de0>] do_notify_resume+0x50/0x60
Jun 14 18:42:15 test-media kernel: [ 115.972533] [<ffffffff819b46a6>] int_signal+0x12/0x17
Jun 14 18:42:15 test-media kernel: [ 115.972534] Code: ca 81 31 c0 e8 7a e2 8c 00 e8 aa 1d 8d 00 0f 1f 44 00 00 31 db 48 81 c4 a8 00 00 00 89 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 66 90 <49> 81 3e 40 4e 02 82 b8 00 00 00 00 44 0f 44 e0 41 83 ff 01 0f
Jun 14 18:42:15 test-media kernel: [ 115.972567] RIP [<ffffffff810d5cd0>] __lock_acquire+0x2f0/0x2070
Jun 14 18:42:15 test-media kernel: [ 115.972569] RSP <ffff88021d16f9b8>
Jun 14 18:42:15 test-media kernel: [ 115.972570] CR2: 0000000000000100
Jun 14 18:42:15 test-media kernel: [ 115.972573] ---[ end trace 25595c2b8560cb57 ]---
Jun 14 18:42:15 test-media kernel: [ 115.972575] Fixing recursive fault but reboot is needed!
This can be reproduced by loading the vivid driver and running:
v4l2-ctl --stream-user
and pressing Ctrl-C. You may have to try a few times, but in my experience this BUG
is triggered quite quickly.
The second is a possible deadlock:
Jun 14 18:44:07 test-media kernel: [ 49.376650] ======================================================
Jun 14 18:44:07 test-media kernel: [ 49.376651] [ INFO: possible circular locking dependency detected ]
Jun 14 18:44:07 test-media kernel: [ 49.376653] 4.1.0-rc3-test-media #1190 Not tainted
Jun 14 18:44:07 test-media kernel: [ 49.376654] -------------------------------------------------------
Jun 14 18:44:07 test-media kernel: [ 49.376655] v4l2-compliance/1468 is trying to acquire lock:
Jun 14 18:44:07 test-media kernel: [ 49.376657] (&mm->mmap_sem){++++++}, at: [<ffffffffa03a81f6>] vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:44:07 test-media kernel: [ 49.376665]
Jun 14 18:44:07 test-media kernel: [ 49.376665] but task is already holding lock:
Jun 14 18:44:07 test-media kernel: [ 49.376666] (&q->mmap_lock){+.+...}, at: [<ffffffffa0398dc5>] vb2_queue_release+0x25/0x40 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376670]
Jun 14 18:44:07 test-media kernel: [ 49.376670] which lock already depends on the new lock.
Jun 14 18:44:07 test-media kernel: [ 49.376670]
Jun 14 18:44:07 test-media kernel: [ 49.376671]
Jun 14 18:44:07 test-media kernel: [ 49.376671] the existing dependency chain (in reverse order) is:
Jun 14 18:44:07 test-media kernel: [ 49.376672]
Jun 14 18:44:07 test-media kernel: [ 49.376672] -> #1 (&q->mmap_lock){+.+...}:
Jun 14 18:44:07 test-media kernel: [ 49.376675] [<ffffffff810d852c>] lock_acquire+0x6c/0xa0
Jun 14 18:44:07 test-media kernel: [ 49.376682] [<ffffffff819aef5e>] mutex_lock_nested+0x5e/0x560
Jun 14 18:44:07 test-media kernel: [ 49.376689] [<ffffffffa03934a2>] vb2_mmap+0x232/0x350 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376691] [<ffffffffa0395a60>] vb2_fop_mmap+0x20/0x30 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376694] [<ffffffffa0361102>] v4l2_mmap+0x52/0x90 [videodev]
Jun 14 18:44:07 test-media kernel: [ 49.376698] [<ffffffff81177e33>] mmap_region+0x3b3/0x5e0
Jun 14 18:44:07 test-media kernel: [ 49.376701] [<ffffffff81178377>] do_mmap_pgoff+0x317/0x400
Jun 14 18:44:07 test-media kernel: [ 49.376703] [<ffffffff81165320>] vm_mmap_pgoff+0x90/0xc0
Jun 14 18:44:07 test-media kernel: [ 49.376708] [<ffffffff81176867>] SyS_mmap_pgoff+0x1d7/0x280
Jun 14 18:44:07 test-media kernel: [ 49.376709] [<ffffffff81007f8d>] SyS_mmap+0x1d/0x20
Jun 14 18:44:07 test-media kernel: [ 49.376714] [<ffffffff819b44ae>] system_call_fastpath+0x12/0x76
Jun 14 18:44:07 test-media kernel: [ 49.376716]
Jun 14 18:44:07 test-media kernel: [ 49.376716] -> #0 (&mm->mmap_sem){++++++}:
Jun 14 18:44:07 test-media kernel: [ 49.376718] [<ffffffff810d79b3>] __lock_acquire+0x1fd3/0x2070
Jun 14 18:44:07 test-media kernel: [ 49.376720] [<ffffffff810d852c>] lock_acquire+0x6c/0xa0
Jun 14 18:44:07 test-media kernel: [ 49.376721] [<ffffffff819b1a92>] down_read+0x42/0x60
Jun 14 18:44:07 test-media kernel: [ 49.376723] [<ffffffffa03a81f6>] vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:44:07 test-media kernel: [ 49.376725] [<ffffffffa0394626>] __vb2_queue_free+0x146/0x5e0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376727] [<ffffffffa0398dd3>] vb2_queue_release+0x33/0x40 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376729] [<ffffffffa0398e75>] _vb2_fop_release+0x95/0xb0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376731] [<ffffffffa0398eb9>] vb2_fop_release+0x29/0x50 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376733] [<ffffffffa03b6372>] vivid_fop_release+0x92/0x230 [vivid]
Jun 14 18:44:07 test-media kernel: [ 49.376737] [<ffffffffa0361460>] v4l2_release+0x30/0x80 [videodev]
Jun 14 18:44:07 test-media kernel: [ 49.376739] [<ffffffff811a51d5>] __fput+0xe5/0x200
Jun 14 18:44:07 test-media kernel: [ 49.376744] [<ffffffff811a5339>] ____fput+0x9/0x10
Jun 14 18:44:07 test-media kernel: [ 49.376746] [<ffffffff810a9fa4>] task_work_run+0xc4/0xf0
Jun 14 18:44:07 test-media kernel: [ 49.376749] [<ffffffff81002dd1>] do_notify_resume+0x41/0x60
Jun 14 18:44:07 test-media kernel: [ 49.376752] [<ffffffff819b46a6>] int_signal+0x12/0x17
Jun 14 18:44:07 test-media kernel: [ 49.376754]
Jun 14 18:44:07 test-media kernel: [ 49.376754] other info that might help us debug this:
Jun 14 18:44:07 test-media kernel: [ 49.376754]
Jun 14 18:44:07 test-media kernel: [ 49.376755] Possible unsafe locking scenario:
Jun 14 18:44:07 test-media kernel: [ 49.376755]
Jun 14 18:44:07 test-media kernel: [ 49.376756] CPU0 CPU1
Jun 14 18:44:07 test-media kernel: [ 49.376757] ---- ----
Jun 14 18:44:07 test-media kernel: [ 49.376758] lock(&q->mmap_lock);
Jun 14 18:44:07 test-media kernel: [ 49.376759] lock(&mm->mmap_sem);
Jun 14 18:44:07 test-media kernel: [ 49.376760] lock(&q->mmap_lock);
Jun 14 18:44:07 test-media kernel: [ 49.376761] lock(&mm->mmap_sem);
Jun 14 18:44:07 test-media kernel: [ 49.376763]
Jun 14 18:44:07 test-media kernel: [ 49.376763] *** DEADLOCK ***
Jun 14 18:44:07 test-media kernel: [ 49.376763]
Jun 14 18:44:07 test-media kernel: [ 49.376764] 2 locks held by v4l2-compliance/1468:
Jun 14 18:44:07 test-media kernel: [ 49.376765] #0: (&dev->mutex#3){+.+.+.}, at: [<ffffffffa0398e0a>] _vb2_fop_release+0x2a/0xb0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376770] #1: (&q->mmap_lock){+.+...}, at: [<ffffffffa0398dc5>] vb2_queue_release+0x25/0x40 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376773]
Jun 14 18:44:07 test-media kernel: [ 49.376773] stack backtrace:
Jun 14 18:44:07 test-media kernel: [ 49.376776] CPU: 2 PID: 1468 Comm: v4l2-compliance Not tainted 4.1.0-rc3-test-media #1190
Jun 14 18:44:07 test-media kernel: [ 49.376777] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
Jun 14 18:44:07 test-media kernel: [ 49.376779] ffffffff8279e0b0ffff88021d6f7ba8ffffffff819a7aac0000000000000011
Jun 14 18:44:07 test-media kernel: [ 49.376781] ffffffff8279e0b0ffff88021d6f7bf8ffffffff819a3964ffff88021d6f7bd8
Jun 14 18:44:07 test-media kernel: [ 49.376783] ffff8800ac8aa1000000000000000002ffff8800ac8aa9a00000000000000002
Jun 14 18:44:07 test-media kernel: [ 49.376785] Call Trace:
Jun 14 18:44:07 test-media kernel: [ 49.376788] [<ffffffff819a7aac>] dump_stack+0x4f/0x7b
Jun 14 18:44:07 test-media kernel: [ 49.376792] [<ffffffff819a3964>] print_circular_bug+0x20f/0x251
Jun 14 18:44:07 test-media kernel: [ 49.376793] [<ffffffff810d79b3>] __lock_acquire+0x1fd3/0x2070
Jun 14 18:44:07 test-media kernel: [ 49.376795] [<ffffffff810d6543>] ? __lock_acquire+0xb63/0x2070
Jun 14 18:44:07 test-media kernel: [ 49.376797] [<ffffffff810d37a8>] ? __lock_is_held+0x58/0x80
Jun 14 18:44:07 test-media kernel: [ 49.376798] [<ffffffff810d852c>] lock_acquire+0x6c/0xa0
Jun 14 18:44:07 test-media kernel: [ 49.376800] [<ffffffffa03a81f6>] ? vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:44:07 test-media kernel: [ 49.376802] [<ffffffff819b1a92>] down_read+0x42/0x60
Jun 14 18:44:07 test-media kernel: [ 49.376803] [<ffffffffa03a81f6>] ? vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:44:07 test-media kernel: [ 49.376805] [<ffffffff819af1b1>] ? mutex_lock_nested+0x2b1/0x560
Jun 14 18:44:07 test-media kernel: [ 49.376807] [<ffffffffa0398dc5>] ? vb2_queue_release+0x25/0x40 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376808] [<ffffffffa03a81f6>] vb2_vmalloc_put_userptr+0x36/0x110 [videobuf2_vmalloc]
Jun 14 18:44:07 test-media kernel: [ 49.376810] [<ffffffffa0398e0a>] ? _vb2_fop_release+0x2a/0xb0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376812] [<ffffffffa0394626>] __vb2_queue_free+0x146/0x5e0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376814] [<ffffffffa0398dd3>] vb2_queue_release+0x33/0x40 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376816] [<ffffffffa0398e75>] _vb2_fop_release+0x95/0xb0 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376818] [<ffffffffa0398eb9>] vb2_fop_release+0x29/0x50 [videobuf2_core]
Jun 14 18:44:07 test-media kernel: [ 49.376820] [<ffffffffa03b6372>] vivid_fop_release+0x92/0x230 [vivid]
Jun 14 18:44:07 test-media kernel: [ 49.376822] [<ffffffffa0361460>] v4l2_release+0x30/0x80 [videodev]
Jun 14 18:44:07 test-media kernel: [ 49.376824] [<ffffffff811a51d5>] __fput+0xe5/0x200
Jun 14 18:44:07 test-media kernel: [ 49.376825] [<ffffffff819b4653>] ? int_very_careful+0x5/0x46
Jun 14 18:44:07 test-media kernel: [ 49.376827] [<ffffffff811a5339>] ____fput+0x9/0x10
Jun 14 18:44:07 test-media kernel: [ 49.376828] [<ffffffff810a9fa4>] task_work_run+0xc4/0xf0
Jun 14 18:44:07 test-media kernel: [ 49.376830] [<ffffffff81002dd1>] do_notify_resume+0x41/0x60
Jun 14 18:44:07 test-media kernel: [ 49.376832] [<ffffffff819b46a6>] int_signal+0x12/0x17
This can be triggered by loading the vivid module with the module option 'no_error_inj=1'
and running 'v4l2-compliance -s5'. Again, it may take a few attempts to trigger this
but for me it happens quite quickly.
Without this patch I cannot reproduce these two issues. So reverting is the best
solution for now.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Jan Kara <jack@suse.cz> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/mantis/mantis_i2c.c: In function 'mantis_i2c_init':
drivers/media/pci/mantis/mantis_i2c.c:222:15: warning: variable 'intmask' set but not used [-Wunused-but-set-variable]
u32 intstat, intmask;
There are several warnings there, on some architectures, related
to dividing a s32 by a s64 value:
drivers/media/platform/sti/bdisp/bdisp-debug.c:594: warning: comparison of distinct pointer types lacks a cast
drivers/media/platform/sti/bdisp/bdisp-debug.c:594: warning: right shift count >= width of type
drivers/media/platform/sti/bdisp/bdisp-debug.c:594: warning: passing argument 1 of '__div64_32' from incompatible pointer type
drivers/media/platform/sti/bdisp/bdisp-debug.c:595: warning: comparison of distinct pointer types lacks a cast
drivers/media/platform/sti/bdisp/bdisp-debug.c:595: warning: right shift count >= width of type
drivers/media/platform/sti/bdisp/bdisp-debug.c:595: warning: passing argument 1 of '__div64_32' from incompatible pointer type CC [M] drivers/media/tuners/mt2060.o
drivers/media/platform/sti/bdisp/bdisp-debug.c:596: warning: comparison of distinct pointer types lacks a cast
drivers/media/platform/sti/bdisp/bdisp-debug.c:596: warning: right shift count >= width of type
drivers/media/platform/sti/bdisp/bdisp-debug.c:596: warning: passing argument 1 of '__div64_32' from incompatible pointer type
drivers/media/platform/sti/bdisp/bdisp-debug.c:597: warning: comparison of distinct pointer types lacks a cast
drivers/media/platform/sti/bdisp/bdisp-debug.c:597: warning: right shift count >= width of type
drivers/media/platform/sti/bdisp/bdisp-debug.c:597: warning: passing argument 1 of '__div64_32' from incompatible pointer type
That doesn't make much sense. What the driver is actually trying
to do is to divide one second by a value. So, check the range
before dividing. That warrants the right result and will remove
the warnings on non-64 bits archs.
Also fixes this warning:
drivers/media/platform/sti/bdisp/bdisp-debug.c:588: warning: comparison of distinct pointer types lacks a cast
by using div64_s64() instead of calling do_div() directly.
[media] cx88: don't declare restart_video_queue if not used
While compiled on alpha, got this error:
drivers/media/pci/cx88/cx88-video.c:415:12: warning: 'restart_video_queue' defined but not used [-Wunused-function]
drivers/media/platform/sti/bdisp/bdisp-v4l2.c: In function 'bdisp_register_device':
drivers/media/platform/sti/bdisp/bdisp-v4l2.c:1024:26: warning: variable 'pdev' set but not used [-Wunused-but-set-variable]
struct platform_device *pdev;
Fabien Dessenne [Wed, 10 Jun 2015 10:19:37 +0000 (07:19 -0300)]
[media] bdisp: remove needless check
As reported by smatch:
drivers/media/platform/sti/bdisp/bdisp-v4l2.c:947 bdisp_s_selection() warn: unsigned 'out.width' is never less than zero.
drivers/media/platform/sti/bdisp/bdisp-v4l2.c:947 bdisp_s_selection() warn: unsigned 'out.height' is never less than zero.
Indeed, width and height are unsigned.
drivers/built-in.o: In function `ts2020_read_signal_strength':
ts2020.c:(.text+0x298ff94): undefined reference to `__divdi3'
ts2020.c:(.text+0x298ffd4): undefined reference to `__divdi3'
ts2020.c:(.text+0x298fffd): undefined reference to `__divdi3'
Makefile:921: recipe for target 'vmlinux' failed
Jan Klötzke [Sat, 6 Jun 2015 19:58:13 +0000 (16:58 -0300)]
[media] mantis: add remote control support
The embedded UART is apparently used to receive decoded IR (RC5?) codes.
Forward these scan codes to the RC framework and (where known) add
corresponding mapping tables to translate them into regular keys.
This patch has been tested on a TechniSat CableStar HD2. The mappings of other
rc-maps were taken from Christoph Pinkl's patch
(http://patchwork.linuxtv.org/patch/7217/) and the s2-liplianin repository. The
major difference to Christoph's patch is a reworked interrupt handling of the
UART because the RX interrupt is apparently level triggered and requires
masking until the FIFO is read by the UART worker.
Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Jan Klötzke [Sat, 6 Jun 2015 19:58:12 +0000 (16:58 -0300)]
[media] rc/keymaps: add keytable for Twinhan DTV CAB CI
This RC map was taken from Christoph Pinkl's patch
(http://patchwork.linuxtv.org/patch/7217/). It is used solely by the respective
mantis based card because the encoding is not known.
Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Jan Klötzke [Sat, 6 Jun 2015 19:58:11 +0000 (16:58 -0300)]
[media] rc/keymaps: add keytable for Terratec Cinergy S2 HD
This RC map was taken from Christoph Pinkl's patch
(http://patchwork.linuxtv.org/patch/7217/). It is used solely by the respective
mantis based card because the encoding is not known.
Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Jan Klötzke [Sat, 6 Jun 2015 19:58:10 +0000 (16:58 -0300)]
[media] rc/keymaps: add keytable for Terratec Cinergy C PCI
This RC map was taken from Christoph Pinkl's patch
(http://patchwork.linuxtv.org/patch/7217/). It is used solely by the respective
mantis based card because the encoding is not known.
Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Jan Klötzke [Sat, 6 Jun 2015 19:58:09 +0000 (16:58 -0300)]
[media] rc/keymaps: add RC keytable for TechniSat TS35
The TS35 remote is distributed with TechniSat CableStar HD2 cards (mantis
chipset). The exact protocol type is unknown, making this rc map probably only
usable by mantis cards.
Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[media] s5k5baf: Convert use of __constant_cpu_to_be16 to cpu_to_be16
In little endian cases, macro cpu_to_be16 unfolds to __swab16 which
provides special case for constants. In big endian cases,
__constant_cpu_to_be16 and cpu_to_be16 expand directly to the
same expression. So, replace __constant_cpu_to_be16 with
cpu_to_be16 with the goal of getting rid of the definition of
__constant_cpu_to_be16 completely.
The semantic patch that performs this transformation is as follows:
David Howells [Wed, 3 Jun 2015 11:35:08 +0000 (08:35 -0300)]
[media] ts2020: Allow stats polling to be suppressed
Statistics polling can not be done by lmedm04 driver's implementation of
M88RS2000/TS2020 because I2C messages stop the device's demuxer, so allow
polling for statistics to be suppressed in the ts2020 driver by setting
dont_poll in the ts2020_config struct.
David Howells [Tue, 26 May 2015 15:04:07 +0000 (12:04 -0300)]
[media] ts2020: Provide DVBv5 API signal strength
Provide a DVBv5 API signal strength. This is in units of 0.001 dBm rather
than a percentage.
>From Antti Palosaari's testing with a signal generator, it appears that the
gain calculated according to Montage's specification if negated is a
reasonable representation of the signal strength of the generator.
To this end:
(1) Polled statistic gathering needed to be implemented in the TS2020 driver.
This is done in the ts2020_stat_work() function.
(2) The calculated gain is placed as the signal strength in the
dtv_property_cache associated with the front end with the scale set to
FE_SCALE_DECIBEL.
(3) The DVBv3 format signal strength then needed to be calculated from the
signal strength stored in the dtv_property_cache rather than accessing
the value when ts2020_read_signal_strength() is called.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
David Howells [Tue, 26 May 2015 15:04:00 +0000 (12:04 -0300)]
[media] TS2020: Calculate tuner gain correctly
The TS2020 and TS2022 tuners take an input from the demodulator indicating the
AGC setting on that component that is then used to influence the tuner's own
gain. This should be taken into account when calculating the gain and signal
strength.
Further, the existing TS2020 driver miscalculates the signal strength as the
result of its calculations can exceed the storage capacity of the 16-bit word
used to return it to userspace.
To this end:
(1) Add a callback function (->get_agc_pwm()) in the ts2020_config struct that
the tuner can call to get the AGC PWM value from the demodulator.
(2) Modify the TS2020 driver to calculate the gain according to Montage's
specification with the adjustment that we produce a negative value and
scale it to 0.001dB units (which is what the DVBv5 API will require):
(a) Callback to the demodulator to retrieve the AGC PWM value and then
turn that into Vagc for incorporation in the calculations. If the
callback is unset, assume a Vagc of 0.
(b) Calculate the tuner gain from a combination of Vagc and the tuner's RF
gain and baseband gain settings.
(3) Turn this into a percentage signal strength as per Montage's
specification for return to userspace with the DVBv3 API.
(4) Provide a function in the M88DS3103 demodulator driver that can be used to
get the AGC PWM value on behalf of the tuner.
(5) The ts2020_config.get_agc_pwm function should be set by the code that
stitches together the drivers for each card.
For the DVBSky cards that use the M88DS3103 with the TS2020 or the TS2022,
set the get_agc_pwm function to point to m88ds3103_get_agc_pwm.
I have tested this with a DVBSky S952 card which has an M88DS3103 and a TS2022.
Thanks to Montage for providing access to information about the workings of
these parts.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Fri, 17 Apr 2015 01:43:52 +0000 (22:43 -0300)]
[media] m88ds3103: use regmap for I2C register access
Use regmap for I2C register access.
Remove own I2C repeated mutex as it should not be needed. I2C adapter
lock is already taken when I2C mux adapter is called, no need for
double locking.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
David Howells [Thu, 2 Apr 2015 11:03:11 +0000 (08:03 -0300)]
[media] ts2020: Add a comment about lifetime of on-stack pdata in ts2020_attach()
ts2020_attach() allocates a variable pdata on the stack and then passes a
pointer to it to i2c_new_device() which stashes the pointer in persistent
structures.
Add a comment to the effect that this isn't actually an error because the
contents of the variable are only used in ts2020_probe() and this is only
called ts2020_attach()'s stack frame exists.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 26 Mar 2015 23:20:42 +0000 (20:20 -0300)]
[media] ts2020: register I2C driver from legacy media attach
Register driver using I2C bindings internally when legacy media
attach is used. That is done by registering driver using I2C binding
from legacy attach. That way we can get valid I2C client, which is
needed for proper dev_() logging and regmap for example even legacy
binding is used.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 26 Mar 2015 13:04:09 +0000 (10:04 -0300)]
[media] ts2020: re-implement PLL calculations
Used frequency synthesizer is simple Integer-N PLL, with configurable
reference divider, output divider and of course N itself. Old
calculations were working fine, but not so easy to understand.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Wed, 10 Jun 2015 05:45:45 +0000 (02:45 -0300)]
[media] cobalt: fix 64-bit division
There are still some 64-bit division problems in the cobalt code.
Replace it by div_u64.
[mchehab@osg.samsung.com: folded with an additional diff sent by
Hans via a priv e-mail] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Tina Ruchandani [Sun, 31 May 2015 07:17:06 +0000 (04:17 -0300)]
[media] dvb-frontend: Replace timeval with ktime_t
struct timeval uses a 32-bit seconds representation which will
overflow in the year 2038 and beyond. This patch replaces
the usage of struct timeval with ktime_t which is a 64-bit
timestamp and is year 2038 safe.
This patch is part of a larger attempt to remove all instances
of 32-bit timekeeping variables (timeval, timespec, time_t)
which are not year 2038 safe, from the kernel.
Jemma Denson [Sat, 30 May 2015 18:10:06 +0000 (15:10 -0300)]
[media] b2c2: Add option to skip the first 6 pid filters
The flexcop bridge chip has two banks of hardware pid filters -
an initial 6, and on some chip revisions an additional bank of 32.
A bug is present on the initial 6 - when changing transponders
one of two PAT packets from the old transponder would be included
in the initial packets from the new transponder. This usually
transpired with userspace programs complaining about services
missing, because they are seeing a PAT that they would not be
expecting. Running in full TS mode does not exhibit this problem,
neither does using just the additional 32.
This patch adds in an option to not use the inital 6 and solely use
just the additional 32, and enables this option for the SkystarS2
card. Other cards can be added as required if they also have
this bug.
[media] ddbridge: Do not free_irq() if request_irq() failed
My static checker detected that free_irq() is called even after
request_irq() failed in ddb_probe(). In this case, the kernel may try to
free dev->pdev->irq although the IRQ is not assigned. This event rarely
occurs, but always introduces a warning if it happens.
"goto fail1" always results in disabling enabled MSI and releasing a
requested IRQ. It seems like the former handling is necessary. So I added
a conditional branch before the free_irq() (stat == 0 means request_irq()
succeeds).
[media] Staging: media: lirc: Replace timeval with ktime_t
'struct timeval last_tv' is used to get the time of last signal change
and 'struct timeval last_intr_tv' is used to get the time of last UART
interrupt.
32-bit systems using 'struct timeval' will break in the year 2038, so we
have to replace that code with more appropriate types.
Here struct timeval is replaced with ktime_t.
Jemma Denson [Thu, 21 May 2015 09:29:23 +0000 (06:29 -0300)]
[media] b2c2: Mismatch in config ifdefs for SkystarS2
Compilation warning issued by kbuild test robot:
>> drivers/media/common/b2c2/flexcop-fe-tuner.c:31:12: warning: 'flexcop_fe_request_firmware' defined but not used [-Wunused-function]
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
This patch fixes a mismatch in Kconfig define checks. One had a
check for just CX24120, the other is checking for both CX24120
and ISL6421.
The coda tracing code causes lots of warnings like
In file included from /git/arm-soc/include/trace/define_trace.h:90:0,
from /git/arm-soc/drivers/media/platform/coda/trace.h:203,
from /git/arm-soc/drivers/media/platform/coda/coda-bit.c:34:
/git/arm-soc/include/trace/ftrace.h:28:0: warning: "TRACE_SYSTEM_STRING" redefined
#define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
^
In file included from /git/arm-soc/include/trace/define_trace.h:83:0,
from /git/arm-soc/drivers/media/platform/coda/trace.h:203,
from /git/arm-soc/drivers/media/platform/coda/coda-bit.c:34:
/git/arm-soc/drivers/media/platform/coda/./trace.h:12:0: note: this is the location of the previous definition
#define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM)
>From what I can tell, this is just the result of a bogus TRACE_SYSTEM_STRING
definition, and removing that one makes the warnings go away.
The subdev API is optional. No driver should depend on it.
Avoid compilation breakages if subdev API is not selected:
drivers/media/i2c/ov2659.c: In function ‘ov2659_get_fmt’:
drivers/media/i2c/ov2659.c:1054:3: error: implicit declaration of function ‘v4l2_subdev_get_try_format’ [-Werror=implicit-function-declaration]
mf = v4l2_subdev_get_try_format(sd, cfg, 0);
^
drivers/media/i2c/ov2659.c:1054:6: warning: assignment makes pointer from integer without a cast
mf = v4l2_subdev_get_try_format(sd, cfg, 0);
^
drivers/media/i2c/ov2659.c: In function ‘ov2659_set_fmt’:
drivers/media/i2c/ov2659.c:1129:6: warning: assignment makes pointer from integer without a cast
mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
^
drivers/media/i2c/ov2659.c: In function ‘ov2659_open’:
drivers/media/i2c/ov2659.c:1264:38: error: ‘struct v4l2_subdev_fh’ has no member named ‘pad’
v4l2_subdev_get_try_format(sd, fh->pad, 0);
^
Fabien Dessenne [Tue, 12 May 2015 16:02:10 +0000 (13:02 -0300)]
[media] bdisp: 2D blitter driver using v4l2 mem2mem framework
This v4l2 mem2mem driver is a 2D blitter for STMicroelectronics SoC.
It uses the v4l2 mem2mem framework.
The following features are supported and tested:
- Color format conversion (RGB32, RGB24, RGB16, NV12, YUV420P)
- Copy
- Scale
- Flip
- Deinterlace
- Wide (4K) picture support
- Crop
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: added missing slab.h include to bdisp-v4l2.c]
There are several anonymous enums here, used via a typedef.
Well, we don't like typedefs on Kernel, so let's de-anonimize
those enums. Then, latter, we may be able to get rid of the
typedefs, at least from Kernelspace.
The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.
So, let's do it.
This patch was generated by this shell script:
for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done
While here, make CodingStyle fixes on the affected lines.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
[media] DocBook: properly document the delivery systems
Use a table for the delivery systems. The table is organized
by the type (cable, satellite, terrestrial) and shows what
standards are not fully implemented.
[media] DocBook: add placeholders for ATSC M/H properties
The ATSC M/H specific properties are not properly documented.
This became crearer when converting the existing data into
tables and adding cross references.
For now, just add placeholders, as a further investigation
about the meaning of each parameter is required.
Cc: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
enum fe_caps is documented at FE_GET_INFO ioctl. Add xrefs
for each entry there. This makes the hyperlinks at frontend.h
to go directly to the right documentation.
Hans Verkuil [Sat, 6 Jun 2015 08:02:32 +0000 (05:02 -0300)]
[media] cx231xx: fix compiler warning
Fix this compiler warning by allocating a structure to read the eeprom instead
of doing it on the stack and worse: the eeprom array is static, so that can
cause problems if there are multiple cx231xx instances.
cx231xx-cards.c: In function 'cx231xx_card_setup':
cx231xx-cards.c:1110:1: warning: the frame size of 2064 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
I did consider removing the code altogether since the result is actually
not used at the moment, but I decided against it since it is used in other
drivers and someone might want to start using it in this driver as well. And
then it is useful that the code is already there.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prashant Laddha [Fri, 22 May 2015 05:27:34 +0000 (02:27 -0300)]
[media] v4l2-dv-timings: add interlace support in detect cvt/gtf
Extend detect_cvt/gtf API to indicate the format type (interlaced
or progressive). In case of interlaced, the vertical front and back
porch and vsync values for both (odd,even) fields are considered to
derive image height. Populated vsync, vertical front, back porch
values in bt timing structure for even and odd fields and updated
the flags appropriately.
Also modified the functions calling the detect_cvt/gtf(). As of now
these functions are calling detect_cvt/gtf() with interlaced flag
set to false.
Hans Verkuil [Fri, 5 Jun 2015 08:30:02 +0000 (05:30 -0300)]
[media] v4l2-dv-timings: support interlaced in v4l2_print_dv_timings
The v4l2_print_dv_timings() didn't log the interlaced format correctly. The timings
for the bottom field weren't logged and the fields per second value was half of what
it should have been.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prashant Laddha [Fri, 5 Jun 2015 08:13:31 +0000 (05:13 -0300)]
[media] v4l2-dv-timing: avoid rounding twice in gtf hblank calc
Currently, in gtf hblank calculations, the rounding is used twice,
one at intermediate division and one at final state where hblank
is rounded to nearest multiple of twice cell granularity. This
error got introduced in 'commit d7ed5a3ddaec ("[media]
v4l2-dv-timings: fix rounding in hblank and hsync calculation"),
where it missed combining the rounding step. Correcting the same
in this patch.
Hans Verkuil [Sun, 7 Jun 2015 10:32:32 +0000 (07:32 -0300)]
[media] adv7511: log the currently set infoframes
The adv7511 sets up InfoFrames that are used when transmitting video.
Log the contents of those InfoFrames so it is possible to see exactly what
the transmitter is sending.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>