Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compat-drivers: add media subsystem drivers v4l2, uvcvideo
This adds backport support for the first media subsystem drivers: * v4l2 - Video4Linux * uvcvideo - UVC webcam devices http://linuxtv.org/wiki/index.php/UVC_Webcam_Devices I've run time tested these modules and build tested against all kernels against next-20130328. 1 2.6.24 [ OK ] 2 2.6.25 [ OK ] 3 2.6.26 [ OK ] 4 2.6.27 [ OK ] 5 2.6.28 [ OK ] 6 2.6.29 [ OK ] 7 2.6.30 [ OK ] 8 2.6.31 [ OK ] 9 2.6.32 [ OK ] 10 2.6.33 [ OK ] 11 2.6.34 [ OK ] 12 2.6.35 [ OK ] 13 2.6.36 [ OK ] 14 2.6.37 [ OK ] 15 2.6.38 [ OK ] 16 2.6.39 [ OK ] 17 3.0.65 [ OK ] 18 3.1.10 [ OK ] 19 3.2.38 [ OK ] 20 3.3.8 [ OK ] 21 3.4.32 [ OK ] 22 3.5.7 [ OK ] 23 3.6.11 [ OK ] 24 3.7.9 [ OK ] 25 3.8.0 [ OK ] 26 3.9-rc1 [ OK ] real 23m54.735s user 660m4.939s sys 80m26.078s Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
- Loading branch information
Showing
8 changed files
with
256 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Update this map when a driver gets renamed or | ||
# symbols from old drivers get moved to a newer | ||
# driver. If you have the driver on the right | ||
# hand side it will be blacklisted upon installation | ||
# only if you actually installed the driver on the | ||
# left. | ||
|
||
# new-driver old-driver | ||
videodev v4l2-compat-ioctl32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
patches/collateral-evolutions/media/0001-media_entity_info.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Patch fa5034c6 added a name to a union part of struct media_entity. | ||
We can use the same values in older kernels, we just can't access | ||
them via the union name. | ||
|
||
mcgrof@frijol ~/linux-next (git::master)$ git describe --contains fa5034c6 | ||
v3.3-rc1~48^2~416 | ||
|
||
commit fa5034c667c224be48db31a0d043dba305e8e7a8 | ||
Author: Clemens Ladisch <clemens@ladisch.de> | ||
Date: Sat Nov 5 18:42:01 2011 -0300 | ||
|
||
[media] media: fix truncated entity specification | ||
|
||
When enumerating an entity, assign the entire entity specification | ||
instead of only the first two words. (This requires giving the | ||
specification union a name.) | ||
|
||
So far, no driver actually uses more than two words, but this will | ||
be needed for ALSA entities. | ||
|
||
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> | ||
[laurent.pinchart@ideasonboard.com: Rename specification to info] | ||
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> | ||
|
||
--- a/drivers/media/v4l2-core/v4l2-dev.c | ||
+++ b/drivers/media/v4l2-core/v4l2-dev.c | ||
@@ -924,8 +924,13 @@ int __video_register_device(struct video | ||
vdev->vfl_type != VFL_TYPE_SUBDEV) { | ||
vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; | ||
vdev->entity.name = vdev->name; | ||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | ||
vdev->entity.info.v4l.major = VIDEO_MAJOR; | ||
vdev->entity.info.v4l.minor = vdev->minor; | ||
+#else | ||
+ vdev->entity.v4l.major = VIDEO_MAJOR; | ||
+ vdev->entity.v4l.minor = vdev->minor; | ||
+#endif | ||
ret = media_device_register_entity(vdev->v4l2_dev->mdev, | ||
&vdev->entity); | ||
if (ret < 0) | ||
--- a/drivers/media/v4l2-core/v4l2-device.c | ||
+++ b/drivers/media/v4l2-core/v4l2-device.c | ||
@@ -232,8 +232,13 @@ int v4l2_device_register_subdev_nodes(st | ||
goto clean_up; | ||
} | ||
#if defined(CONFIG_MEDIA_CONTROLLER) | ||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | ||
sd->entity.info.v4l.major = VIDEO_MAJOR; | ||
sd->entity.info.v4l.minor = vdev->minor; | ||
+#else | ||
+ sd->entity.v4l.major = VIDEO_MAJOR; | ||
+ sd->entity.v4l.minor = vdev->minor; | ||
+#endif | ||
#endif | ||
sd->devnode = vdev; | ||
} |
10 changes: 10 additions & 0 deletions
10
patches/collateral-evolutions/media/0002-rename-configs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Used to allow us to build USB_VIDEO_CLASS even if your kernel had it disabled. | ||
|
||
--- a/drivers/media/usb/uvc/Makefile | ||
+++ b/drivers/media/usb/uvc/Makefile | ||
@@ -3,4 +3,4 @@ uvcvideo-objs := uvc_driver.o uvc_queue | ||
ifeq ($(CONFIG_MEDIA_CONTROLLER),y) | ||
uvcvideo-objs += uvc_entity.o | ||
endif | ||
-obj-$(CONFIG_USB_VIDEO_CLASS) += uvcvideo.o | ||
+obj-$(CONFIG_COMPAT_USB_VIDEO_CLASS) += uvcvideo.o |
44 changes: 44 additions & 0 deletions
44
patches/collateral-evolutions/media/9999-Makefile-disable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- a/drivers/media/v4l2-core/Makefile | ||
+++ b/drivers/media/v4l2-core/Makefile | ||
@@ -2,35 +2,15 @@ | ||
# Makefile for the V4L2 core | ||
# | ||
|
||
-tuner-objs := tuner-core.o | ||
- | ||
videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \ | ||
v4l2-event.o v4l2-ctrls.o v4l2-subdev.o | ||
-ifeq ($(CONFIG_COMPAT_COMPAT),y) | ||
+ifeq ($(CONFIG_COMPAT),y) | ||
videodev-objs += v4l2-compat-ioctl32.o | ||
endif | ||
|
||
-obj-$(CONFIG_COMPAT_VIDEO_V4L2) += videodev.o | ||
-obj-$(CONFIG_COMPAT_VIDEO_V4L2_INT_DEVICE) += v4l2-int-device.o | ||
-obj-$(CONFIG_COMPAT_VIDEO_V4L2) += v4l2-common.o | ||
- | ||
-obj-$(CONFIG_COMPAT_VIDEO_TUNER) += tuner.o | ||
- | ||
-obj-$(CONFIG_COMPAT_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o | ||
- | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF_GEN) += videobuf-core.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF_VMALLOC) += videobuf-vmalloc.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF_DVB) += videobuf-dvb.o | ||
- | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF2_CORE) += videobuf2-core.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF2_MEMOPS) += videobuf2-memops.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF2_DMA_CONTIG) += videobuf2-dma-contig.o | ||
-obj-$(CONFIG_COMPAT_VIDEOBUF2_DMA_SG) += videobuf2-dma-sg.o | ||
- | ||
-ccflags-y += -I$(srctree)/drivers/media/dvb-core | ||
-ccflags-y += -I$(srctree)/drivers/media/dvb-frontends | ||
-ccflags-y += -I$(srctree)/drivers/media/tuners | ||
+obj-$(CONFIG_COMPAT_VIDEO_V4L2) += videodev.o | ||
+obj-$(CONFIG_COMPAT_VIDEO_V4L2) += v4l2-common.o | ||
|
||
+obj-$(CONFIG_COMPAT_VIDEOBUF2_CORE) += videobuf2-core.o | ||
+obj-$(CONFIG_COMPAT_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o | ||
+obj-$(CONFIG_COMPAT_VIDEOBUF2_MEMOPS) += videobuf2-memops.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
BLACKLIST_CONF="/etc/modprobe.d/backports.conf" | ||
BLACKLIST_MAP=".blacklist.map" | ||
|
||
MODULE_DIR=$1 | ||
MODULE_UPDATES=$2 | ||
|
||
if [[ ! -d $MODULE_DIR ]]; then | ||
exit | ||
fi | ||
|
||
if [[ ! -d $MODULE_UPDATES ]]; then | ||
exit | ||
fi | ||
|
||
mkdir -p $(dirname $BLACKLIST_CONF) | ||
rm -f $BLACKLIST_CONF | ||
|
||
echo "# To be used when using backported drivers" >> $BLACKLIST_CONF | ||
|
||
for i in $(grep -v ^# $BLACKLIST_MAP | cut -f 2); do | ||
MODULE="${i}.ko" | ||
MODULE_UPDATE="$(grep -v ^# $BLACKLIST_MAP | grep $i | cut -f 1 | head -1).ko" | ||
COUNT=$(find $MODULE_DIR -type f -name ${MODULE} -or -name ${MODULE}.gz | wc -l) | ||
COUNT_REPLACE=$(find $MODULE_UPDATES -type f -name ${MODULE_UPDATE} -or -name ${MODULE_UPDATE}.gz | wc -l) | ||
if [ $COUNT -ne 0 ]; then | ||
if [ $COUNT_REPLACE -ne 0 ]; then | ||
echo "Blacklisting $MODULE ..." | ||
echo blacklist $i >> $BLACKLIST_CONF | ||
fi | ||
fi | ||
done |