From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ran Shalit <ranshalit@gmail.com>, linux-media@vger.kernel.org
Subject: Re: Interrupt handler responsibility
Date: Mon, 23 Nov 2015 09:48:29 +0100 [thread overview]
Message-ID: <5652D2DD.2040903@xs4all.nl> (raw)
In-Reply-To: <CAJ2oMhL93kMM8i9Mc9ayRmtAkCyN1Stq2SRsjNpeLrVvR5DWNw@mail.gmail.com>
On 11/21/2015 11:20 PM, Ran Shalit wrote:
> Hello,
>
> I am trying to understand the interrupt handler responsibility in
> v4l2, also with respect to dma usage. I see that it is not defined as
> part of the videobuf2 API.
>
> This is what I understand this far:
> 1. start_streaming is responsible for getting into "streaming" state.
> dma start should be trigggered at this point.
Right.
> 2. interrupt handler: is responsible for passing back the buffer to
> user using vb2_buffer_done() call.
Right.
>
> But what is the exact reponsibility of interrupt handler with respect
> to dma usage ?
Typically when the DMA has finished DMAing a frame it will generate an interrupt.
The interrupt handler will then call vb2_buffer_done() handing the buffer back
to the vb2 framework. Think of it as who owns the buffer: when buf_queue is called
the buffer is handed from vb2 to the driver, and the driver calls vb2_buffer_done()
when it is finished with the buffer (i.e. the data is DMAed into the buffer) and
it hands it back to vb2.
> In some of the drivers I see that the interrupt start/stop dma, but in
> v4l2-pci-skeleton.c I don't see any usage of dma in the interrupt
> handler, so I'm not sure.
The interrupt handler is called in response of a DMA interrupt. How that interrupt
is generated is hardware specific, so that's why you don't see it in the skeleton
driver.
Regards,
Hans
prev parent reply other threads:[~2015-11-23 8:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-21 22:20 Interrupt handler responsibility Ran Shalit
2015-11-23 8:48 ` 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=5652D2DD.2040903@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=ranshalit@gmail.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.