From: Florian Echtler <floe@butterbrot.org>
To: Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-input@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH] add raw video support for Samsung SUR40 touchscreen
Date: Thu, 29 Jan 2015 22:35:02 +0100 [thread overview]
Message-ID: <54CAA786.2040908@butterbrot.org> (raw)
In-Reply-To: <54BFA9D6.1040201@xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 4225 bytes --]
Hello again,
On 21.01.2015 14:29, Hans Verkuil wrote:
> On 01/21/15 14:28, Florian Echtler wrote:
>> On 20.01.2015 14:06, Laurent Pinchart wrote:
>>> That depends on the platform and whether it can DMA to vmalloc'ed memory :-)
>>> To be totally safe I think vb2-dma-sg would be better, but I'm not sure it's
>>> worth the trouble. uvcvideo uses vb2-vmalloc as it performs a memcpy anyway.
>> The SUR40 sends raw video data without any headers over the bulk
>> endpoint in blocks of 16k, so I'm assuming that in this specific case,
>> vb2-dma-sg would be the most efficient choice?
I'm still having a couple of issues sorting out the correct way to
provide DMA access for my driver. I've integrated most of your
suggestions, but I still can't switch from dma-contig to dma-sg.
As far as I understood it, there is no further initialization required
besides using vb2_dma_sg_memops, vb2_dma_sg_init_ctx and
vb2_dma_sg_cleanup_ctx instead of the respective -contig- calls, correct?
However, as soon as I swap the relevant function calls, the video image
stays black and in dmesg, I get the following warning:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 37 at
/home/kernel/COD/linux/drivers/usb/core/hcd.c:1504
usb_hcd_map_urb_for_dma+0x4eb/0x500()
transfer buffer not dma capable
Modules linked in: sur40(OE) videobuf2_dma_contig videobuf2_dma_sg
videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev
media dm_crypt joydev input_polldev wl(POE) snd_hda_codec_realtek
snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel
snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_seq_midi
snd_seq_midi_event snd_rawmidi cfg80211 kvm_amd snd_seq kvm edac_core
serio_raw snd_seq_device btusb snd_timer edac_mce_amd snd ipmi_si
ipmi_msghandler k10temp sp5100_tco i2c_piix4 soundcore bnep 8250_fintek
shpchp tpm_infineon rfcomm bluetooth mac_hid parport_pc ppdev lp parport
hid_apple usbhid hid pata_acpi uas usb_storage amdkfd amd_iommu_v2
radeon psmouse pata_atiixp i2c_algo_bit ttm drm_kms_helper drm ahci
libahci r8169 mii [last unloaded: sur40]
CPU: 1 PID: 37 Comm: kworker/1:1 Tainted: P OE
3.19.0-031900rc6-generic #201501261152
Hardware name: Samsung SUR40/SDNE-R78BA2-20, BIOS SDNE-R78BA2-2000
11/04/2011
Workqueue: events_freezable input_polled_device_work [input_polldev]
00000000000005e0 ffff8801320c3aa8 ffffffff817c4584 0000000000000007
ffff8801320c3af8 ffff8801320c3ae8 ffffffff81076df7 0000000000000000
ffff8800a71fa6c0 ffff88013243f800 0000000000000010 0000000000000002
Call Trace:
[<ffffffff817c4584>] dump_stack+0x45/0x57
[<ffffffff81076df7>] warn_slowpath_common+0x97/0xe0
[<ffffffff81076ef6>] warn_slowpath_fmt+0x46/0x50
[<ffffffff815aff0b>] usb_hcd_map_urb_for_dma+0x4eb/0x500
[<ffffffff817d03b4>] ? schedule_timeout+0x124/0x210
[<ffffffff815b0bd5>] usb_hcd_submit_urb+0x135/0x1c0
[<ffffffff815b20a6>] usb_submit_urb.part.8+0x1f6/0x580
[<ffffffff811bb542>] ? vmap_pud_range+0x122/0x1c0
[<ffffffff815b2465>] usb_submit_urb+0x35/0x80
[<ffffffff815b339a>] usb_start_wait_urb+0x6a/0x170
[<ffffffff815b1cce>] ? usb_alloc_urb+0x1e/0x50
[<ffffffff815b1cce>] ? usb_alloc_urb+0x1e/0x50
[<ffffffff815b3570>] usb_bulk_msg+0xd0/0x1a0
[<ffffffffc059a841>] sur40_poll+0x561/0x5e0 [sur40]
[<ffffffffc016134b>] input_polled_device_work+0x1b/0x30 [input_polldev]
[<ffffffff8108f6dd>] process_one_work+0x14d/0x460
[<ffffffff810900bb>] worker_thread+0x11b/0x3f0
[<ffffffff8108ffa0>] ? create_worker+0x1e0/0x1e0
[<ffffffff81095cc9>] kthread+0xc9/0xe0
[<ffffffff81095c00>] ? flush_kthread_worker+0x90/0x90
[<ffffffff817d17fc>] ret_from_fork+0x7c/0xb0
[<ffffffff81095c00>] ? flush_kthread_worker+0x90/0x90
---[ end trace 30eaf6524fd028d3 ]---
Moreover, I'm getting the following test failure from v4l2-compliance:
Streaming ioctls:
test read/write: OK
test MMAP: OK
fail: v4l2-test-buffers.cpp(951): buf.qbuf(node)
fail: v4l2-test-buffers.cpp(994): setupUserPtr(node, q)
test USERPTR: FAIL
test DMABUF: Cannot test, specify --expbuf-device
Total: 45, Succeeded: 44, Failed: 1, Warnings: 0
Any suggestions how to deal with this?
Best regards, Florian
--
SENT FROM MY DEC VT50 TERMINAL
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-01-29 21:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 10:35 [PATCH] add raw video support for Samsung SUR40 touchscreen Florian Echtler
2015-01-19 10:38 ` Hans Verkuil
2015-01-20 9:24 ` Florian Echtler
2015-01-20 9:30 ` Hans Verkuil
2015-01-20 12:59 ` Laurent Pinchart
2015-01-20 13:03 ` Hans Verkuil
2015-01-20 13:06 ` Laurent Pinchart
2015-01-21 13:28 ` Florian Echtler
2015-01-21 13:29 ` Hans Verkuil
2015-01-29 21:35 ` Florian Echtler [this message]
2015-02-03 20:45 ` Florian Echtler
2015-02-04 8:08 ` Hans Verkuil
2015-02-04 10:08 ` Florian Echtler
2015-02-04 10:22 ` Hans Verkuil
2015-02-04 10:56 ` Florian Echtler
2015-02-04 11:34 ` Laurent Pinchart
2015-02-04 11:39 ` Hans Verkuil
2015-02-04 13:21 ` Florian Echtler
2015-02-04 14:06 ` Laurent Pinchart
2015-02-04 13:51 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54CAA786.2040908@butterbrot.org \
--to=floe@butterbrot.org \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).