Only enable v4l2/dmabuf tests if supported
authorRob Clark <rob@ti.com>
Sat, 21 Jan 2012 19:47:39 +0000 (13:47 -0600)
committerRob Clark <rob@ti.com>
Thu, 26 Jan 2012 20:24:35 +0000 (14:24 -0600)
Test v4l2 headers, and only enable v4l2/dmabuf tests if dmabuf support
is detected.

Makefile.am
cam-setup.sh [new file with mode: 0755]
configure.ac
util/Makefile.am

index e176126d2afd42cb21e3d349702713544308ab72..dc13f6d5e5cab4defded2ddcad3cff3f76d10093 100644 (file)
 #  
 
 SUBDIRS = util
-bin_PROGRAMS = fliptest dmabuftest
+bin_PROGRAMS = fliptest
+
+if ENABLE_V4L2_DMABUF
+bin_PROGRAMS += dmabuftest
+endif
 
 if ENABLE_DCE
 bin_PROGRAMS += viddec3test
@@ -28,8 +32,10 @@ CFLAGS = @DRM_CFLAGS@ @X11_CFLAGS@ @DCE_CFLAGS@ @WARN_CFLAGS@ -I$(top_srcdir)/ut
 fliptest_SOURCES = fliptest.c
 fliptest_LDADD = $(LDADD_COMMON)
 
+if ENABLE_V4L2_DMABUF
 dmabuftest_SOURCES = dmabuftest.c
 dmabuftest_LDADD = $(LDADD_COMMON)
+endif
 
 if ENABLE_DCE
 viddec3test_SOURCES = viddec3test.c
diff --git a/cam-setup.sh b/cam-setup.sh
new file mode 100755 (executable)
index 0000000..dc47da5
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# link pipeline:
+/usr/bin/media-ctl -d /dev/media0 -r -l '"OMAP4 ISS CSI2a":1 -> "OMAP4 ISS CSI2a output":0 [1]'
+
+# set formats:
+/usr/bin/media-ctl -d /dev/media0 -r -f '"ov5640 3-003c":0 [UYVY 640x480]','"OMAP4 ISS CSI2a":0 [UYVY 640x480]'
+
+# print setup:
+/usr/bin/media-ctl -d /dev/media0 -p
+
index 06a930f36f04f5620e03a2e8e94ee38b68f9bf2b..cded853033935fac556abfa0532150a99d9dd436 100644 (file)
@@ -34,6 +34,18 @@ AC_PROG_LIBTOOL
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(DRM, libdrm libdrm_omap)
 
+# Check for v4l2 dmabuf support:
+AC_CHECK_MEMBER([struct v4l2_buffer.m.fd],
+       [HAVE_V4L2_DMABUF=yes],
+       [HAVE_V4L2_DMABUF=no],
+       [[#include <linux/videodev2.h>]])
+if test "x$HAVE_V4L2_DMABUF" = "xyes"; then
+       AC_DEFINE(HAVE_V4L2_DMABUF, 1, [Have V4L2 DMABUF support])
+else
+       AC_MSG_WARN([No V4L2 DMABUF support detected, disabling V4L2 DMABUF tests])
+fi
+AM_CONDITIONAL(ENABLE_V4L2_DMABUF, [test "x$HAVE_V4L2_DMABUF" = xyes])
+
 # Check optional X11:
 PKG_CHECK_MODULES(X11, x11 libdri2, [HAVE_X11=yes], [HAVE_X11=no])
 if test "x$HAVE_X11" = "xyes"; then
index 9d3ddd2fa24b1530d7707866e0f9b1e8c5ba9777..e00fe2a2b51192d0ff85f75915d340a66dfe7b7b 100644 (file)
@@ -19,13 +19,16 @@ noinst_LTLIBRARIES = libutil.la
 
 libutil_la_SOURCES = \
        display-kms.c \
-       v4l2.c \
        util.c
 
 if ENABLE_X11
 libutil_la_SOURCES += display-x11.c
 endif
 
+if ENABLE_V4L2_DMABUF
+libutil_la_SOURCES += v4l2.c
+endif
+
 if ENABLE_DCE
 libutil_la_SOURCES += demux.c
 endif