>From 1cc97bc886ce686e1bf9b4107af1518a763c5d65 Mon Sep 17 00:00:00 2001
From: Robert Millan <[email protected]>
Date: Fri, 20 Dec 2013 11:03:14 +0000
Subject: [PATCH 2/2] 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 <[email protected]>
---
 src/radeon_probe.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index baca574..2d3c58e 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,
-- 
1.7.10.4

_______________________________________________
xorg-driver-ati mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-ati

Reply via email to