summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Millan <rmh@freebsd.org>2013-12-20 11:03:14 +0000
committerMichel Dänzer <michel.daenzer@amd.com>2013-12-24 11:08:40 +0900
commitbfbff3b246db509c820df17b8fcf5899882ffcfa (patch)
tree922f6f7d5418bfe7536930725ee04ff78077c16a
parent796c9a0cb587f528326bede11fa3f3eb7d3edaf1 (diff)
radeon: Restore kernel module load on FreeBSD.
Since the introduction of a call to drmCheckModesettingSupported() in radeon_kernel_mode_enabled(), with abort condition if such call fails, the drmOpen() call in radeon_open_drm_master() no longer takes the responsibility of loading the radeon kernel module. However at least on FreeBSD (and GNU/kFreeBSD), X is still relied on to load the modules it needs. This commit restores the old behaviour of loading kernel modules on these systems. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72852 Signed-off-by: Robert Millan <rmh@freebsd.org>
-rw-r--r--src/radeon_probe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index baca574e..2d3c58e8 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -50,6 +50,10 @@
#include "xf86drmMode.h"
#include "dri.h"
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <xf86_OSproc.h>
+#endif
+
#ifdef XSERVER_PLATFORM_BUS
#include <xf86platformBus.h>
#endif
@@ -92,6 +96,12 @@ 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 (ret) {
+ if (xf86LoadKernelModule("radeonkms"))
+ ret = drmCheckModesettingSupported(busIdString);
+ }
+#endif
free(busIdString);
if (ret) {
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,