All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Tomasz Figa <tfiga@chromium.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Alexandre Courbot <acourbot@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Nicolas Dufresne <nicolas@ndufresne.ca>
Subject: RFC: Request API and memory-to-memory devices
Date: Thu, 24 May 2018 10:44:13 +0200	[thread overview]
Message-ID: <157f4fc4-eebf-41ab-1e9c-93d7baefc612@xs4all.nl> (raw)

Memory-to-memory devices have one video node, one internal control handler
but two vb2_queues (DMA engines). While often there is one buffer produced
for every buffer consumed, but this is by no means standard. E.g. deinterlacers
will produce on buffer for every two buffers consumed. Codecs that receive
a bit stream and can parse it to discover the framing may have no relation
between the number of buffers consumed and the number of buffers produced.

This poses a few problems for the Request API. Requiring that a request
contains the buffers for both output and capture queue will be difficult
to implement, especially in the latter case where there is no relationship
between the number of consumed and produced buffers.

In addition, userspace can make two requests: one for the capture queue,
one for the output queue, each with associated controls. But since the
controls are shared between capture and output there is an issue of
what to do when the same control is set in both requests.

I propose to restrict the usage of requests for m2m drivers to the output
queue only. This keeps things simple for both kernel and userspace and
avoids complex solutions.

Requests only make sense if there is actually configuration you can apply
for each buffer, and while that's true for the output queue, on the capture
queue you just capture the result of whatever the device delivers. I don't
believe there is much if anything you can or want to control per-buffer.

Am I missing something? Comments?

Regards,

	Hans

             reply	other threads:[~2018-05-24  8:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  8:44 Hans Verkuil [this message]
2018-05-25  4:15 ` RFC: Request API and memory-to-memory devices Tomasz Figa
2018-05-25 14:16 ` Sakari Ailus
2018-05-25 14:40   ` Tomasz Figa
2018-05-25 15:26   ` Hans Verkuil
2018-06-04 11:42     ` Hans Verkuil

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=157f4fc4-eebf-41ab-1e9c-93d7baefc612@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=acourbot@chromium.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.