Linux PCI drivers in user space

Hans Petter Selasky hps at selasky.org
Sat Nov 9 10:43:17 UTC 2019


On 2019-11-09 06:00, Rozhuk Ivan wrote:
> Hi!
> 
> 
> Im frustrating with amdgpu on 12.1...
> Current status DRM with linuxkpi - it hard to use and hard to support.
> FreeBSD stable have no fresh drivers, FreeBSD current - unstable.
> 
> But we have webcamd:
>   + almost all time fresh drivers from linux
>   + easy to pull drivers from linux
>   + easy to debug
>   + on crash - system continue work
>   + more secure - driver limited to process memory
>   - probably a bit slower
> 
> 
> If add some kernel module that will export all pci devices and
> allow to mmap() pci device memory to user space and somehow proxy
> IRQ (like events to poll()/kqueue()), IO ports and registers then
> webcamd will can work with this like it now works with USB devices,
> and fbsd users can use latest DRM and some other drivers.
> Also adding sysctl settings to webcamd devices will be very useful.
> 
> Porting and updating drivers in user space webcamd easy then do same
> in kernel.
> Also all latest drivers will work on all actual FreeBSD versions.

Hi,

This is how X11 / X.org used to work. The biggest problem is sharing 
memory between applications if you put everything in user-space.

I've been using the new DRM for a while, i915, and there aren't so many 
issues if you know what you are doing. The biggest problem is keeping 
the ports-modules up-to-date with the kernel re-builds.

What might make life easier is to include the graphics drivers in base, 
though that might be a bit controversial ....

Webcamd is a great tool for drivers, but is mostly focused around USB 
device. It could probably support PCI devices too, but then I guess 
libpci would need to be extended. And I would appreciate if more people 
would be interested contributing to webcamd, now on github :-)

--HPS


More information about the freebsd-hackers mailing list