Your thoughts on a buffer sharing mechanism for FreeBSD (dma-buf for drm2)

Roland Smith rsmith at xs4all.nl
Fri Dec 28 17:12:52 UTC 2012


On Wed, Dec 26, 2012 at 12:37:10AM +0100, Bas Vermin wrote:
> Hi Guys,
> 
> Today I decided to do something useful for the FreeBSD community, working on
> the TTM and KMS for the AMD graphics cards which I think a lot of people
> could use.

Great! 

> As most of us know Intel KMS support was added to FreeBSD a few months ago,
> and as far as I know this code was based on the Linux 3.1 kernel. The FAQ in
> the wiki states that in order to keep this code up to date the Linux commit
> log would be checked and changes merged into FreeBSD. Then came Linux 3.3
> which added support for dma-buf, the buffer sharing mechanism to be used by
> PRIME for offloading work to different GPU's, a feature we obviously
> want. The problem with dma-buf is that it is licensed under the GPL and has
> now littered all over the otherwise MIT licensed drm code (even nVidia
> wasn't allowed to use dma-buf for their propietary driver).

The license would not be a problem as long as we don't copy the code, but just
provide the same interface.

> My question is, does such a buffer sharing mechanism exist in FreeBSD?

I may be off-base here, but what about buf(9)?

> And if so, would it be somewhat compatible with what dma-buf is doing in the PRIME code?
> 
> If not I think such a mechanism should be created, prehaps part of the vm system (not separate as dma-buf is). Or am I just being stupid and is there a much better way of solving this problem?

Since the develompent of Xorg (and other systems like Wayland) is driven by
Linux, it would probably make porting less painful if the FreeBSD kernel could
supply the same interfaces to drivers as Linux does.

But I don't see most graphics chips vendors implement dma-buf in their
(proprietary) drivers, because of its license. I do hope that in the end this
will lead to more and better open-source drivers!


Roland
-- 
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-x11/attachments/20121228/d20e8884/attachment.sig>


More information about the freebsd-x11 mailing list