Page MenuHomeFreeBSD

linux: add dma-buf and sync_file ioctl handlers
AcceptedPublic

Authored by nick_spun.io on Sun, Aug 9, 11:43 PM.
Referenced Files
F166951909: D58753.id183749.diff
Tue, Aug 18, 2:03 AM
F166926569: D58753.diff
Mon, Aug 17, 7:54 PM
Unknown Object (File)
Mon, Aug 17, 12:01 PM
Unknown Object (File)
Sun, Aug 16, 7:35 PM
Unknown Object (File)
Sun, Aug 16, 9:58 AM
Unknown Object (File)
Sun, Aug 16, 12:15 AM
Unknown Object (File)
Sat, Aug 15, 10:24 PM
Unknown Object (File)
Sat, Aug 15, 8:58 PM
Subscribers

Details

Reviewers
dumbbell
adrian
Summary

drm-kmod already implements the dma-buf and sync_file ioctls, but
linux_ioctl.c had no handler group for the 'b' and '>' magic bytes, so
the requests never reached it and returned EINVAL from
linux_ioctl_fallback(). Route the commands drm-kmod services to
sys_ioctl(), translating the direction bits with SETDIR(); everything
else still falls through to the fallback and keeps getting named in
dmesg.

Signed-off-by: Nick Price <nprice@FreeBSD.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75490
Build 72373: arc lint + arc unit

Event Timeline

nick_spun.io edited the summary of this revision. (Show Details)

(a) what was this for again
(b) .. why can't we have a freebsd dmabuf implementation that we can use, and linuxkpi plugs into that?

This revision is now accepted and ready to land.Sun, Aug 16, 12:10 PM

well if dumbbell says ok :-)

(a) what was this for again
(b) .. why can't we have a freebsd dmabuf implementation that we can use, and linuxkpi plugs into that?

(a) lol this was for Cyberpunk 2077 in "Proton-under-Linuxulator"
(b) You mean something in base? I definitely don't see a reason _not_ to

(a) what was this for again
(b) .. why can't we have a freebsd dmabuf implementation that we can use, and linuxkpi plugs into that?

(a) lol this was for Cyberpunk 2077 in "Proton-under-Linuxulator"
(b) You mean something in base? I definitely don't see a reason _not_ to

ok, for maximum lols, please add something like this in your commit message

Locally tested:

  • cyberpunk 2077 running in proton in linuxulator (still working on audio though!)

and (b) yeah, let's find dumbbell when they're active on IRC and go figure out what's required to just make a native dmabuf implementation for freebsd. Surely it's not going to move THAT quickly, and it'll help us in our desire for native drivers for stuff.

I didn't work on the implementation of dma-buf for FreeBSD. We have this BSD-licensed implementation in drm-kmod right now and we can surely move that to base. I find it receives changes infrequently in Linux, so hopefully, that shouldn't be something that slows down or interferes with making a given version of drm-kmod compatible with multiple versions of FreeBSD.