mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Escande <thierry.escande@collabora.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH v3] [media] vb2: Add support for capture_dma_bidirectional queue flag
Date: Fri, 21 Oct 2016 10:53:22 +0200	[thread overview]
Message-ID: <f3a6dbd1-62d6-826c-e89a-282ce51eeab4@collabora.com> (raw)
In-Reply-To: <20161021074845.GZ9460@valkosipuli.retiisi.org.uk>

Hi Sakari,

On 21/10/2016 09:48, Sakari Ailus wrote:
> Hi Thierry,
>
> On Fri, Oct 21, 2016 at 09:25:05AM +0200, Thierry Escande wrote:
>> From: Pawel Osciak <posciak@chromium.org>
>>
>> When this flag is set for CAPTURE queues by the driver on calling
>> vb2_queue_init(), it forces the buffers on the queue to be
>> allocated/mapped with DMA_BIDIRECTIONAL direction flag instead of
>> DMA_FROM_DEVICE. This allows the device not only to write to the
>> buffers, but also read out from them. This may be useful e.g. for codec
>> hardware which may be using CAPTURE buffers as reference to decode
>> other buffers.
>>
>> This flag is ignored for OUTPUT queues as we don't want to allow HW to
>> be able to write to OUTPUT buffers.
>>
>> Signed-off-by: Pawel Osciak <posciak@chromium.org>
>> Tested-by: Pawel Osciak <posciak@chromium.org>
>> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
>>
>
> Please also check where dma_dir is being used especially in memory type
> implementation. There are several comparisons to DMA_FROM_DEVICE which will
> have a different result if DMA_BIDIRECTIONAL is used instead.
Nice catch, thanks.

How about a macro like this:

#define VB2_DMA_DIR_CAPTURE(d) \
		((d) == DMA_FROM_DEVICE || (d) == DMA_BIDIRECTIONAL)

Regards,
  Thierry

  reply	other threads:[~2016-10-21  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  7:25 Thierry Escande
2016-10-21  7:48 ` Sakari Ailus
2016-10-21  8:53   ` Thierry Escande [this message]
2016-10-21  9:13     ` Sakari Ailus
  -- strict thread matches above, loose matches on Subject: below --
2016-10-20  8:56 Thierry Escande
2016-10-21  6:33 ` Sakari Ailus

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=f3a6dbd1-62d6-826c-e89a-282ce51eeab4@collabora.com \
    --to=thierry.escande@collabora.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=pawel@osciak.com \
    --cc=sakari.ailus@iki.fi \
    /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®