FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

Make devmatch like drm drivers #68

Open johalun opened 6 years ago

johalun commented 6 years ago

Autoload, described here https://wiki.freebsd.org/AutoLoad, load kernel modules automatically based on data in a PNP description table.

Macro is defined here: https://github.com/FreeBSDDesktop/freebsd-base/blob/drm-v4.15/sys/sys/module.h#L176

And an example of how this is implemented in drm2's i915: https://github.com/FreeBSDDesktop/freebsd-base/blob/drm-v4.15/sys/dev/drm2/i915/i915_drv.c#L1239

We need this for i915kms, radeonkms and amdgpu. linuxkpi_gplv2 and lindebugfs will be loaded as dependencies.

The new drm drivers does not use the DRIVER_MODULE macro. Examples of how it is currently solved is found here:

LinuxKPI: https://github.com/FreeBSDDesktop/freebsd-base/blob/drm-v4.15/sys/compat/linuxkpi/common/include/linux/module.h#L83

FreeBSD specific file in i915: https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.15/drivers/gpu/drm/i915/intel_freebsd.c#L220

Linux module init code: https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.15/drivers/gpu/drm/i915/i915_pci.c#L746

Any commit or PR to either kms-drm or freebsd-base repos should be done to the drm-4.15 branch.

Checklist

johalun commented 6 years ago

Work on this has started in 4.16 branch.