[PATCH] Corrected Oops on omap_vout when no manager is connected
If no manager is connected to the vout device, the omapvid_init() function fails. No error condition is checked, and the device is started. Later on, when irq is serviced, a NULL pointer dereference occurs. Also, the isr routine must be registered only if no error occurs, otherwise the isr triggers without the proper setup, and the kernel oops again. To prevent this, the error condition is checked, and the streamon function exits with error. Also the isr registration call is moved after the setup procedure is completed. --- drivers/media/video/omap/omap_vout.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 15c5f4d..f456587 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -650,9 +650,12 @@ static void omap_vout_isr(void *arg, unsigned int irqstatus) /* First save the configuration in ovelray structure */ ret = omapvid_init(vout, addr); - if (ret) + if (ret) { printk(KERN_ERR VOUT_NAME failed to set overlay info\n); + goto vout_isr_err; + } + /* Enable the pipeline and set the Go bit */ ret = omapvid_apply_changes(vout); if (ret) @@ -1678,13 +1681,16 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i) mask = DISPC_IRQ_VSYNC | DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_VSYNC2; - omap_dispc_register_isr(omap_vout_isr, vout, mask); - /* First save the configuration in ovelray structure */ ret = omapvid_init(vout, addr); - if (ret) + if (ret) { v4l2_err(vout-vid_dev-v4l2_dev, failed to set overlay info\n); + goto streamon_err1; + } + + omap_dispc_register_isr(omap_vout_isr, vout, mask); + /* Enable the pipeline and set the Go bit */ ret = omapvid_apply_changes(vout); if (ret) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[v4l-utils] [PATCH] Cross compilation corrections and script
Hello, I saw that in the current stable branch of 0.8 (at least in tag 0.8.8) no configure script is provided. Cross compiling with it could be difficult. This patch deals with this problem. It corrects some Makefile and adds a script (./cross-compile.sh) that cross compiles the utils with some different parameters, like: - cross tool selection - Static linking (very useful for testing!) - Stripping - jpeg library path selection. Tested on ARM with arm-linux-gnueabi toolchain, static linking and no staging jpeg libraries (only statically linked libraries outside the root build tree) Regards Federico Fuga -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Cross compilation corrections and script
This patch includes some corrections to makefiles and adds a script to be used when crosscompiling. In particular, I introduced the option to specify the cross toolchain prefix, static linking and stripping the binaries and specify eventually another jpeg library directory to be used instead of the current one. ./cross-compile.sh --help to have some help about. --- cross-compile.sh | 56 utils/Makefile |2 ++ utils/v4l2-compliance/Makefile |6 - utils/v4l2-ctl/Makefile| 10 --- 4 files changed, 70 insertions(+), 4 deletions(-) create mode 100755 cross-compile.sh diff --git a/cross-compile.sh b/cross-compile.sh new file mode 100755 index 000..22f47e5 --- /dev/null +++ b/cross-compile.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +function help() { + cat __END__ +Usage: $0 --host cross-compiler-prefix [--strip] [target] + + --host cross-compiler-prefix The toolchain prefix, for example: arm-linux-gnueabi + If required, you can define the complete path + --strip Strip binaries (optional) + --with-jpeg-dir Complete path to jpeg library installation (optional) + --staticMake compilation static (good for test on embedded systems) + (optional) + target The makefile target (clean, all, etc...) + +__END__ +} + +while [ $END == ] ; do + case $1 in + --host) + shift; + HOST=$1 + shift; + ;; + --strip) + shift + STRIP=-s + ;; + --static) + OPT_LINKTYPE=LINKTYPE=static; + shift; + ;; + --with-jpeg-dir) + shift + OPT_JPEG_INCLUDE=-I$1/include + OPT_JPEG_LIB=-L$1/lib + shift + ;; + --help) + help $0 + shift + exit 1 + ;; + *) + END=y + ;; + esac +done + +if [ $HOST == ] ; then + echo --host is mandatory. $0 help to have assistance. + exit 1 +fi + +make CC=$HOST-gcc LD=$HOST-g++ CXX=$HOST-g++ CFLAGS=$OPT_JPEG_INCLUDE CPPFLAGS=$OPT_JPEG_INCLUDE $OPT_LINKTYPE LDFLAGS=$STRIP $OPT_JPEG_LIB NOQT4=y $@ + diff --git a/utils/Makefile b/utils/Makefile index 014b82d..565e46d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -5,6 +5,7 @@ all install: $(MAKE) -C $$i $@ || exit 1; \ done +ifneq ($(NOQT4),y) # Test whether qmake is installed, and whether it is for qt4. @if which qmake-qt4 /dev/null 21; then \ QMAKE=qmake-qt4; \ @@ -19,6 +20,7 @@ all install: $(MAKE) -C qv4l2 -f Makefile.install $@; \ fi \ fi +endif sync-with-kernel: $(MAKE) -C keytable $@ diff --git a/utils/v4l2-compliance/Makefile b/utils/v4l2-compliance/Makefile index b65fc82..3a0cdc8 100644 --- a/utils/v4l2-compliance/Makefile +++ b/utils/v4l2-compliance/Makefile @@ -1,12 +1,16 @@ TARGETS = v4l2-compliance +ifeq ($(LINKTYPE),static) + EXTRA_LIBS=-ljpeg +endif + all: $(TARGETS) -include *.d v4l2-compliance: v4l2-compliance.o v4l2-test-debug.o v4l2-test-input-output.o \ v4l2-test-controls.o v4l2-test-io-config.o v4l2-test-formats.o - $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt + $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt $(EXTRA_LIBS) install: $(TARGETS) mkdir -p $(DESTDIR)$(PREFIX)/bin diff --git a/utils/v4l2-ctl/Makefile b/utils/v4l2-ctl/Makefile index 5ea58c7..9f681f6 100644 --- a/utils/v4l2-ctl/Makefile +++ b/utils/v4l2-ctl/Makefile @@ -2,18 +2,22 @@ override CPPFLAGS += -DV4L_UTILS_VERSION=\$(V4L_UTILS_VERSION)\ TARGETS = cx18-ctl ivtv-ctl v4l2-ctl +ifeq ($(LINKTYPE),static) + EXTRA_LIBS=-ljpeg +endif + all: $(TARGETS) -include *.d cx18-ctl: cx18-ctl.o - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ $(EXTRA_LIBS) ivtv-ctl: ivtv-ctl.o - $(CC) $(LDFLAGS) -o $@ $^ -lm + $(CC) $(LDFLAGS) -o $@ $^ -lm $(EXTRA_LIBS) v4l2-ctl: v4l2-ctl.o - $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt + $(CXX) $(LDFLAGS) -o $@ $^ -lv4l2 -lv4lconvert -lrt $(EXTRA_LIBS) install: $(TARGETS) mkdir -p $(DESTDIR)$(PREFIX)/bin -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at