Patch Detail
Show a patch.
GET /api/1.1/patches/19/?format=api
{ "id": 19, "url": "https://patchwork.libcamera.org/api/1.1/patches/19/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20181129143854.21311-1-laurent.pinchart@ideasonboard.com>", "date": "2018-11-29T14:38:54", "name": "[libcamera-devel] utils: ipu3: Add test process script", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c8a3b4394fed91f5106285138fd0eb843d3498fa", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19/mbox/", "series": [ { "id": 10, "url": "https://patchwork.libcamera.org/api/1.1/series/10/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=10", "date": "2018-11-29T14:38:54", "name": "[libcamera-devel] utils: ipu3: Add test process script", "version": 1, "mbox": "https://patchwork.libcamera.org/series/10/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9AC760B10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Nov 2018 15:38:47 +0100 (CET)", "from avalon.bb.dnainternet.fi\n\t(dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D69F55A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Nov 2018 15:38:46 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1543502327;\n\tbh=onzYsWBdh1Lx092lyKm0jvZ1/uyjHBH6xxYAMzLwySQ=;\n\th=From:To:Subject:Date:From;\n\tb=Z2JVEezah1EYLXEtJskOyqIRQzgcBySj6co8zlQ7fr3iFwa6worbONmg8x6f1mH4m\n\thoRjBUhrTqG2sW+Rv1UtnXFUxk9TJFjftjMB8YdRIYhCUB2JufHxBj5tl+2B2AckgC\n\tN0sAuXgczjDA+srBMUMI1zRHxGKlKxLZKdBJ0dY4=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 29 Nov 2018 16:38:54 +0200", "Message-Id": "<20181129143854.21311-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.19.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] utils: ipu3: Add test process script", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Thu, 29 Nov 2018 14:38:47 -0000" }, "content": "The script processes raw frames through the Intel IPU3 IMGU.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nI've tested this on an HP Chromebook X2 with v7 of the IPU3 IMGU driver\n(see https://patchwork.kernel.org/cover/10660325/) and got a kernel oops\n:-/\n\n[ 136.927788] divide error: 0000 [#1] PREEMPT SMP PTI\n[ 136.927801] CPU: 2 PID: 2069 Comm: yavta Not tainted 4.20.0-rc1+ #9\n[ 136.927806] Hardware name: HP Soraka/Soraka, BIOS 08/30/2018\n[ 136.927820] RIP: 0010:ipu3_css_osys_calc+0xc54/0xe14 [ipu3_imgu]\n[ 136.927825] Code: 89 44 24 28 42 8b 44 86 6c f7 54 24 04 81 64 24 28 00 fd ff ff 81 64 24 04 00 03 00 00 8d 44 03 ff 81 44 24 28 80 03 00 00 99 <f7> fb 0f af c3 bb 20 00 00 00 99 f7 fb 8b 5c 24 40 83 fd 01 19 d2\n[ 136.927830] RSP: 0018:ffff9af2c0b837c8 EFLAGS: 00010202\n[ 136.927835] RAX: 00000000ffffffff RBX: 0000000000000000 RCX: ffff9af2c3e353c0\n[ 136.927839] RDX: 00000000ffffffff RSI: ffff9af2c0b838e0 RDI: ffff9af2c3e353c0\n[ 136.927843] RBP: 0000000000000001 R08: 0000000000000000 R09: ffff9af2c0b83880\n[ 136.927846] R10: ffff9af2c3e353c0 R11: ffff9af2c3e357c0 R12: 00000000000003a0\n[ 136.927849] R13: 0000000000025a0a R14: 0000000000000000 R15: 0000000000000000\n[ 136.927854] FS: 00007f1eca167700(0000) GS:ffff8c19fab00000(0000) knlGS:0000000000000000\n[ 136.927858] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n[ 136.927862] CR2: 00007f1ec776c000 CR3: 00000001312a4003 CR4: 00000000003606e0\n[ 136.927865] Call Trace:\n[ 136.927884] ? __accumulate_pelt_segments+0x29/0x3a\n[ 136.927892] ? __switch_to_asm+0x40/0x70\n[ 136.927899] ? alloc_vmap_area+0x78/0x2f6\n[ 136.927903] ? __switch_to_asm+0x40/0x70\n[ 136.927907] ? __switch_to_asm+0x34/0x70\n[ 136.927911] ? __switch_to_asm+0x40/0x70\n[ 136.927915] ? __switch_to_asm+0x34/0x70\n[ 136.927923] ? __inc_numa_state+0x28/0x70\n[ 136.927929] ? preempt_latency_start+0x1e/0x3d\n[ 136.927936] ? get_page_from_freelist+0x821/0xb62\n[ 136.927943] ? slab_pre_alloc_hook+0x12/0x3b\n[ 136.927948] ? kmem_cache_alloc_node_trace+0xf6/0x108\n[ 136.927954] ? alloc_vmap_area+0x78/0x2f6\n[ 136.927965] ipu3_css_cfg_acc+0xa0/0x1b5f [ipu3_imgu]\n[ 136.927981] ipu3_css_set_parameters+0x286/0x6e7 [ipu3_imgu]\n[ 136.927995] ipu3_css_start_streaming+0x1230/0x130a [ipu3_imgu]\n[ 136.928010] imgu_s_stream+0x104/0x2f7 [ipu3_imgu]\n[ 136.928022] ipu3_vb2_start_streaming+0x168/0x1bd [ipu3_imgu]\n[ 136.928034] vb2_start_streaming+0x6c/0xf2 [videobuf2_common]\n[ 136.928044] vb2_core_streamon+0xcf/0x109 [videobuf2_common]\n[ 136.928061] __video_do_ioctl+0x239/0x388 [videodev]\n[ 136.928081] video_usercopy+0x25d/0x47a [videodev]\n[ 136.928097] ? copy_overflow+0x14/0x14 [videodev]\n[ 136.928115] v4l2_ioctl+0x4d/0x58 [videodev]\n[ 136.928123] vfs_ioctl+0x1b/0x28\n[ 136.928130] do_vfs_ioctl+0x4de/0x566\n[ 136.928139] ksys_ioctl+0x50/0x70\n[ 136.928146] __x64_sys_ioctl+0x16/0x19\n[ 136.928152] do_syscall_64+0x4d/0x5a\n[ 136.928158] entry_SYSCALL_64_after_hwframe+0x44/0xa9\n[ 136.928164] RIP: 0033:0x7f1ec9a84f47\n[ 136.928169] Code: 00 00 00 48 8b 05 51 6f 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 21 6f 2c 00 f7 d8 64 89 01 48\n[ 136.928173] RSP: 002b:00007ffe279e6188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010\n[ 136.928178] RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 00007f1ec9a84f47\n[ 136.928181] RDX: 00007ffe279e6194 RSI: 0000000040045612 RDI: 0000000000000003\n[ 136.928184] RBP: 0000000000000000 R08: 00007f1ec776d000 R09: 0000000000000000\n[ 136.928188] R10: 0000000000000020 R11: 0000000000000246 R12: 00007ffe279e6360\n[ 136.928191] R13: 0000000000000004 R14: 00007ffe279e6360 R15: 00007ffe279e8826\n[ 136.928198] Modules linked in: ccm zram arc4 iwlmvm mac80211 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp iwlwifi cfg80211 hid_multitouch ipu3_imgu ipu3_cio2 8250_dw videobuf2_dma_sg videobuf2_memops videobuf2_v4l2 processor_thermal_device intel_soc_dts_iosf videobuf2_common ov5670 ov13858 dw9714 v4l2_fwnode v4l2_common videodev media at24 cros_ec_lpcs cros_ec_core int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel chromeos_pstore mac_hid autofs4 usbhid mmc_block hid_generic i915 sdhci_pci video cqhci i2c_algo_bit sdhci drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks i2c_hid hid\n[ 136.928273] ---[ end trace 4ec6c2ce09e06d9d ]---\n[ 136.928288] RIP: 0010:ipu3_css_osys_calc+0xc54/0xe14 [ipu3_imgu]\n[ 136.928293] Code: 89 44 24 28 42 8b 44 86 6c f7 54 24 04 81 64 24 28 00 fd ff ff 81 64 24 04 00 03 00 00 8d 44 03 ff 81 44 24 28 80 03 00 00 99 <f7> fb 0f af c3 bb 20 00 00 00 99 f7 fb 8b 5c 24 40 83 fd 01 19 d2\n[ 136.928297] RSP: 0018:ffff9af2c0b837c8 EFLAGS: 00010202\n[ 136.928302] RAX: 00000000ffffffff RBX: 0000000000000000 RCX: ffff9af2c3e353c0\n[ 136.928307] RDX: 00000000ffffffff RSI: ffff9af2c0b838e0 RDI: ffff9af2c3e353c0\n[ 136.928311] RBP: 0000000000000001 R08: 0000000000000000 R09: ffff9af2c0b83880\n[ 136.928320] R10: ffff9af2c3e353c0 R11: ffff9af2c3e357c0 R12: 00000000000003a0\n[ 136.928324] R13: 0000000000025a0a R14: 0000000000000000 R15: 0000000000000000\n[ 136.928330] FS: 00007f1eca167700(0000) GS:ffff8c19fab00000(0000) knlGS:0000000000000000\n[ 136.928349] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n[ 136.928364] CR2: 00007f1ec776c000 CR3: 00000001312a4003 CR4: 00000000003606e0\n\n utils/ipu3/ipu3-process.sh | 177 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 177 insertions(+)\n create mode 100755 utils/ipu3/ipu3-process.sh", "diff": "diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh\nnew file mode 100755\nindex 000000000000..6f7526ab1158\n--- /dev/null\n+++ b/utils/ipu3/ipu3-process.sh\n@@ -0,0 +1,177 @@\n+#!/bin/bash\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2018, Google Inc.\n+#\n+# Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n+#\n+# ipu3-process.sh - Process raw frames with the Intel IPU3\n+#\n+# The scripts makes use of the following tools, which are expected to be\n+# executable from the system-wide path or from the local directory:\n+#\n+# - media-ctl (from v4l-utils git://linuxtv.org/v4l-utils.git)\n+# - raw2pnm (from nvt https://github.com/intel/nvt.git)\n+# - yavta (from git://git.ideasonboard.org/yavta.git)\n+\n+# Locate the media device\n+find_media_device() {\n+\tlocal mdev\n+\n+\tfor mdev in /dev/media* ; do\n+\t\tmedia-ctl -d $mdev -p | grep -q \"^driver[ \\t]*ipu3-imgu$\" && break\n+\t\tmdev=\n+\tdone\n+\n+\tif [[ -z $mdev ]] ; then\n+\t echo \"IPU3 media device not found.\" >&2\n+\t exit 1\n+\tfi\n+\n+\techo $mdev\n+}\n+\n+# Configure the pipeline\n+configure_pipeline() {\n+\tlocal enable_3a=1\n+\tlocal enable_out=1\n+\tlocal enable_vf=1\n+\n+\t$mediactl -r\n+\t$mediactl -l \"\\\"ipu3-imgu 0 input\\\":0 -> \\\"ipu3-imgu 0\\\":0[1]\"\n+\t$mediactl -l \"\\\"ipu3-imgu 0\\\":2 -> \\\"ipu3-imgu 0 output\\\":0[$enable_out]\"\n+\t$mediactl -l \"\\\"ipu3-imgu 0\\\":3 -> \\\"ipu3-imgu 0 viewfinder\\\":0[$enable_vf]\"\n+\t$mediactl -l \"\\\"ipu3-imgu 0\\\":4 -> \\\"ipu3-imgu 0 3a stat\\\":0[$enable_3a]\"\n+}\n+\n+# Perform frame processing through the IMGU\n+process_frames() {\n+\tconfigure_pipeline\n+\n+\tyavta -n $nbufs -c$frame_count -f $IMGU_OUT_PIXELFORMAT -s $out_size \\\n+\t\t$($mediactl -e \"ipu3-imgu 0 output\") &\n+\tsleep 0.5\n+\tyavta -n $nbufs -c$frame_count -f $IMGU_VF_PIXELFORMAT -s $vf_size \\\n+\t\t$($mediactl -e \"ipu3-imgu 0 viewfinder\") &\n+\tsleep 0.5\n+\tyavta -n $nbufs -c$frame_count \\\n+\t\t$($mediactl -e \"ipu3-imgu 0 3a stat\") &\n+\tsleep 0.5\n+\tyavta -n $nbufs -c$frame_count -f $IMGU_IN_PIXELFORMAT -s $in_size -F$in_file \\\n+\t\t$($mediactl -e \"ipu3-imgu 0 input\")\n+}\n+\n+# Convert captured files to ppm\n+convert_files() {\n+\tlocal index=$1\n+\tlocal type=$2\n+\tlocal size=$3\n+\tlocal format=$4\n+\n+\tlocal width=$(echo $size | awk -F 'x' '{print $1}')\n+\tlocal height=$(echo $size | awk -F 'x' '{print $2}')\n+\tlocal padded_width=$(expr $(expr $width + 63) / 64 \\* 64)\n+\n+\traw2pnm -x$padded_width -y$height -f$format \\\n+\t\t$output_dir/frames.${type}_$index \\\n+\t\t$output_dir/frames.${type}_$index.ppm\n+}\n+\n+run_test() {\n+\tIMGU_IN_PIXELFORMAT=IPU3_SGRBG10\n+\tIMGU_OUT_PIXELFORMAT=NV12\n+\tIMGU_VF_PIXELFORMAT=NV12\n+\n+\techo \"==== Test ====\"\n+\techo \"input: $in_file\"\n+\techo \"output: $IMGU_OUT_PIXELFORMAT/$out_size\"\n+\techo \"vf: $IMGU_VF_PIXELFORMAT/$vf_size\"\n+\n+\tprocess_frames\n+\n+\tfor i in `seq -f '%06.0f' 0 $(($frame_count - 1))`; do\n+\t\tconvert_files $i out $out_size $IMGU_OUT_PIXELFORMAT\n+\t\tconvert_files $i vf $vf_size $IMGU_VF_PIXELFORMAT\n+\tdone\n+}\n+\n+validate_size() {\n+\tlocal size=$1\n+\tlocal width=$(echo $size | awk -F 'x' '{print $1}')\n+\tlocal height=$(echo $size | awk -F 'x' '{print $2}')\n+\n+\t[[ \"x${size}\" == \"x${width}x${height}\" ]]\n+}\n+\n+# Print usage message\n+usage() {\n+\techo \"Usage: $(basename $1) [options] <input-file>\"\n+\techo \"Supported options:\"\n+\techo \"--out size output frame size (defaults to input size)\"\n+\techo \"--vf size viewfinder frame size (defaults to input size)\"\n+\techo \"\"\n+\techo \"Where the input file name and size are\"\n+\techo \"\"\n+\techo \"input-file = prefix '-' width 'x' height '.' extension\"\n+\techo \"size = width 'x' height\"\n+}\n+\n+# Parse command line arguments\n+while (( \"$#\" )) ; do\n+\tcase $1 in\n+\t--out)\n+\t\tout_size=$2\n+\t\tif ! validate_size $out_size ; then\n+\t\t\techo \"Invalid size '$out_size'\"\n+\t\t\tusage $0\n+\t\t\texit 1\n+\t\tfi\n+\t\tshift 2\n+\t\t;;\n+\t--vf)\n+\t\tvf_size=$2\n+\t\tif ! validate_size $vf_size ; then\n+\t\t\techo \"Invalid size '$vf_size'\"\n+\t\t\tusage $0\n+\t\t\texit 1\n+\t\tfi\n+\t\tshift 2\n+\t\t;;\n+\t-*)\n+\t\techo \"Unsupported option $1\" >&2\n+\t\tusage $0\n+\t\texit 1\n+\t\t;;\n+\t*)\n+\t\tbreak\n+\t\t;;\n+\tesac\n+done\n+\n+if [ $# != 1 ] ; then\n+\tusage $0\n+\texit 1\n+fi\n+\n+in_file=$1\n+\n+# Parse the size from the input file name and perform minimal sanity\n+# checks.\n+in_size=$(echo $in_file | sed 's/.*-\\([0-9]*\\)x\\([0-9]*\\)\\.[a-z0-9]*$/\\1x\\2/')\n+validate_size $in_size\n+if [[ $? != 0 ]] ; then\n+\techo \"Invalid input file name $in_file\" >&2\n+\tusage $0\n+\texit 1\n+fi\n+\n+out_size=${out_size:-$in_size}\n+vf_size=${vf_size:-$in_size}\n+\n+mdev=$(find_media_device)\n+mediactl=\"media-ctl -d $mdev\"\n+echo \"Using device $mdev\"\n+\n+output_dir=\"/tmp\"\n+frame_count=5\n+nbufs=7\n+run_test\n", "prefixes": [ "libcamera-devel" ] }