dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Neil Armstrong <narmstrong@baylibre.com>,
	broonie@kernel.org, balbi@kernel.org, lee.jones@linaro.org
Cc: linux-usb@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [RFC 0/9] Regmap over USB for Multifunction USB Device (gpio, display, ...)
Date: Mon, 17 Feb 2020 15:05:02 +0100	[thread overview]
Message-ID: <0ae9eda9-3e1a-d231-2a03-1877f5a3a0bb@tronnes.org> (raw)
In-Reply-To: <62e6e9b1-f44a-42ae-a971-8b947763284b@baylibre.com>



Den 17.02.2020 11.32, skrev Neil Armstrong:
> Hi,
> 
> On 16/02/2020 18:21, Noralf Trønnes wrote:
>> Hi,
>>
>> A while back I had the idea to turn a Raspberry Pi Zero into a $5
>> USB to HDMI/SDTV/DSI/DPI display adapter.
>>
>> Thinking about how to represent the display to the driver I realised
>> that hardware use registers as API. And Linux does have a generic
>> register abstraction: regmap. Furthermore this means that if I can do a
>> regmap over USB implementation, it will be easy to do other functions
>> like gpio, adc and others. After a few iterations trying to understand
>> the USB subsystem and satisfying driver requirements, I now have
>> something that looks promising.
>>
>> I'm sending out an early version hoping to get feedback especially on
>> the core parts that handles regmap and interrupts.
>>
>> Overview:
>>
>>           USB Host          :         USB Device
>>                             :
>>             --------------  :  ------------------
>> ----------  | mfd: mud   |  :  | f_mud          |  ----------
>> | Driver |  --------------  :  |                |  | Driver |
>> ----------  | regmap-usb |  :  | (mud_regmap)   |  ----------
>>             --------------  :  ------------------
>>
> 
> The idea is really like ARA's greybus, but much simpler !
> Anyway nice idea, do you have good performance over USB2 and
> RPi's awful DWC2 gagdet controller ?
> 

Not as good as I was hoping for. If I disable compression I'm getting 5
fps for a 1.5MB framebuffer (7800 kB/s):

$ modetest -M mud_drm -s 35:1024x768@RG16 -v
setting mode 1024x768-60.00Hz@RG16 on connectors 35, crtc 33
freq: 5.07Hz

When I tried reading I discovered that it was almost 3 times faster than
writing.

The zero gadget (loop testing) confirmed my findings:

Device:
$ sudo modprobe g_zero
[   44.221890] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
[   44.221906] zero gadget: zero ready
[   60.751451] zero gadget: high-speed config #3: source/sink

Host:

$ sudo ~/testusb -a -t <n> -g 64 -s 16384
/dev/bus/usb/001/010 test 27,  107.230669 secs	-> 1000 / 107 =  9MB/s
/dev/bus/usb/001/010 test 28,   37.791292 secs	-> 1000 / 37  = 27MB/s
[73983.796552] usbtest 1-1.3:3.0: TEST 27: bulk write 1000Mbytes
[74205.060204] usbtest 1-1.3:3.0: TEST 28: bulk read 1000Mbytes

$ sudo ~/testusb -a -t <n> -g 64 -s 16384
/dev/bus/usb/001/010 test 5,  107.421535 secs
/dev/bus/usb/001/010 test 6,   38.189712 secs
[74893.204170] usbtest 1-1.3:3.0: TEST 5:  write 1000 sglists 64 entries
of 16384 bytes
[75012.592222] usbtest 1-1.3:3.0: TEST 6:  read 1000 sglists 64 entries
of 16384 bytes


I have tried Raspberry Pi1 and Pi4 as host (2 different controllers)
and Pi Zero and Beaglebone Black as device, getting similar result.

I found this post having the same issue:

Re: Asymmetric speed results with testusb/usbtest/g_zero
https://www.spinics.net/lists/linux-usb/msg100588.html

I haven't got a usb analyzer, but adding printk to
dwc2_assign_and_init_hc() showed that IN interrupts were 2-3 ms apart
but OUT interrupts were ~8 ms apart.

Noralf.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-02-17 14:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 17:21 [RFC 0/9] Regmap over USB for Multifunction USB Device (gpio, display, ...) Noralf Trønnes
2020-02-16 17:21 ` [RFC 1/9] regmap: Add USB support Noralf Trønnes
2020-02-17 12:11   ` Mark Brown
2020-02-17 21:33     ` Noralf Trønnes
2020-02-17 21:39       ` Mark Brown
2020-02-17 22:15         ` Noralf Trønnes
2020-02-17 22:44           ` Mark Brown
2020-02-16 17:21 ` [RFC 2/9] mfd: Add driver for Multifunction USB Device Noralf Trønnes
2020-02-27  9:09   ` Lee Jones
2020-02-29 13:26     ` Noralf Trønnes
2020-02-29 16:02       ` Alan Stern
2020-02-16 17:21 ` [RFC 3/9] usb: gadget: function: Add Multifunction USB Device support Noralf Trønnes
2020-02-16 17:21 ` [RFC 4/9] pinctrl: Add Multifunction USB Device pinctrl driver Noralf Trønnes
2020-02-16 17:21 ` [RFC 5/9] usb: gadget: function: mud: Add gpio support Noralf Trønnes
2020-02-16 17:21 ` [RFC 6/9] regmap: Speed up _regmap_raw_write_impl() for large buffers Noralf Trønnes
2020-02-17 12:15   ` Mark Brown
2020-02-16 17:21 ` [RFC 7/9] drm: Add Multifunction USB Device display driver Noralf Trønnes
2020-02-16 17:21 ` [RFC 8/9] drm/client: Add drm_client_init_from_id() and drm_client_modeset_set() Noralf Trønnes
2020-02-17  9:38   ` Daniel Vetter
2020-02-23 17:43     ` Noralf Trønnes
2020-02-23 20:59       ` Daniel Vetter
2020-02-16 17:21 ` [RFC 9/9] usb: gadget: function: mud: Add display support Noralf Trønnes
2020-02-17  9:40 ` [RFC 0/9] Regmap over USB for Multifunction USB Device (gpio, display, ...) Daniel Vetter
2020-02-17 10:32 ` Neil Armstrong
2020-02-17 14:05   ` Noralf Trønnes [this message]
2020-02-18 20:57 ` Andy Shevchenko
2020-02-18 21:31   ` Noralf Trønnes

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=0ae9eda9-3e1a-d231-2a03-1877f5a3a0bb@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=balbi@kernel.org \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    /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).