mirror of
https://github.com/X11Libre/xf86-video-ati.git
synced 2026-03-23 17:19:27 +00:00
Load kernel modules before using DRM on DFBSD.
On DragonFlyBSD the appropriate kernel drivers need to be loaded before using DRM, so I added a section that loads them before calling DRM functions. Signed-off-by: b-aaz <b-aazbsd@proton.me>
This commit is contained in:
@@ -58,6 +58,10 @@
|
||||
#include <X11/extensions/dpms.h>
|
||||
#endif
|
||||
|
||||
#ifdef __DragonFly__
|
||||
#include <xf86_OSproc.h>
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/damageproto.h>
|
||||
|
||||
#include <fb.h>
|
||||
@@ -1529,6 +1533,24 @@ static int radeon_get_drm_master_fd(ScrnInfoPtr pScrn)
|
||||
XNFasprintf(&busid, "pci:%04x:%02x:%02x.%d",
|
||||
dev->domain, dev->bus, dev->dev, dev->func);
|
||||
|
||||
#ifdef __DragonFly__
|
||||
/* On DragonFlyBSD Appropriate kernel drivers need to be loaded before
|
||||
* accessing DRM facilities */
|
||||
int loaded=0; /* if we were able to load the module. */
|
||||
loaded = xf86LoadKernelModule("radeon");
|
||||
/* EEXIST is set if the module has already been loaded in the kernel */
|
||||
if (!loaded && errno != EEXIST) {
|
||||
loaded = xf86LoadKernelModule("radeonkms");
|
||||
if (!loaded && errno != EEXIST) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"[drm] Failed to load kernel module for %s: %s\n",
|
||||
busid, strerror(errno));
|
||||
free(busid);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
fd = drmOpen(NULL, busid);
|
||||
if (fd == -1)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#include <xf86Pci.h>
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
#include <xf86_OSproc.h>
|
||||
#endif
|
||||
|
||||
@@ -97,7 +97,7 @@ static Bool radeon_kernel_mode_enabled(ScrnInfoPtr pScrn, struct pci_device *pci
|
||||
|
||||
busIdString = DRICreatePCIBusID(pci_dev);
|
||||
ret = drmCheckModesettingSupported(busIdString);
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
if (ret) {
|
||||
if (xf86LoadKernelModule("radeonkms"))
|
||||
ret = drmCheckModesettingSupported(busIdString);
|
||||
|
||||
Reference in New Issue
Block a user