Import DRM core from Linux 5.4(-ish).
For ARM and ARM64 driver we need DRM in base for a differents reasons :
- For embedded product we might want to have driver in the kernel
- Linux drivers are GPL licenced and thus can only be used as kernel modules
- The frameworks for FDT based resource is very different between Linux and FreeBSD, making a linuxkpi abstraction really difficult
- Drivers need to be synced with DTS, which we import quickly after a Linux release is out.
Directories are structured as :
- core/ : The drm core files and include, this matches was is present in Linux at drivers/gpu/drm/ and include/drm
- freebsd/ : FreeBSD specific files, this includes some helpers that cannot be OS agnostic (like gem_cma/fb_cma/gem_frambuffer), some code for framebuffer<->VT relation (and VT switching) and the sysctl/sysfs needed code for drm core.
- drmkpi/ : A somewhat stripped down copy of linuxkpi The reasons for having a copy are :
- The full linuxkpi is usefull for importing drivers from Linux, but for FreeBSD drivers it adds some useless stuff like a linux_dev for each device.
- We don't need nor want sysfs, netdevice code or other stuff not needed for DRM.
- It should be self-contained for the DRM drivers and subsystem (which is partialy done).
- bridges/ : This is where drm_bridges device will live, for now it only contain a generic interface for them.
All drm related sysctls are under dev.drm (like dev.drm.debug)
VT switching works even when we panic (tested with sysctl debug.kdb.panic=1)
The only missing pieces for a full sync with Linux 5.4 are the recent changes
in the dma-buf and drm_objsync (like the timeline feature).