All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Federico Vaga <federico.vaga@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	'Mauro Carvalho Chehab' <mchehab@infradead.org>,
	'Pawel Osciak' <pawel@osciak.com>,
	'Hans Verkuil' <hans.verkuil@cisco.com>,
	'Giancarlo Asnaghi' <giancarlo.asnaghi@st.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	'Jonathan Corbet' <corbet@lwn.net>,
	sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: Re: [PATCH v3 2/4] videobuf2-dma-streaming: new videobuf2 memory allocator
Date: Tue, 18 Dec 2012 15:41:58 +0100	[thread overview]
Message-ID: <50D080B6.1020109@samsung.com> (raw)
In-Reply-To: <1535483.0HokefWAdm@harkonnen>

Hello,

I'm sorry for the delay, I've been terribly busy recently.

On 12/11/2012 2:54 PM, Federico Vaga wrote:

>> > This allocator is needed because some device (like STA2X11 VIP) cannot
>> > work
>> > with DMA sg or DMA coherent. Some other device (like the one used by
>> > Jonathan when he proposes vb2-dma-nc allocator) can obtain much better
>> > performance with DMA streaming than coherent.
>>
>> Ok, please add such explanations at the patch's descriptions, as it is
>> important not only for me, but to others that may need to use it..
>
> OK
>
>> >> 	2) why vb2-dma-config can't be patched to use dma_map_single
>> >>
>> >> (eventually using a different vb2_io_modes bit?);
>> >
>> > I did not modify vb2-dma-contig because I was thinking that each DMA
>> > memory allocator should reflect a DMA API.
>>
>> The basic reason for having more than one VB low-level handling (vb2 was
>> inspired on this concept) is that some DMA APIs are very different than
>> the other ones (see vmalloc x DMA S/G for example).
>>
>> I didn't make a diff between videobuf2-dma-streaming and
>> videobuf2-dma-contig, so I can't tell if it makes sense to merge them or
>> not, but the above argument seems too weak. I was expecting for a technical
>> reason why it wouldn't make sense for merging them.
>
> I cannot work on this now. But I think that I can do an integration like the
> one that I pushed some month ago (a8f3c203e19b702fa5e8e83a9b6fb3c5a6d1cce4).
> Wind River made that changes to videobuf-contig and I tested, fixed and
> pushed.
>
>> >> 	3) what are the usecases for it.
>> >>
>> >> Could you please detail it? Without that, one that would be needing to
>> >> write a driver will have serious doubts about what would be the right
>> >> driver for its usage. Also, please document it at the driver itself.
>
> I don't have a full understand of the board so I don't know exactly why
> dma_alloc_coherent does not work. I focused my development on previous work by
> Wind River. I asked to Wind River (which did all the work on this board) for
> the technical explanation about why coherent doesn't work, but they do not
> know. That's why I made the new allocator: coherent doesn't work and HW
> doesn't support SG.

Ok, now I see the whole image. I was convinced that this so called 
streaming allocator is required for performance reasons, not because of 
the broken platform support for coherent calls.

My ultimate goal is to have support for both non-cached (coherent) and 
cached (non-coherent) buffers in the dma mapping subsystem on top of the 
common API. Then both types of buffers will be easily supported by 
dma-contig vb2 allocator. Currently support for streaming-style buffers 
requires completely different dma mapping calls, although from the 
device driver point of view the buffers behaves similarly, so 
implementing them as a separate allocator seems to be the best idea.

I can take a look at the dma coherent issues with that board, but I will 
need some help as I don't have this hardware.

>> I'm not a DMA performance expert. As such, from that comment, it sounded to
>> me that replacing dma-config/dma-sg by dma streaming will always give
>> "performance optimizations the hardware allow".
>
> me too, I'm not a DMA performance expert. I'm just an user of the DMA API. On
> my hardware simply it works only with that interface, it is not a performance
> problem.
>
>> On a separate but related issue, while doing DMABUF tests with an Exynos4
>> hardware, using a s5p sensor, sending data to s5p-tv, I noticed a CPU
>> consumption of about 42%, which seems too high. Could it be related to
>> not using the DMA streaming API?

This might be related to the excessive cpu cache flushing on dma buf 
buffers as there were some misunderstanding who is responsible of that 
(I saw some strange code in drm, but it has been changed a few times). I 
will add this issue to my todo list.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center


  reply	other threads:[~2012-12-18 14:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 10:58 [PATCH v3 1/4] v4l: vb2: add prepare/finish callbacks to allocators Federico Vaga
2012-09-24 10:58 ` [PATCH v3 2/4] videobuf2-dma-streaming: new videobuf2 memory allocator Federico Vaga
2012-09-24 12:44   ` Marek Szyprowski
2012-12-04 16:04     ` Mauro Carvalho Chehab
2012-12-05 12:50       ` Federico Vaga
2012-12-05 14:25         ` Mauro Carvalho Chehab
2012-12-11 13:54           ` Federico Vaga
2012-12-18 14:41             ` Marek Szyprowski [this message]
2012-12-20 15:37               ` Federico Vaga
2013-01-01 12:52                 ` Mauro Carvalho Chehab
2013-01-03 16:13                   ` Federico Vaga
2013-01-04 13:30                     ` Federico Vaga
2013-01-06 17:04                       ` Federico Vaga
2013-01-06 23:09                         ` Alessandro Rubini
2013-01-07 19:40                           ` Jonathan Corbet
2013-01-07 20:15                             ` Mauro Carvalho Chehab
2013-01-08  6:50                               ` Marek Szyprowski
2013-01-08 14:31                                 ` Jonathan Corbet
2013-01-09  7:48                                   ` Michael Olbrich
2012-09-24 10:58 ` [PATCH v3 3/4] sta2x11_vip: convert to videobuf2 and control framework Federico Vaga
2012-12-04 16:15   ` Mauro Carvalho Chehab
2012-12-05  1:12     ` Federico Vaga
2012-12-05 11:34       ` Mauro Carvalho Chehab
2012-12-05 12:24         ` Federico Vaga
2012-12-05 13:10           ` Mauro Carvalho Chehab
2012-12-05 13:27             ` Federico Vaga
2012-12-05 13:37               ` Mauro Carvalho Chehab
2012-12-05 13:45                 ` Federico Vaga
2012-12-06 18:59             ` Federico Vaga
2012-09-24 10:58 ` [PATCH v3 4/4] adv7180: remove {query/g_/s_}ctrl Federico Vaga
2012-09-24 12:46 ` [PATCH v3 1/4] v4l: vb2: add prepare/finish callbacks to allocators Marek Szyprowski
2012-09-25 15:04 ` Federico Vaga

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=50D080B6.1020109@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=corbet@lwn.net \
    --cc=federico.vaga@gmail.com \
    --cc=giancarlo.asnaghi@st.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@redhat.com \
    --cc=pawel@osciak.com \
    --cc=s.nawrocki@samsung.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.