Dan Carpenter [Thu, 22 Dec 2011 05:29:07 +0000 (02:29 -0300)]
[media] Staging: dt3155v4l: update to newer API
I changed the function definitions for dt3155_queue_setup() to match the
newer API. The dt3155_start_streaming() function didn't do anything so
I just removed it.
This silences the following gcc warnings:
drivers/staging/media/dt3155v4l/dt3155v4l.c:307:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:307:2: warning: (near initialization for ‘q_ops.queue_setup’) [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:311:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:311:2: warning: (near initialization for ‘q_ops.start_streaming’) [enabled by default]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Lei Wen [Tue, 22 Nov 2011 14:04:29 +0000 (11:04 -0300)]
[media] soc-camera: change order of removing device
As our general practice, we use stream off before we close
the video node. So that the drivers its stream off function
would be called before its remove function.
But for the case for ctrl+c, the program would be force closed.
We have no chance to call that vb2 stream off from user space,
but directly call the remove function in soc_camera.
In that common code of soc_camera:
ici->ops->remove(icd);
if (ici->ops->init_videobuf2)
vb2_queue_release(&icd->vb2_vidq);
It would first call the device remove function, then release vb2,
in which stream off function is called. Thus it create different
order for the driver.
This patch change the order to make driver see the same sequence
to make it happy.
[media] mt9m111: properly implement .s_crop and .s_fmt(), reset on STREAMON
mt9m111 camera sensors support cropping and scaling. The current
implementation is broken. For example, .s_crop() sets output frame sizes
instead of the input cropping window. This patch adds a proper implementation
of these methods. Besides it adds a sensor-disable and -enable operations
on first open() and last close() respectively, to save power while closed and
to return the camera to the default power-on state.
[media] soc-camera: remove redundant parameter from .set_bus_param()
The "pixfmt" parameter of the struct soc_camera_host_ops::set_bus_param()
method is redundant, because at the time, when this method is called,
pixfmt is guaranteed to be equal to icd->current_fmt->host_fmt->fourcc.
Remove this parameter and update all drivers accordingly.
Hans de Goede [Wed, 4 Jan 2012 22:46:53 +0000 (19:46 -0300)]
[media] pwc: Properly fill all fields on try_fmt
Before this patch the resulting values from a try_fmt were different then
those from a s_fmt with the same parameters. try_fmt simply did not
touch / fill some values like bytesperline at all.
This patch also corrects bytesperline to the proper value for a planar
format such as the YUV420P format the pwc driver produces, which is
the bytesperline value for the biggest plane, rather then those
of all planes added together.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 4 Jan 2012 19:58:44 +0000 (16:58 -0300)]
[media] pwc: Remove software emulation of arbritary resolutions
The pwc driver claims to support any resolution between 160x120
and 640x480, but emulates this by simply drawing a black border
around the image. Userspace can draw its own black border if it
really wants one.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sat, 31 Dec 2011 13:52:02 +0000 (10:52 -0300)]
[media] pwc: Remove dead snapshot code
The in kernel version of the pwc driver has never supported snapshot
mode, and now that we no longer support the pixfmt.priv abuse there also
no longer is a way for userspace to request it, rendering all the code in
question dead (never called), so remove it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 9 Oct 2011 20:22:00 +0000 (17:22 -0300)]
[media] pwc: Read new preset values when changing awb control to a preset
So that events get generated for the new red + blue bal values when switching
to a preset. This allows apps to solely rely on events instead of needing
to do a query + g_ctrl on all controls when a control with the update flag
set is gets set or gets an event.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 9 Oct 2011 12:16:46 +0000 (09:16 -0300)]
[media] pwc: Rework locking
While testing gtk-v4l's new ctrl event code, I hit the following deadlock
in the pwc driver:
Thread 1:
-Does a VIDIOC_G_CTRL
-video2_ioctl takes the modlock
-video2_ioctl calls v4l2_g_ctrl
-v4l2_g_ctrl takes the ctrl_handler lock
-v4l2_g_ctrl calls pwc_g_volatile_ctrl
-pwc_g_volatile_ctrl releases the modlock as the usb transfer can take a
significant amount of time and we don't want to block DQBUF / QBUF too long
Thread 2:
-Does a VIDIOC_FOO_CTRL
-video2_ioctl takes the modlock
-video2_ioctl calls v4l2_foo_ctrl
-v4l2_foo_ctrl blocks while trying to take the ctrl_handler lock
Thread 1:
-Blocks while trying to re-take the modlock, as its caller will eventually
unlock that
Now we have thread 1 waiting for the modlock while holding the ctrl_handler
lock and thread 2 waiting for the ctrl_handler lock while holding the
modlock -> deadlock.
Conclusion:
1) We cannot unlock modlock from pwc_s_ctrl / pwc_g_volatile_ctrl,
but this can cause QBUF / DQBUF to block for up to a full second
2) After evaluating various option I came to the conclusion that pwc should
stop using the v4l2 core locking, and instead do its own locking
Thus this patch stops pwc using the v4l2 core locking, and replaces that with
it doing its own locking where necessary.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Tue, 19 Jul 2011 10:14:22 +0000 (07:14 -0300)]
[media] pwc: Use v4l2-device and v4l2-fh
This is a preperation patch for adding support for control events. Actually
enabling support for control events will be done in a separate patch, as that
depends on the necessary poll changes going upstream
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 1 Jan 2012 16:45:43 +0000 (13:45 -0300)]
[media] gscpa_ov519: Fix the bandwidth calc for enabling compression
Somehow the code has ended up assuming 1400 packets/sec which of course
is wrong for usb1 devices like the ov511 cameras. usb1 only does 1000
(isoc) packets / sec.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Theodore Kilgore [Tue, 13 Dec 2011 21:09:15 +0000 (18:09 -0300)]
[media] gspca: Add jl2005bcd sub driver
Written by Theodore Kilgore
With minor changes by Hans de Goede:
-Code style fixes
-Correct the verbose level on various PDEBUG messages
-Make error messages use pr_err instead of PDEBUG
-Document the jl20 pixel format
Signed-off-by: Theodore Kilgore <kilgota@auburn.edu> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* tag 'v3.2': (83 commits)
Linux 3.2
minixfs: misplaced checks lead to dentry leak
ptrace: ensure JOBCTL_STOP_SIGMASK is not zero after detach
ptrace: partially fix the do_wait(WEXITED) vs EXIT_DEAD->EXIT_ZOMBIE race
Revert "rtc: Expire alarms after the time is set."
[CIFS] default ntlmv2 for cifs mount delayed to 3.3
cifs: fix bad buffer length check in coalesce_t2
Revert "rtc: Disable the alarm in the hardware"
hung_task: fix false positive during vfork
security: Fix security_old_inode_init_security() when CONFIG_SECURITY is not set
fix CAN MAINTAINERS SCM tree type
mwifiex: fix crash during simultaneous scan and connect
b43: fix regression in PIO case
ath9k: Fix kernel panic in AR2427 in AP mode
CAN MAINTAINERS update
net: fsl: fec: fix build for mx23-only kernel
sch_qfq: fix overflow in qfq_update_start()
drm/radeon/kms/atom: fix possible segfault in pm setup
gspca: Fix falling back to lower isoc alt settings
futex: Fix uninterruptible loop due to gate_area
...
[media] davinci vpbe: add VENC block changes to enable dm365 and dm355
This patch implements necessary changes for enabling dm365 and
dm355 hardware for vpbe. The patch contains additional HD mode
support for dm365 (720p60, 1080i30) and appropriate register
modifications based on version numbers.
VPBE_VERSION_2 = dm365 specific
VPBE_VERSION_3 = dm355 specific
[media] davinci vpbe: add dm365 and dm355 specific OSD changes
Add OSD block changes to enable dm365 and dm355 for vpbe driver.
Changes are based on version number of OSD, which have incremental
changes over 644x OSD hardware interms of few registers.
VPBE_VERSION_2 = dm365 specific
VPBE_VERSION_3 = dm355 specific
This patch implements the core additions to the display driver,
mainly controlling the VENC and other encoders for dm365.
This patch also includes addition of amplifier subdevice to the
vpbe driver and interfacing with venc subdevice.
Hans de Goede [Sun, 1 Jan 2012 19:35:01 +0000 (16:35 -0300)]
[media] gspca: Add a need_max_bandwidth flag to sd_desc
Some cameras will pretty much entirely fill all the image buffers all the
time even though they are using compression.
This patch adds a flag to sd_desc, which drivers for such cameras can set.
When this flag is set the bandwidth calculation code will no longer
assume that the image buffer size is a worst case and less bandwidth than
imagebufsize * fps will be used on average.
This patch sets this new flag for 3 drivers:
* For spca561 (for rev12a cameras) and nw80x cams as these simply don't work
when given less bandwidth than imagebufsize * fps.
* For sn9c20x cameras, because these show severy jpeg artifacts when
given less bandwidth than imagebufsize * fps and since these are usb2
cameras there is plenty bandwidth anyways.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 1 Jan 2012 20:20:14 +0000 (17:20 -0300)]
[media] gspca: Check dev->actconfig rather than dev->config
Check dev->actconfig rather than dev->config when checking various
configuration things. dev->config points to the array of configs for the
device so dev->config->foo boils down to dev->config[0].foo and the first
config is not necessarily always the active config.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Fri, 30 Dec 2011 11:20:50 +0000 (08:20 -0300)]
[media] gspca - main: Correct use of interval in bandwidth calculation
The calculated bandwidth should not be multiplied by the interval, but be
divided by it. Also bInterbval should be interpreted as a power of 2
for isochronous endpoints.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] gspca - main: Change the bandwidth estimation of isochronous transfer
Having:
- a mean image size of 0.375 time the max compressed image size and
- a frame rate of 30 fps for small images or with USB 2.0/3.0
seems more realistic and gives less image freezes.
[media] drxk: create only one frontend for both DVB-C and DVB-T
Instead of creating two DVB frontend entries for the same device,
create just one entry, and fill the delivery_system according with
the supported standards.
Steven Toth [Thu, 5 Jan 2012 00:15:18 +0000 (21:15 -0300)]
[media] cx25840: Hauppauge HVR1850 Analog driver support
Adding support for the CX23888 DIF.
Changes regression tested against the HVR1700 and HVR1800.
Split out much of the set and init handling of the cx23885 based
cards into their own functions. Added the DIF initialization code
for each supported IF.
Updated the cx23885 code to correctly initialize cx23888 based
video/audio decoders.
Enabled Closed Caption support for CX23885 based cards during
initialization.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The card names are being truncated in the video4linux sys class name file.
Prior to this patch they were shown as:
cx23885[0] mpeg (Hauppauge WinT
cx23885[0] video (Hauppauge WinT
cx23885[0] vbi (Hauppauge WinT
After this patch they are shown as:
Hauppauge WinTV-HVR1850 (video)
Hauppauge WinTV-HVR1850 (mpeg)
Hauppauge WinTV-HVR1850 (vbi)
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Steven Toth [Thu, 5 Jan 2012 00:11:55 +0000 (21:11 -0300)]
[media] cx23885: Control cleanup on the MPEG Encoder
Added three new control calls (g_std, querystd and g_ctrl) to
the -417 driver. Also routed other controls through the main
cx23885 driver meaning that the controls for the 417 and the
raw video device all enter the driver code and are handled
in a single place.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Steven Toth [Thu, 5 Jan 2012 00:08:35 +0000 (21:08 -0300)]
[media] cx23885: Hauppauge HVR1850 Analog driver support
First in a series of patches that adds support to the cx23885 driver
for CX23888 analog video handling. Raw and MPEG video support is
being added for the HVR1850 driver in the patch, and the following
series of patches.
Some basic cx23885 driver cleanup. Partly to add HVR1850 support
and partly to allow -417.c V4L2 calls to be routed through thr
driver core and handled in a single place.
Make a number of core driver functions available to the -417.c
driver to streamline the driver.
Add the analog tuner ops definition so we can reach/tune the
hardware when we need to. Added the tff field so 888 based cards
(which have a weird field ordering issue) can be accomodated
and worked around in the driver.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Steven Toth [Thu, 5 Jan 2012 00:06:13 +0000 (21:06 -0300)]
[media] cx25840: Add a flag to enable the CX23888 DIF to be enabled or not
The CX23888 (HVR1850 and other new cards) contain a DIF which is responsible
for demodulating the audio and video. It's built directly into the CX23888
PCIe bridge. It needs to be enabled and disabled on a per-card and per-input
basis. We pass this flag from the cx23885 core driver to the sub-device
when we need the cx25840 driver to enable/disable with the DIF correctly.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Don't test for ops->info.type inside drivers
Now, ops->info.type is handled inside the dvb_frontend
core, only for DVBv3 calls, and according with the
delivery system. So, drivers should not care or use it,
otherwise, it may have issues with DVBv5 calls.
The drivers that were still using it were detected via
this small temporary hack:
[media] drxk: Add support for parallel mode and prints mpeg mode
While the driver has support for both serial and parallel mode,
There's was way to select serial mode via configuration. Add
a config option for that, while keeping the default in serial mode.
Also, at debug mode, it will now print a message when mpeg is
enabled/disabled, and showing if parallel or serial mode were
selected, helping developers to double-check if the DRX-K is at
the right mode.
[media] mt2063: add some useful info for the dvb callback calls
The per-delivery system tables are confusing.
Add an extra table that explains them, and some
dprintk calls, that allows to check if mt2063 driver
is working as expected.
mt2063.c:1531:12: warning: variable 'ofout' set but not used [-Wunused-but-set-variable]
mt2063.c:1531:6: warning: variable 'ofin' set but not used [-Wunused-but-set-variable]
Several vars at set_parms functions were set, but unused.
Remove them and change the logic to return -EINVAL if the
analog set_param is used for digital mode.
At the analog side, cleans the logic that sets the several
analog standards.
[media] mt2063: Rearrange the delivery system functions
No functional changes on this patch. Better organize the delivery
system information and data types, putting everything together,
to improve readability.
[media] mt2063: Fix analog/digital set params logic
The driver were using a hacky way of setting analog and digital
frequencies. Remove the hack and properly add the tuner logic for
each supported type of standard.
I was tempted to add more standards there, like SECAM and to fix
radio (as stepping seems broken), but I opted to keep it as-is,
as tests would be needed to add additional standards.
[media] mt2063: Remove the code for more than one adjacent mt2063 tuners
Such code is disabled via ifdef's. Also, they're ugly and rely
on some static structures. Just remove. If ever needed, the git
log can be used to recover it.