FS#40845 - [linux] 3.15.x Please enable the vivi virtual V4L2 video driver as a module

Attached to Project: Arch Linux
Opened by Alain Kalker (ackalker) - Saturday, 14 June 2014, 21:05 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 16 June 2014, 18:23 GMT
Task Type Feature Request
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Please enable the vivi driver to be built as a kernel module (config VIDEO_VIVI).

Motivation: vivi is a very useful reference point for developing and testing video software and for diagnosing problems (see for example: https://github.com/mpv-player/mpv/issues/852 ), because it doesn't depend on the use of specific video hardware.
Also, it doesn't add any dependencies not already in the current config (it has the same dependencies as v4l2-mem2mem which is currently already enabled), so it doesn't bloat vmlinuz-linux.
Additional info:
* package version(s)
linux 3.14.6-1
* config and/or log files etc.


Steps to reproduce:
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Monday, 16 June 2014, 18:23 GMT
Reason for closing:  Implemented
Additional comments about closing:  trunk
Comment by Alain Kalker (ackalker) - Saturday, 14 June 2014, 21:28 GMT
Confession: I built vivi kernel module 'half out-of-tree' using a simple wrapper Makefile, being too lazy to build a whole new kernel.

There appears to be some weirdness in the Kconfig structure going on. The v4l2-mem2mem kernel module is referenced by drivers/media/{platform,v4l2-core}/{Kconfig,Makefile}, but the vivi module is referenced only by drivers/media/platform/{Kconfig,Makefile} , so I don't know if it can actually be enabled without some hackery. If it cannot, then I apologize for making a useless request :-)
Comment by Alain Kalker (ackalker) - Saturday, 14 June 2014, 21:47 GMT
Here's the wrapper Makefile I used (copy it and drivers/media/platform/vivi.c into a directory and run `make`).
Beware: it uses some pitch-black magic and doesn't check for dependencies, so don't use it to build just any module out-of-tree!

Makefile:
---
ifneq ($(KERNELRELEASE),)

obj-m := vivi.o

else

KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

endif
Comment by Alain Kalker (ackalker) - Saturday, 14 June 2014, 21:48 GMT
Use TABs where necessary (darn flyswat markup!)
Comment by Tobias Powalowski (tpowa) - Monday, 16 June 2014, 09:44 GMT
It's not possible to enable with current configs.
Comment by Alain Kalker (ackalker) - Monday, 16 June 2014, 16:08 GMT
Ah, thanks for trying. Best to keep a watch on it, maybe it will be included in a future version.
Comment by Alain Kalker (ackalker) - Monday, 16 June 2014, 17:05 GMT
@tpowa
Well, I decided to try it myself, uncommenting the `make menuconfig` line and commenting the `yes "" | make config >/dev/null line` in the PKGBUILD.

All I needed to do was to go to Device drivers / Multimedia support, enable [*] then enter Media test drivers, then enable [M] Virtual Video Driver as a module.

Here is the resulting diff with a previously generated (x86_64) .config from running `makepkg -o`, in which I've enabled the mem2mem driver as well:

--- .config 2014-06-16 18:29:13.309753103 +0200
+++ .config.add_vivi+mem2mem 2014-06-16 18:47:23.525539085 +0200
@@ -3974,7 +3974,9 @@
CONFIG_VIDEO_MEM2MEM_DEINTERLACE=m
CONFIG_VIDEO_SH_VEU=m
CONFIG_VIDEO_RENESAS_VSP1=m
-# CONFIG_V4L_TEST_DRIVERS is not set
+CONFIG_V4L_TEST_DRIVERS=y
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_MEM2MEM_TESTDEV=m

#
# Supported MMC/SDIO adapters


Looks benign to me (the CONFIG_V4L_TEST_DRIVERS is just a menu selector, it does not add dependency bloat).
Or are there more pressing reasons not to enable this?

Loading...