From: Marin Mitov <mitov@issp.bas.bg>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Tony Lindgren <tony@atomide.com>,
"Discussion of the Amstrad E3 emailer hardware/software"
<e3-hacking@earth.li>
Subject: Re: [RFC] [PATCH 1/6] SoC Camera: add driver for OMAP1 camera interface
Date: Thu, 19 Aug 2010 20:25:31 +0300 [thread overview]
Message-ID: <201008192025.31660.mitov@issp.bas.bg> (raw)
In-Reply-To: <201008191909.28697.jkrzyszt@tis.icnet.pl>
On Thursday, August 19, 2010 08:09:27 pm Janusz Krzysztofik wrote:
> Thursday 19 August 2010 14:16:21 Marin Mitov napisał(a):
> > On Thursday, August 19, 2010 02:39:47 pm Guennadi Liakhovetski wrote:
> > >
> > > No, I don't think you should go to the next power of 2 - that's too
> > > crude. Try rounding your buffer size to the page size, that should
> > > suffice.
>
> Guennadi,
> If you have a look at how a device reserved memory is next allocated to a
> driver with drivers/base/dma-coherent.c::dma_alloc_from_coherent(), then than
> you may find my conclusion on a power of 2 as true:
>
> int dma_alloc_from_coherent(struct device *dev, ssize_t size,
> dma_addr_t *dma_handle, void **ret)
> {
> ...
> int order = get_order(size);
> ...
> pageno = bitmap_find_free_region(mem->bitmap, mem->size, order);
> ...
> }
>
>
> > Allocated coherent memory is always a power of 2.
>
> Marin,
> For ARM, this seems true as long as allocated with the above from a device
> assigned pool, but not true for a (pre)allocation from a generic system RAM.
> See arch/arm/mm/dma-mapping.c::__dma_alloc_buffer(), where it looks like extra
> pages are freed:
>
> static struct page *__dma_alloc_buffer(struct device *dev, size_t size, gfp_t gfp)
> {
> unsigned long order = get_order(size);
> ...
> page = alloc_pages(gfp, order);
> ...
> split_page(page, order);
> for (p = page + (size >> PAGE_SHIFT), e = page + (1 << order); p < e; p++)
> __free_page(p);
> ...
> }
Thanks for the clarification.
Marin Mitov
>
>
> Thanks,
> Janusz
>
next prev parent reply other threads:[~2010-08-19 17:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-18 4:18 [RFC] [PATCH 0/6] Add camera support to the OMAP1 Amstrad Delta videophone Janusz Krzysztofik
2010-07-18 4:21 ` [RFC] [PATCH 1/6] SoC Camera: add driver for OMAP1 camera interface Janusz Krzysztofik
2010-07-30 11:07 ` Guennadi Liakhovetski
2010-07-30 18:49 ` Janusz Krzysztofik
2010-08-01 15:51 ` Janusz Krzysztofik
2010-08-12 21:38 ` Guennadi Liakhovetski
2010-08-13 7:24 ` Janusz Krzysztofik
2010-08-13 8:52 ` Guennadi Liakhovetski
2010-08-13 9:11 ` Marin Mitov
2010-08-13 19:13 ` Janusz Krzysztofik
2010-08-14 4:47 ` Marin Mitov
2010-08-14 10:28 ` Janusz Krzysztofik
2010-08-14 17:33 ` Guennadi Liakhovetski
2010-08-15 11:25 ` Janusz Krzysztofik
2010-08-16 10:17 ` Marin Mitov
2010-08-19 11:08 ` Janusz Krzysztofik
2010-08-19 11:39 ` Guennadi Liakhovetski
2010-08-19 12:16 ` Marin Mitov
2010-08-19 17:09 ` Janusz Krzysztofik
2010-08-19 17:25 ` Marin Mitov [this message]
2010-07-18 4:23 ` [RFC] [PATCH 2/6] OMAP1: Add support for SoC " Janusz Krzysztofik
2010-07-18 4:24 ` [RFC] [PATCH 3/6] SoC Camera: add driver for OV6650 sensor Janusz Krzysztofik
2010-08-22 16:40 ` Guennadi Liakhovetski
2010-08-22 19:45 ` Janusz Krzysztofik
2010-08-22 20:30 ` Guennadi Liakhovetski
2010-08-23 0:03 ` Marek Vasut
2010-07-18 4:26 ` [RFC] [PATCH 4/6] SoC Camera: add support for g_parm / s_parm operations Janusz Krzysztofik
2010-07-18 4:27 ` [RFC] [PATCH 5/6] OMAP1: Amstrad Delta: add support for camera Janusz Krzysztofik
2010-07-18 4:29 ` [RFC] [PATCH 6/6] OMAP1: Amstrad Delta: add camera controlled LEDS trigger Janusz Krzysztofik
2010-07-20 9:49 ` [RFC] [PATCH 0/6] Add camera support to the OMAP1 Amstrad Delta videophone Guennadi Liakhovetski
2010-07-20 17:38 ` Janusz Krzysztofik
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=201008192025.31660.mitov@issp.bas.bg \
--to=mitov@issp.bas.bg \
--cc=e3-hacking@earth.li \
--cc=g.liakhovetski@gmx.de \
--cc=jkrzyszt@tis.icnet.pl \
--cc=linux-media@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox