mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keisuke Tsukuda <tkdkei@outlook.jp>
To: Daehwan Jung <dh10.jung@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"selvarasu.g@samsung.com" <selvarasu.g@samsung.com>,
	Avichal Rakesh <arakesh@google.com>,
	"jchowdhary@google.com" <jchowdhary@google.com>
Subject: Re: [PATCH] usb: gadget: uvc: reserve frame interval headroom for the zero length backlog
Date: Thu, 3 Dec 2026 00:50:16 +0000	[thread overview]
Message-ID: <20261203004939.88424-1-tkdkei@outlook.jp> (raw)
In-Reply-To: <20261012034018.3193146-1-dh10.jung@samsung.com>

On Mon, Oct 12, 2026, Daehwan Jung wrote:
> The frame period is therefore reqs_per_frame plus that backlog, always
> longer than the frame interval the host asked for.

I tested this on a Tinker Board 3N (RK3568/DWC3) at SuperSpeed, using
usb-testing 9357829ac604 and a Mac host. The gadget offered 160x120
YUYV at 60 fps (166666 x 100 ns), with bInterval 1, wMaxPacketSize
1024 and bMaxBurst 2. I used the same test-pattern source with and
without the patch.

I queued four buffers before STREAMON and requeued each after DQBUF.
The host received 60.6 fps without the patch and 80.0 fps with it.
The five-second gadget traces contained no zero-length requests, and
the gadget completed 303 versus 400 frames.
Between completed frames, there were 132 versus 100 payload requests.
Those counts are slightly below the 134 versus 101 budgeted by
reqs_per_frame because the driver emits 8-byte headers for this test
source where the sizing calculation allows for 12.

I then allocated two buffers but kept only one queued, putting it back
after DQBUF.
The trace showed 33 empty request completions between successive
completed frames. The host rate went from 48.5 to 60.2 fps with the
patch.

This test source fills buffers as soon as they are returned; a camera
that captures at a fixed rate might behave differently. The patch
still reduces the requests per frame from 132 to 100 when no empty
requests are queued. The four-buffer stream ran at 80 fps with a
selected 60 fps interval. Is that expected? Should userspace pace the
frames?

  parent reply	other threads:[~2026-12-03  0:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20261012034422epcas2p486b38818b542d2fff5b5fed58863ec6e@epcas2p4.samsung.com>
2026-10-12  3:40 ` Daehwan Jung
2026-10-13 21:15   ` Avichal Rakesh
2026-10-19  7:25     ` Daehwan Jung
2026-12-03  0:50   ` Keisuke Tsukuda [this message]
2026-12-03  7:57     ` Daehwan Jung

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=20261203004939.88424-1-tkdkei@outlook.jp \
    --to=tkdkei@outlook.jp \
    --cc=arakesh@google.com \
    --cc=dh10.jung@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jchowdhary@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=selvarasu.g@samsung.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

all inboxes | Powered by JetHome®