diff options
author | Jeff Hartmann <jhartmann@valinux.com> | 2001-07-18 21:02:58 +0000 |
---|---|---|
committer | Jeff Hartmann <jhartmann@valinux.com> | 2001-07-18 21:02:58 +0000 |
commit | 4eafeec960c29369982a9b15c24681a3072f491d (patch) | |
tree | 46b949fff29a0022d21c7e724b4e5a24347c7db6 /libdrm | |
parent | c6454e6a93544fd20f4b5d9cb2ee08725e9b6740 (diff) |
Add module version name at a lower layer of the code, allows things to be
more flexible and allow older module versions to still work. Might not
be final code if we move over to DRI kernel module version, but will be
if we use XFree86 version. + Only build tdfx.o instead of tdfx-4_1_0.o
since tdfx.o has never changed its API.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index a04cf7ae..6a4c5924 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -285,10 +285,32 @@ static int drmOpenByName(const char *name) #if !defined(XFree86Server) return -1; #else + char temp_name[256]; + Bool kernel_loaded = FALSE; + + sprintf(temp_name, "%s-%d_%d_%d", name, + XF86_VERSION_MAJOR, + XF86_VERSION_MINOR, + XF86_VERSION_PATCH); + + /* first try and load the XF Version number of the module */ + if (!xf86LoadKernelModule(temp_name)) { + ErrorF("[drm] failed to load kernel module \"%s\"\n", + temp_name); + ErrorF("[drm] falling back to older kernel modules\n"); + } else { + kernel_loaded = TRUE; + } + + /* When we have more releases, add logic here to attempt to load them + * here. + */ + /* try to load the kernel module now */ - if (!xf86LoadKernelModule(name)) { + if (kernel_loaded == FALSE && !xf86LoadKernelModule(name)) { ErrorF("[drm] failed to load kernel module \"%s\"\n", name); + ErrorF("[drm] No suitable kernel module found.\n"); return -1; } #endif |