21 Apr, 2016
26 commits
-
The test pattern generator will be used by other drivers as the virtual
media controller (vimc)Signed-off-by: Helen Mae Koike Fornazier
Acked-by: Laurent Pinchart
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The v4l2_rect helper functions have been moved to
include/media/v4l2-rect.h. Use this new header, dropping the functions
from vivid.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
This makes it easier to share this code with any driver that needs to
manipulate the v4l2_rect datastructure.Signed-off-by: Hans Verkuil
Acked-by: Sakari Ailus
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Instead of rolling our own define, just use the new mask defines.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The v4l2_device_call_* defines filter subdevs based on the grp_id value.
But some drivers use a bitmask, so instead of filtering by grp_id == value,
you want to filter by grp_id & value.Make variants of these defines to do this.
The 'has_op' define has been extended to have a grp_id argument as well, and
a mask variant has been added.This extra argument required a change to go7007.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The ADV7180 supports NTSC, PAL and SECAM.
Signed-off-by: Niklas Söderlund
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Add support to get the pixel aspect ratio depending on the current
standard (50 vs 60 Hz).Signed-off-by: Niklas Söderlund
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Add support to get the standard to the adv7180 driver.
Signed-off-by: Niklas Söderlund
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
This patch defines region_configs[] array as const array since it
is not changed anywhere in code.Signed-off-by: Claudiu Beznea
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The DV_TIMINGS_CAP documentation didn't state clearly that the pad and
reserved fields should be zeroed by the application. For subdev pad can
be other values as well.It also mistakenly said that only drivers would have to zero the reserved
field, that's not correct.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The ENUM_DV_TIMINGS documentation did not clearly state that the pad and reserved
fields should be zeroed (pad only when used with a video device node).Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The G/S_EDID documentation did not explicitly state that the reserved array
should be zeroed by the application.Also add the missing VIDIOC_SUBDEV_G/S_EDID ioctl names to the header.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
v4l2-compliance complained about this.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Fix this smatch error:
dib0090.c:1124 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
These are false positives, but still easy to fix.
pvrusb2-hdw.c:3676 pvr2_send_request_ex() error: we previously assumed 'write_data' could be null (see line 3648)
pvrusb2-hdw.c:3829 pvr2_send_request_ex() error: we previously assumed 'read_data' could be null (see line 3649)Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The smatch utility got really confused about the grp % 22 code. Rewrote
it so it now understands that there really isn't a buffer overwrite.vivid-rds-gen.c:82 vivid_rds_generate() error: buffer overflow 'rds->psname' 9
Signed-off-by: Mauro Carvalho Chehab -
Set vb2_queue.gfp_flags to GFP_DMA32. Otherwise it will start to
create bounce buffers which is something you want to avoid since
those are in limited supply.Without this patch, DMA scatter-gather may not work because
machines can ran out of buffers easily.Signed-off-by: Ezequiel Garcia
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The mainline tw686x driver also supports audio, that's missing here
as well.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Set vb2_queue.gfp_flags to GFP_DMA32. Otherwise it will start to
create bounce buffers which is something you want to avoid since
those are in limited supply.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
the dma_requests field is cached, but cache is not used:
drivers/staging/media/tw686x-kh/tw686x-kh-video.c: In function 'tw686x_video_irq':
drivers/staging/media/tw686x-kh/tw686x-kh-video.c:622:6: warning: variable 'requests' set but not used [-Wunused-but-set-variable]
u32 requests;
^Use the cache instead, as it seems reading it needs to be done
with spin lock taken.Signed-off-by: Mauro Carvalho Chehab
-
This commit introduces the support for the Techwell TW686x video
capture IC. This hardware supports a few DMA modes, including
scatter-gather and frame (contiguous).This commit makes little use of the DMA engine and instead has
a memcpy based implementation. DMA frame and scatter-gather modes
support may be added in the future.Currently supported chips:
- TW6864 (4 video channels),
- TW6865 (4 video channels, not tested, second generation chip),
- TW6868 (8 video channels but only 4 first channels using
built-in video decoder are supported, not tested),
- TW6869 (8 video channels, second generation chip).[mchehab@osg.samsung.com: make checkpatch happy by using "unsigned int"
instead of just "unsigned"]
Cc: Krzysztof Halasa
Signed-off-by: Ezequiel Garcia
Signed-off-by: Hans Verkuil
Tested-by: Hans VerkuilSigned-off-by: Mauro Carvalho Chehab
-
A driver for Intersil/Techwell TW686x-based PCIe frame grabbers.
[hans.verkuil@cisco.com: renamed staging tw686x to tw686x-kh to prevent naming conflicts]
[hans.verkuil@cisco.com: don't build tw686x-kh if tw686x is already selected to prevent conflicts]
[mchehab@osg.samsung.com: use "unsigned int" instead of just "unsigned" and add some whitespaces to make checkpatch happier]
Signed-off-by: Krzysztof Halasa
Signed-off-by: Hans Verkuil
Tested-by: Hans VerkuilSigned-off-by: Mauro Carvalho Chehab
-
Those callbacks are called with the media_device.graph_mutex held.
Add a note about that, as the code called by those notifiers should
not be touching in the mutex.Acked-by: Sakari Ailus
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Right now, the lock schema for media_device struct is messy,
since sometimes, it is protected via a spin lock, while, for
media graph traversal, it is protected by a mutex.Solve this conflict by always using a mutex.
As a side effect, this prevents a bug when the media notifiers
is called at atomic context, while running the notifier callback:BUG: sleeping function called from invalid context at mm/slub.c:1289
in_atomic(): 1, irqs_disabled(): 0, pid: 3479, name: modprobe
4 locks held by modprobe/3479:
#0: (&dev->mutex){......}, at: [] __driver_attach+0xa3/0x160
#1: (&dev->mutex){......}, at: [] __driver_attach+0xb1/0x160
#2: (register_mutex#5){+.+.+.}, at: [] usb_audio_probe+0x257/0x1c90 [snd_usb_audio]
#3: (&(&mdev->lock)->rlock){+.+.+.}, at: [] media_device_register_entity+0x1cb/0x700 [media]
CPU: 2 PID: 3479 Comm: modprobe Not tainted 4.5.0-rc3+ #49
Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
0000000000000000 ffff8803b3f6f288 ffffffff81933901 ffff8803c4bae000
ffff8803c4bae5c8 ffff8803b3f6f2b0 ffffffff811c6af5 ffff8803c4bae000
ffffffff8285d7f6 0000000000000509 ffff8803b3f6f2f0 ffffffff811c6ce5
Call Trace:
[] dump_stack+0x85/0xc4
[] ___might_sleep+0x245/0x3a0
[] __might_sleep+0x95/0x1a0
[] kmem_cache_alloc_trace+0x20e/0x300
[] ? media_add_link+0x4d/0x140 [media]
[] media_add_link+0x4d/0x140 [media]
[] media_create_pad_link+0xa1/0x600 [media]
[] au0828_media_graph_notify+0x173/0x360 [au0828]
[] ? media_gobj_create+0x1ba/0x480 [media]
[] media_device_register_entity+0x3ab/0x700 [media]Reviewed-by: Javier Martinez Canillas
Acked-by: Sakari Ailus
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
14 Apr, 2016
14 commits
-
s32tmp in the below code may be negative, and dev->mclk_khz is an
unsigned type.s32tmp = 0x10000 * (tuner_frequency - c->frequency);
s32tmp = DIV_ROUND_CLOSEST(s32tmp, dev->mclk_khz);This is undefined, as DIV_ROUND_CLOSEST is undefined for negative
dividends when the divisor is of unsigned type.So, change mclk_khz to be signed (s32).
Signed-off-by: Peter Rosin
Signed-off-by: Antti Palosaari
Signed-off-by: Mauro Carvalho Chehab -
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.Acked-by: Geert Uytterhoeven
Acked-by: Hans Verkuil
Signed-off-by: Simon Horman
Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The maximum image size supported by the WPF is 2048x2048 on Gen2 and
8190x8190 on Gen3. Update the code accordingly, and fix the maximum LIF
size for both Gen2 and Gen3.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The format is erroneously defined with an alpha channel. Fix it.
Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Make the global alpha multiplier of DRM planes configurable. All the
necessary infrastructure is there, we just need to store the alpha value
passed through the DRM API.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Make the Z-order of planes configurable by assigning RPFs to BRU inputs
dynamically based on the Z-order position.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The Gen3 RPF includes an alpha multiplier that can both multiply the
alpha channel by a fixed global alpha value, and multiply the pixel
components to convert the input to premultiplied alpha.As alpha premultiplication is available in the BRU for both Gen2 and
Gen3 we handle it there and use the Gen3 alpha multiplier for global
alpha multiplication only. This prevents conversion to premultiplied
alpha if no BRU is present in the pipeline, that use case will be
implemented later if needed.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Synchronize the userspace LUT setup with the pipeline operation by using
a display list fragment to store LUT data.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Display lists support up to 8 bodies but we currently use a single one.
To support preparing display lists for large look-up tables, add support
for multi-body display lists.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The vsp1_dl_list_put() function expects to be called with the display
list manager lock held. This assumption is correct for calls from within
the vsp1_dl.c file, but not for the external calls. Fix it by taking the
lock inside the function and providing an unlocked version for the
internal callers.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The field takes positive values only, make it unsigned.
Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
The LUT set format handler overrides the requested format by mistake.
Fix it.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Most of the entities can't perform scaling and implement the same frame
size enumeration function. Factorize the code into a single
implementation.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
There are some issues rised on this patch during patch review.
I ended by merging this one by mistake. So, let's revert it.This reverts commit 54ace1cfd4358fd11112f17cc711eea234d5ab9e.
Cc: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab