All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Alexandre Courbot <acourbot@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Pawel Osciak <posciak@chromium.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Gustavo Padovan <gustavo.padovan@collabora.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/9] media: base request API support
Date: Mon, 15 Jan 2018 09:43:09 +0100	[thread overview]
Message-ID: <b93cf61c-b5fb-1b70-f73c-a84290c4e09c@xs4all.nl> (raw)
In-Reply-To: <CAPBb6MXgMPU+9hQK2uyMLiOvywrPX=L7xiP5TwKzZLNkvbtNyQ@mail.gmail.com>

On 01/15/2018 09:24 AM, Alexandre Courbot wrote:
> Hi Hans,
> 
> On Fri, Jan 12, 2018 at 8:45 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> Hi Alexandre,
>>
>> On 12/15/17 08:56, Alexandre Courbot wrote:
>>> Here is a new attempt at the request API, following the UAPI we agreed on in
>>> Prague. Hopefully this can be used as the basis to move forward.
>>>
>>> This series only introduces the very basics of how requests work: allocate a
>>> request, queue buffers to it, queue the request itself, wait for it to complete,
>>> reuse it. It does *not* yet use Hans' work with controls setting. I have
>>> preferred to submit it this way for now as it allows us to concentrate on the
>>> basic request/buffer flow, which was harder to get properly than I initially
>>> thought. I still have a gut feeling that it can be improved, with less back-and-
>>> forth into drivers.
>>>
>>> Plugging in controls support should not be too hard a task (basically just apply
>>> the saved controls when the request starts), and I am looking at it now.
>>>
>>> The resulting vim2m driver can be successfully used with requests, and my tests
>>> so far have been successful.
>>>
>>> There are still some rougher edges:
>>>
>>> * locking is currently quite coarse-grained
>>> * too many #ifdef CONFIG_MEDIA_CONTROLLER in the code, as the request API
>>>   depends on it - I plan to craft the headers so that it becomes unnecessary.
>>>   As it is, some of the code will probably not even compile if
>>>   CONFIG_MEDIA_CONTROLLER is not set
>>>
>>> But all in all I think the request flow should be clear and easy to review, and
>>> the possibility of custom queue and entity support implementations should give
>>> us the flexibility we need to support more specific use-cases (I expect the
>>> generic implementations to be sufficient most of the time though).
>>>
>>> A very simple test program exercising this API is available here (don't forget
>>> to adapt the /dev/media0 hardcoding):
>>> https://gist.github.com/Gnurou/dbc3776ed97ea7d4ce6041ea15eb0438
>>>
>>> Looking forward to your feedback and comments!
>>
>> I think this will become more interesting when the control code is in.
> 
> Definitely.
> 
>> The main thing I've noticed with this patch series is that it is very codec
>> oriented. Which in some ways is OK (after all, that's the first type of HW
>> that we want to support), but the vb2 code in particular should be more
>> generic.
> 
> I don't want to expand too much into use-cases I do not master ; doing
> so would be speculating about how the API will be used. But feel free
> to point out where you think my focus on the codec use-case is not
> future-proof.

The vb2 framework is a core component and it should function properly with
the request API for all drivers using it.

Easiest would be to test this using vivid and vimc. The vb2 code is relatively
simple: all it has to do is keep track of requests and buffers and queue them
up to the driver at the right time. It doesn't really need to know if the driver
is a codec or something else, it's all the same to the framework.

Regards,

	Hans

>> I would also recommend that you start preparing documentation patches: we
>> can review that and make sure all the corner-cases are correctly documented.
>>
>> The public API changes are (I think) fairly limited, but the devil is in
>> the details, so getting that reviewed early on will help you later.
> 
> Yeah, I now regret to have submitted this series without
> documentation. Won't do that mistake again.
> 
>> It's a bit unfortunate that the fence patch series is also making vb2 changes,
>> but I hope that will be merged fairly soon so you can develop on top of that
>> series.
> 
> The fence series may actually make things easier. The vb2 code of this
> series is a bit confusing, and fences add a few extra constraints that
> should make things more predictable. So I am looking forward to being
> able to work on top of it.
> 

      reply	other threads:[~2018-01-15  8:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  7:56 [RFC PATCH 0/9] media: base request API support Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 1/9] media: add request API core and UAPI Alexandre Courbot
2017-12-15 10:37   ` Philippe Ombredanne
2018-01-12 10:16   ` Hans Verkuil
2018-01-26  8:39   ` Sakari Ailus
2018-01-30  4:23     ` Alexandre Courbot
2018-02-02  7:33       ` Sakari Ailus
2018-02-02  7:41         ` Tomasz Figa
2018-02-02  8:00         ` Hans Verkuil
2017-12-15  7:56 ` [RFC PATCH 2/9] media: request: add generic queue Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 3/9] media: request: add generic entity ops Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 4/9] videodev2.h: Add request field to v4l2_buffer Alexandre Courbot
2018-01-12 10:22   ` Hans Verkuil
2018-01-15  8:24     ` Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 5/9] media: vb2: add support for requests Alexandre Courbot
2018-01-12 10:49   ` Hans Verkuil
2018-01-15  8:24     ` Alexandre Courbot
2018-01-15  9:07       ` Hans Verkuil
2018-01-16  9:39         ` Alexandre Courbot
2018-01-16 10:37           ` Hans Verkuil
2018-01-17  8:01             ` Alexandre Courbot
2018-01-17  8:37               ` Hans Verkuil
2017-12-15  7:56 ` [RFC PATCH 6/9] media: vb2: add support for requests in QBUF ioctl Alexandre Courbot
2018-01-12 11:37   ` Hans Verkuil
2018-01-15  8:24     ` Alexandre Courbot
2018-01-15  9:19       ` Hans Verkuil
2018-01-16  9:40         ` Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 7/9] media: v4l2-mem2mem: add request support Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 8/9] media: vim2m: add media device Alexandre Courbot
2017-12-15  7:56 ` [RFC PATCH 9/9] media: vim2m: add request support Alexandre Courbot
2017-12-18 20:53   ` Gustavo Padovan
2017-12-20  9:29     ` Alexandre Courbot
2017-12-15 21:02 ` [RFC PATCH 0/9] media: base request API support Nicolas Dufresne
2017-12-20  9:24   ` Alexandre Courbot
2017-12-15 21:04 ` Nicolas Dufresne
2017-12-20  9:27   ` Alexandre Courbot
2018-01-12 11:45 ` Hans Verkuil
2018-01-15  8:24   ` Alexandre Courbot
2018-01-15  8:43     ` Hans Verkuil [this message]

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=b93cf61c-b5fb-1b70-f73c-a84290c4e09c@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=acourbot@chromium.org \
    --cc=gustavo.padovan@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=posciak@chromium.org \
    --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.