Mesa (master): vmware/xorg: Export modinfo just as the other vmware X drivers does

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Sat Feb 27 03:10:20 UTC 2010


Module: Mesa
Branch: master
Commit: ab8a232b2cad965501e3778219e957509a078757
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab8a232b2cad965501e3778219e957509a078757

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Thu Feb 18 16:02:03 2010 +0100

vmware/xorg: Export modinfo just as the other vmware X drivers does

---

 src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c |   45 +++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c
index cd273d0..bc5d39f 100644
--- a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c
+++ b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c
@@ -33,12 +33,50 @@
 
 #include "vmw_hook.h"
 
+
+/*
+ * Defines and modinfo
+ */
+
+#define VMWGFX_DRIVER_NAME "vmwgfx"
+
+#define VMW_STRING_INNER(s) #s
+#define VMW_STRING(str) VMW_STRING_INNER(str)
+
+#define VMWGFX_VERSION_MAJOR 10
+#define VMWGFX_VERSION_MINOR 16
+#define VMWGFX_VERSION_PATCH 9
+#define VMWGFX_VERSION_STRING_MAJOR VMW_STRING(VMWGFX_VERSION_MAJOR)
+#define VMWGFX_VERSION_STRING_MINOR VMW_STRING(VMWGFX_VERSION_MINOR)
+#define VMWGFX_VERSION_STRING_PATCH VMW_STRING(VMWGFX_VERSION_PATCH)
+
+#define VMWGFX_DRIVER_VERSION \
+   (VMWGFX_VERSION_MAJOR * 65536 + VMWGFX_VERSION_MINOR * 256 + VMWGFX_VERSION_PATCH)
+#define VMWGFX_DRIVER_VERSION_STRING \
+    VMWGFX_VERSION_STRING_MAJOR "." VMWGFX_VERSION_STRING_MINOR \
+    "." VMWGFX_VERSION_STRING_PATCH
+
+/*
+ * Standard four digit version string expected by VMware Tools installer.
+ * As the driver's version is only  {major, minor, patchlevel}, simply append an
+ * extra zero for the fourth digit.
+ */
+#ifdef __GNUC__
+_X_EXPORT const char vmwgfx_drv_modinfo[] __attribute__((section(".modinfo"),unused)) =
+    "version=" VMWGFX_DRIVER_VERSION_STRING ".0";
+#endif
+
 static void vmw_xorg_identify(int flags);
 _X_EXPORT Bool vmw_xorg_pci_probe(DriverPtr driver,
 				  int entity_num,
 				  struct pci_device *device,
 				  intptr_t match_data);
 
+
+/*
+ * Tables
+ */
+
 static const struct pci_id_match vmw_xorg_device_match[] = {
     {0x15ad, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
     {0, 0, 0, 0, 0, 0, 0},
@@ -55,12 +93,12 @@ static PciChipsets vmw_xorg_pci_devices[] = {
 };
 
 static XF86ModuleVersionInfo vmw_xorg_version = {
-    "vmwgfx",
+    VMWGFX_DRIVER_NAME,
     MODULEVENDORSTRING,
     MODINFOSTRING1,
     MODINFOSTRING2,
     XORG_VERSION_CURRENT,
-    0, 1, 0, /* major, minor, patch */
+    VMWGFX_VERSION_MAJOR, VMWGFX_VERSION_MINOR, VMWGFX_VERSION_PATCH,
     ABI_CLASS_VIDEODRV,
     ABI_VIDEODRV_VERSION,
     MOD_CLASS_VIDEODRV,
@@ -73,7 +111,7 @@ static XF86ModuleVersionInfo vmw_xorg_version = {
 
 _X_EXPORT DriverRec vmwgfx = {
     1,
-    "vmwgfx",
+    VMWGFX_DRIVER_NAME,
     vmw_xorg_identify,
     NULL,
     xorg_tracker_available_options,
@@ -92,6 +130,7 @@ _X_EXPORT XF86ModuleData vmwgfxModuleData = {
     NULL
 };
 
+
 /*
  * Xorg driver functions
  */




More information about the mesa-commit mailing list