From ba01d9556df078eee12e78ab3332d5534997d67b Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Mon, 7 Dec 2015 10:19:34 +0000
Subject: [PATCH] v4l: Port from vivi to vivid kernel driver

For the 3.18 kernel release, the vivi v4l test driver was dropped, and
replaced by the vivid driver. This does much the same thing, but has a
different set of options, and outputs at a different resolution by
default.

Update the v4l/automated/run-test.sh test to use vivid instead of vivi.

Bug: https://bugs.apertis.org/show_bug.cgi?id=602

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D1169
---
 v4l/automated/run-test.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/v4l/automated/run-test.sh b/v4l/automated/run-test.sh
index f3bcaa27..45b235d2 100755
--- a/v4l/automated/run-test.sh
+++ b/v4l/automated/run-test.sh
@@ -6,7 +6,7 @@ set -e
 TESTDIR=$(cd $(dirname $0); pwd; cd - &>/dev/null)
 . "${TESTDIR}/config.sh"
 
-V4L_NR="99"
+V4L_NR="0"
 V4L_DEVICE="/dev/video${V4L_NR}"
 V4L_TEST="v4l_test"
 
@@ -26,8 +26,8 @@ else
 fi
 
 if ! arch_is_arm; then
-    sudo modprobe -r vivi
-    sudo modprobe vivi "video_nr=${V4L_NR}"
+    sudo modprobe -r vivid
+    sudo modprobe vivid
 fi
 
 setup_success
@@ -35,13 +35,13 @@ setup_success
 ###########
 # Execute #
 ###########
-test_vivi_to_stdout() {
+test_vivid_to_stdout() {
     local outfile expected_size actual_size
 
     outfile="${WORKDIR}/v4l_out.bin"
-    expected_size=$((10*640*480*32/8))
+    expected_size=$((10*640*360*32/8))
 
-    # Get 10 frames from vivi
+    # Get 10 frames from vivid
     "${V4L2FB}" "${V4L_DEVICE}" "${V4L_TEST}" 10 > "${outfile}"
     sync
     actual_size=$(wc -c < "${outfile}")
@@ -60,11 +60,11 @@ trap "test_failure" ERR
 if arch_is_arm; then
     say "Test only works on x86, skipping..."
     src_test_pass <<-EOF
-#test_vivi_to_stdout
+#test_vivid_to_stdout
 EOF
 else
     src_test_pass <<-EOF
-test_vivi_to_stdout
+test_vivid_to_stdout
 EOF
 fi
 
-- 
GitLab