On Mon, May 18, 2009 at 03:11, Benjamin Herrenschmidt
<b...@kernel.crashing.org> wrote:
> Currently, userspace fails to obtain the SAREA mapping on some platforms
> because they pass SAREA_MAX to drmAddMap without aligning it to the page
> size. This breaks for example on PowerPC with 64K pages.
>
> The way SAREA_MAX is defined with a bunch of ifdef's and duplicated between
> libdrm and the X server is gross, ultimately it should be retrieved by
> userspace from the kernel, but in the meantime, we have plenty of existing
> userspace built with bad values that need to work.
>
> The actual SAREA in the kernel is created with an aligned size by the
> radeon driver (I haven't tested others) so it's purely a userspace problem.
>
> This works around it by rounding the requested size in drmAddMap to the page
> size. There should never be any need to manipulate maps smaller than a page
> (MMIO regions might but there isn't much we can do about it) and our mmap()
> calls has enough sanity checks here if the map is actually too small to be
> mapped. We also only do that fir the ioctl, not the in-kernel call.
>

So, in order to fix a problem with the SAREA you align the map size
for all added maps? Sounds bogus to me, especially since the range of
possible page sizes is potentially unbounded.

IMO the proper thing to do is to fix the drivers when they create the SAREA...

Stephane

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to