All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Jourdan <mjourdan@baylibre.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v2 0/3] Add Amlogic video decoder driver
Date: Mon, 17 Sep 2018 18:36:33 +0200	[thread overview]
Message-ID: <CAMO6nay7u4nMZcND6+g-GJAFsFcGrp_GDKBhVjeXVzpjF0ND4Q@mail.gmail.com> (raw)
In-Reply-To: <9c33c57e-2ce2-8752-b851-f85c03a7d761@xs4all.nl>

2018-09-17 16:51 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> On 09/11/2018 05:09 PM, Maxime Jourdan wrote:
>>  - Moved the single instance check (returning -EBUSY) to start/stop streaming
>>  The check was previously in queue_setup but there was no great location to
>>  clear it except for .close().
>
> Actually, you can clear it by called VIDIOC_REQBUFS with count set to 0. That
> freed all buffers and clears this.
>
> Now, the difference between queue_setup and start/stop streaming is that if you
> do this in queue_setup you'll know early on that the device is busy. It is
> reasonable to assume that you only allocate buffers when you also want to start
> streaming, so that it a good place to know this quickly.
>
> Whereas with start_streaming you won't know until you call STREAMON, or even later
> if you start streaming with no buffers queued, since start_streaming won't
> be called until you have at least 'min_buffers_needed' buffers queued (1 for this
> driver). So in that case EBUSY won't be returned until the first VIDIOC_QBUF.
>
> My preference is to check this in queue_setup, but it is up to you to decide.
> Just be aware of the difference between the two options.
>
> Regards,
>
>         Hans

I could for instance keep track of which queue(s) have been called
with queue_setup, catch calls to VIDIOC_REQBUFS with count set to 0,
and clear the current session once both queues have been reset ?

You leverage another issue with min_buffers_needed. It's indeed set to
1 but this value is wrong for the CAPTURE queue. The problem is that
this value changes depending on the codec and the amount of CAPTURE
buffers requested by userspace.
Ultimately I want it set to the total amount of CAPTURE buffers,
because the hardware needs the full buffer list before starting a
decode job.
Am I free to change this queue parameter later, or is m2m_queue_init
the only place to do it ?

Thanks,
Maxime

WARNING: multiple messages have this Message-ID (diff)
From: mjourdan@baylibre.com (Maxime Jourdan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] Add Amlogic video decoder driver
Date: Mon, 17 Sep 2018 18:36:33 +0200	[thread overview]
Message-ID: <CAMO6nay7u4nMZcND6+g-GJAFsFcGrp_GDKBhVjeXVzpjF0ND4Q@mail.gmail.com> (raw)
In-Reply-To: <9c33c57e-2ce2-8752-b851-f85c03a7d761@xs4all.nl>

2018-09-17 16:51 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> On 09/11/2018 05:09 PM, Maxime Jourdan wrote:
>>  - Moved the single instance check (returning -EBUSY) to start/stop streaming
>>  The check was previously in queue_setup but there was no great location to
>>  clear it except for .close().
>
> Actually, you can clear it by called VIDIOC_REQBUFS with count set to 0. That
> freed all buffers and clears this.
>
> Now, the difference between queue_setup and start/stop streaming is that if you
> do this in queue_setup you'll know early on that the device is busy. It is
> reasonable to assume that you only allocate buffers when you also want to start
> streaming, so that it a good place to know this quickly.
>
> Whereas with start_streaming you won't know until you call STREAMON, or even later
> if you start streaming with no buffers queued, since start_streaming won't
> be called until you have at least 'min_buffers_needed' buffers queued (1 for this
> driver). So in that case EBUSY won't be returned until the first VIDIOC_QBUF.
>
> My preference is to check this in queue_setup, but it is up to you to decide.
> Just be aware of the difference between the two options.
>
> Regards,
>
>         Hans

I could for instance keep track of which queue(s) have been called
with queue_setup, catch calls to VIDIOC_REQBUFS with count set to 0,
and clear the current session once both queues have been reset ?

You leverage another issue with min_buffers_needed. It's indeed set to
1 but this value is wrong for the CAPTURE queue. The problem is that
this value changes depending on the codec and the amount of CAPTURE
buffers requested by userspace.
Ultimately I want it set to the total amount of CAPTURE buffers,
because the hardware needs the full buffer list before starting a
decode job.
Am I free to change this queue parameter later, or is m2m_queue_init
the only place to do it ?

Thanks,
Maxime

WARNING: multiple messages have this Message-ID (diff)
From: mjourdan@baylibre.com (Maxime Jourdan)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v2 0/3] Add Amlogic video decoder driver
Date: Mon, 17 Sep 2018 18:36:33 +0200	[thread overview]
Message-ID: <CAMO6nay7u4nMZcND6+g-GJAFsFcGrp_GDKBhVjeXVzpjF0ND4Q@mail.gmail.com> (raw)
In-Reply-To: <9c33c57e-2ce2-8752-b851-f85c03a7d761@xs4all.nl>

2018-09-17 16:51 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> On 09/11/2018 05:09 PM, Maxime Jourdan wrote:
>>  - Moved the single instance check (returning -EBUSY) to start/stop streaming
>>  The check was previously in queue_setup but there was no great location to
>>  clear it except for .close().
>
> Actually, you can clear it by called VIDIOC_REQBUFS with count set to 0. That
> freed all buffers and clears this.
>
> Now, the difference between queue_setup and start/stop streaming is that if you
> do this in queue_setup you'll know early on that the device is busy. It is
> reasonable to assume that you only allocate buffers when you also want to start
> streaming, so that it a good place to know this quickly.
>
> Whereas with start_streaming you won't know until you call STREAMON, or even later
> if you start streaming with no buffers queued, since start_streaming won't
> be called until you have at least 'min_buffers_needed' buffers queued (1 for this
> driver). So in that case EBUSY won't be returned until the first VIDIOC_QBUF.
>
> My preference is to check this in queue_setup, but it is up to you to decide.
> Just be aware of the difference between the two options.
>
> Regards,
>
>         Hans

I could for instance keep track of which queue(s) have been called
with queue_setup, catch calls to VIDIOC_REQBUFS with count set to 0,
and clear the current session once both queues have been reset ?

You leverage another issue with min_buffers_needed. It's indeed set to
1 but this value is wrong for the CAPTURE queue. The problem is that
this value changes depending on the codec and the amount of CAPTURE
buffers requested by userspace.
Ultimately I want it set to the total amount of CAPTURE buffers,
because the hardware needs the full buffer list before starting a
decode job.
Am I free to change this queue parameter later, or is m2m_queue_init
the only place to do it ?

Thanks,
Maxime

  reply	other threads:[~2018-09-17 16:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 15:09 [PATCH v2 0/3] Add Amlogic video decoder driver Maxime Jourdan
2018-09-11 15:09 ` Maxime Jourdan
2018-09-11 15:09 ` Maxime Jourdan
2018-09-11 15:09 ` [PATCH v2 1/3] dt-bindings: media: add Amlogic Video Decoder Bindings Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-26 20:29   ` Rob Herring
2018-09-26 20:29     ` Rob Herring
2018-09-26 20:29     ` Rob Herring
2018-09-26 20:29     ` Rob Herring
2018-09-11 15:09 ` [PATCH v2 2/3] media: meson: add v4l2 m2m video decoder driver Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-12 16:10   ` kbuild test robot
2018-09-12 16:10     ` kbuild test robot
2018-09-12 16:10     ` kbuild test robot
2018-09-11 15:09 ` [PATCH v2 3/3] MAINTAINERS: Add meson video decoder Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-11 15:09   ` Maxime Jourdan
2018-09-14  9:48 ` [PATCH v2 0/3] Add Amlogic video decoder driver Maxime Jourdan
2018-09-14  9:48   ` Maxime Jourdan
2018-09-14  9:48   ` Maxime Jourdan
2018-09-17 14:51 ` Hans Verkuil
2018-09-17 14:51   ` Hans Verkuil
2018-09-17 14:51   ` Hans Verkuil
2018-09-17 16:36   ` Maxime Jourdan [this message]
2018-09-17 16:36     ` Maxime Jourdan
2018-09-17 16:36     ` Maxime Jourdan
2018-09-21 10:51     ` Hans Verkuil
2018-09-21 10:51       ` Hans Verkuil
2018-09-21 10:51       ` Hans Verkuil
2018-09-27  8:46       ` Maxime Jourdan
2018-09-27  8:46         ` Maxime Jourdan
2018-09-27  8:46         ` Maxime Jourdan

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=CAMO6nay7u4nMZcND6+g-GJAFsFcGrp_GDKBhVjeXVzpjF0ND4Q@mail.gmail.com \
    --to=mjourdan@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mchehab@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 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.