xf86-video-ati: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Mon Dec 23 18:09:29 PST 2013


 src/radeon_kms.c   |    2 +-
 src/radeon_probe.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit bfbff3b246db509c820df17b8fcf5899882ffcfa
Author: Robert Millan <rmh at freebsd.org>
Date:   Fri Dec 20 11:03:14 2013 +0000

    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 at freebsd.org>

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,
commit 796c9a0cb587f528326bede11fa3f3eb7d3edaf1
Author: Robert Millan <rmh at freebsd.org>
Date:   Fri Dec 20 10:55:09 2013 +0000

    radeon: Set first parameter of drmOpen() to NULL
    
    Since the introduction of a call to drmCheckModesettingSupported()
    in radeon_kernel_mode_enabled(), with abort condition if such call
    fails, the first argument to drmOpen() call in radeon_open_drm_master()
    has become a no-op red herring.
    
    Such argument (a kernel module name) is supposed to result in load
    of specified kernel module. However, this will never happen. The
    problem is that if the code containing drmOpen() call is reached, it
    means that drmCheckModesettingSupported() check has previously
    succeeded, which implies the module is already loaded.
    
    So, drmOpen() will never load a kernel module. But it gives the
    impression that it will.
    
    In order to avoid this confusion, this commit replaces it with NULL,
    like xf86-video-intel driver does.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72849
    Signed-off-by: Robert Millan <rmh at freebsd.org>

diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 44a0139..21a420f 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -607,7 +607,7 @@ static Bool radeon_open_drm_master(ScrnInfoPtr pScrn)
 		      dev->domain, dev->bus, dev->dev, dev->func);
 #endif
 
-    info->dri2.drm_fd = drmOpen("radeon", busid);
+    info->dri2.drm_fd = drmOpen(NULL, busid);
     if (info->dri2.drm_fd == -1) {
 
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,


More information about the xorg-commit mailing list