OSDN Git Service

Add module version name at a lower layer of the code, allows things to be
authorJeff Hartmann <jhartmann@valinux.com>
Wed, 18 Jul 2001 21:02:58 +0000 (21:02 +0000)
committerJeff Hartmann <jhartmann@valinux.com>
Wed, 18 Jul 2001 21:02:58 +0000 (21:02 +0000)
    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.

18 files changed:
libdrm/xf86drm.c
linux-core/i810_drv.c
linux-core/mga_drv.c
linux-core/r128_drv.c
linux-core/radeon_drv.c
linux-core/sis_drv.c
linux-core/tdfx_drv.c
linux/Makefile.linux
linux/drm.h
linux/gamma_drv.c
linux/i810_drv.c
linux/mga_drv.c
linux/r128_drv.c
linux/radeon_drv.c
linux/sis_drv.c
linux/tdfx_drv.c
shared-core/drm.h
shared/drm.h

index a04cf7a..6a4c592 100644 (file)
@@ -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
index 65f423e..09fa16b 100644 (file)
@@ -37,7 +37,7 @@
 
 #define DRIVER_AUTHOR          "VA Linux Systems Inc."
 
-#define DRIVER_NAME            "i810"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "i810"
 #define DRIVER_DESC            "Intel i810"
 #define DRIVER_DATE            "20010616"
 
index 0afda31..bea65cf 100644 (file)
@@ -36,7 +36,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "mga"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "mga"
 #define DRIVER_DESC            "Matrox G200/G400"
 #define DRIVER_DATE            "20010321"
 
index fa99d65..2fdcb15 100644 (file)
@@ -37,7 +37,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "r128"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "r128"
 #define DRIVER_DESC            "ATI Rage 128"
 #define DRIVER_DATE            "20010405"
 
index 3414507..d763266 100644 (file)
@@ -35,7 +35,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "radeon"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "radeon"
 #define DRIVER_DESC            "ATI Radeon"
 #define DRIVER_DATE            "20010405"
 
index 8701e00..3dd83fd 100644 (file)
@@ -32,7 +32,7 @@
 #include "sis_drv.h"
 
 #define DRIVER_AUTHOR   "SIS"
-#define DRIVER_NAME     "sis"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME     "sis"
 #define DRIVER_DESC     "SIS 300/630/540"
 #define DRIVER_DATE     "20010503"
 #define DRIVER_MAJOR    1
index e28518b..f478395 100644 (file)
@@ -36,7 +36,7 @@
 
 #define DRIVER_AUTHOR          "VA Linux Systems Inc."
 
-#define DRIVER_NAME            "tdfx"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "tdfx"
 #define DRIVER_DESC            "3dfx Banshee/Voodoo3+"
 #define DRIVER_DATE            "20010216"
 
index 9aa523d..e796c8f 100644 (file)
@@ -48,7 +48,7 @@
 # **** End of SMP/MODVERSIONS detection
 
 XFREE86VERSION =       4_1_0
-MODS =         gamma-$(XFREE86VERSION).o tdfx-$(XFREE86VERSION).o \
+MODS =         gamma-$(XFREE86VERSION).o tdfx.o \
                r128-$(XFREE86VERSION).o radeon-$(XFREE86VERSION).o
 LIBS =
 
@@ -228,7 +228,7 @@ gamma-$(XFREE86VERSION).o: $(GAMMAOBJS)
 
 tdfx_drv.o: tdfx_drv.c
        $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@
-tdfx-$(XFREE86VERSION).o: $(TDFXOBJS) $(LIBS)
+tdfx.o: $(TDFXOBJS) $(LIBS)
        $(LD) -r $^ -o $@
 
 sis-$(XFREE86VERSION).o: $(SISOBJS) $(LIBS)
index 5faf2ba..ac9f407 100644 (file)
 #define XFREE86_VERSION(major,minor,patch,snap) \
                ((major << 16) | (minor << 8) | patch)
 
-#define __DRM_STRINGIFY(x)     #x
-#define DRM_STRINGIFY(x)       __DRM_STRINGIFY(x)
-
 #ifndef CONFIG_XFREE86_VERSION
-/* If CONFIG_XFREE86_VERSION is defined, these must also be defined */
-#define CONFIG_XFREE86_MAJOR   4
-#define CONFIG_XFREE86_MINOR   1
-#define CONFIG_XFREE86_PATCH   0
-
 #define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
 #endif
 
-#define XF86_MAJ_STR   DRM_STRINGIFY(CONFIG_XFREE86_MAJOR)
-#define XF86_MIN_STR   DRM_STRINGIFY(CONFIG_XFREE86_MINOR)
-#define XF86_PATCH_STR DRM_STRINGIFY(CONFIG_XFREE86_PATCH)
-
-#ifndef CONFIG_XFREE86_VERSION_STR
-#define CONFIG_XFREE86_VERSION_STR "-"##XF86_MAJ_STR##"_"##XF86_MIN_STR##"_"##XF86_PATCH_STR
-#endif
-
 #if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
 #define DRM_PROC_DEVICES "/proc/devices"
 #define DRM_PROC_MISC   "/proc/misc"
index cd64b30..98916bc 100644 (file)
@@ -36,7 +36,7 @@
 
 #define DRIVER_AUTHOR          "VA Linux Systems Inc."
 
-#define DRIVER_NAME            "gamma"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "gamma"
 #define DRIVER_DESC            "3DLabs gamma"
 #define DRIVER_DATE            "20010216"
 
index 65f423e..09fa16b 100644 (file)
@@ -37,7 +37,7 @@
 
 #define DRIVER_AUTHOR          "VA Linux Systems Inc."
 
-#define DRIVER_NAME            "i810"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "i810"
 #define DRIVER_DESC            "Intel i810"
 #define DRIVER_DATE            "20010616"
 
index 0afda31..bea65cf 100644 (file)
@@ -36,7 +36,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "mga"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "mga"
 #define DRIVER_DESC            "Matrox G200/G400"
 #define DRIVER_DATE            "20010321"
 
index fa99d65..2fdcb15 100644 (file)
@@ -37,7 +37,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "r128"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "r128"
 #define DRIVER_DESC            "ATI Rage 128"
 #define DRIVER_DATE            "20010405"
 
index 3414507..d763266 100644 (file)
@@ -35,7 +35,7 @@
 
 #define DRIVER_AUTHOR          "Gareth Hughes, VA Linux Systems Inc."
 
-#define DRIVER_NAME            "radeon"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "radeon"
 #define DRIVER_DESC            "ATI Radeon"
 #define DRIVER_DATE            "20010405"
 
index 8701e00..3dd83fd 100644 (file)
@@ -32,7 +32,7 @@
 #include "sis_drv.h"
 
 #define DRIVER_AUTHOR   "SIS"
-#define DRIVER_NAME     "sis"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME     "sis"
 #define DRIVER_DESC     "SIS 300/630/540"
 #define DRIVER_DATE     "20010503"
 #define DRIVER_MAJOR    1
index e28518b..f478395 100644 (file)
@@ -36,7 +36,7 @@
 
 #define DRIVER_AUTHOR          "VA Linux Systems Inc."
 
-#define DRIVER_NAME            "tdfx"##CONFIG_XFREE86_VERSION_STR
+#define DRIVER_NAME            "tdfx"
 #define DRIVER_DESC            "3dfx Banshee/Voodoo3+"
 #define DRIVER_DATE            "20010216"
 
index 5faf2ba..ac9f407 100644 (file)
 #define XFREE86_VERSION(major,minor,patch,snap) \
                ((major << 16) | (minor << 8) | patch)
 
-#define __DRM_STRINGIFY(x)     #x
-#define DRM_STRINGIFY(x)       __DRM_STRINGIFY(x)
-
 #ifndef CONFIG_XFREE86_VERSION
-/* If CONFIG_XFREE86_VERSION is defined, these must also be defined */
-#define CONFIG_XFREE86_MAJOR   4
-#define CONFIG_XFREE86_MINOR   1
-#define CONFIG_XFREE86_PATCH   0
-
 #define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
 #endif
 
-#define XF86_MAJ_STR   DRM_STRINGIFY(CONFIG_XFREE86_MAJOR)
-#define XF86_MIN_STR   DRM_STRINGIFY(CONFIG_XFREE86_MINOR)
-#define XF86_PATCH_STR DRM_STRINGIFY(CONFIG_XFREE86_PATCH)
-
-#ifndef CONFIG_XFREE86_VERSION_STR
-#define CONFIG_XFREE86_VERSION_STR "-"##XF86_MAJ_STR##"_"##XF86_MIN_STR##"_"##XF86_PATCH_STR
-#endif
-
 #if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
 #define DRM_PROC_DEVICES "/proc/devices"
 #define DRM_PROC_MISC   "/proc/misc"
index 5faf2ba..ac9f407 100644 (file)
 #define XFREE86_VERSION(major,minor,patch,snap) \
                ((major << 16) | (minor << 8) | patch)
 
-#define __DRM_STRINGIFY(x)     #x
-#define DRM_STRINGIFY(x)       __DRM_STRINGIFY(x)
-
 #ifndef CONFIG_XFREE86_VERSION
-/* If CONFIG_XFREE86_VERSION is defined, these must also be defined */
-#define CONFIG_XFREE86_MAJOR   4
-#define CONFIG_XFREE86_MINOR   1
-#define CONFIG_XFREE86_PATCH   0
-
 #define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
 #endif
 
-#define XF86_MAJ_STR   DRM_STRINGIFY(CONFIG_XFREE86_MAJOR)
-#define XF86_MIN_STR   DRM_STRINGIFY(CONFIG_XFREE86_MINOR)
-#define XF86_PATCH_STR DRM_STRINGIFY(CONFIG_XFREE86_PATCH)
-
-#ifndef CONFIG_XFREE86_VERSION_STR
-#define CONFIG_XFREE86_VERSION_STR "-"##XF86_MAJ_STR##"_"##XF86_MIN_STR##"_"##XF86_PATCH_STR
-#endif
-
 #if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
 #define DRM_PROC_DEVICES "/proc/devices"
 #define DRM_PROC_MISC   "/proc/misc"