History log of /drivers/media/video/pwc/pwc-dec23.h
Revision Date Author Comments
24be689bfbbcd6c047d7918784ff810e97648006 10-Jan-2012 Hans de Goede <hdegoede@redhat.com> [media] pwc: Use one shared usb command buffer

The pwc driver used to:
1. kmalloc a buffer
2. memcpy data to send over usb there
3. do the usb_control_msg call (which does not work with data on the stack)
4. free the buffer

For every usb command send. This patch changes the code to instead malloc
a buffer for this purpose once and use it everywhere.

[mchehab@redhat.com: Fix a compilation breakage with allyesconfig:
drivers/media/video/pwc/pwc-ctrl.c: In function ‘pwc_get_cmos_sensor’:
drivers/media/video/pwc/pwc-ctrl.c:546:3: warning: passing argument 4 of ‘recv_control_msg’ makes integer from pointer without a cast [en$
drivers/media/video/pwc/pwc-ctrl.c:107:12: note: expected ‘int’ but argument is of type ‘unsigned char *’
drivers/media/video/pwc/pwc-ctrl.c:546:3: error: too many arguments to function ‘recv_control_msg’
drivers/media/video/pwc/pwc-ctrl.c:107:12: note: declared here]

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1c852201a28601b1379857f615e99071211294c6 10-Jan-2012 Hans de Goede <hdegoede@redhat.com> [media] pwc: Avoid unnecessarily rebuilding the decoder tables

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
56ae24aad8f9e25dfef995c3e898e5f394cf0beb 08-Jan-2012 Hans de Goede <hdegoede@redhat.com> [media] pwc: Make decoder data part of the main pwc struct

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dc8a7e83aaf8bb1bcf7163bda8926a6dd29c409b 31-Dec-2011 Hans de Goede <hdegoede@redhat.com> [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>
c20d78cde37018caa0313469c9320424995cc489 09-Oct-2011 Hans de Goede <hdegoede@redhat.com> [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>
6eba93573d2dda3f627006101c0652faeeaffde6 26-Jun-2011 Hans de Goede <hdegoede@redhat.com> [media] pwc: Move various initialization to driver load and / or stream start

Doing a bunch of initialization every time /dev/video is opened, and thus
for example when the udev rules probe for capabilities makes no sense,
do it at driver load, resp. stream start instead.

This is a preparation patch for allowing multiple opens of the /dev/video
node.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2b455db6d456ef2d44808a8377fd3bc832e08317 24-Apr-2006 Luc Saillard <luc@saillard.org> V4L/DVB (3835): [PATCH] update pwc driver

Add v4l2 compatibility
Include the decompressor (legal problem has been resolv by Alan Cox)
Faster decoder and easier to maintain, optimize, ...
Can export to userland compressed stream
Support more cameras, lot of bugs are fixed.

Signed-off-by: Luc Saillard <luc@saillard.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>