mga-vid module fails to build on kernels >=3.4

Bug #1261248 reported by Pigeon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mga-vid (Ubuntu)
New
Undecided
Unassigned

Bug Description

Relevant version information:
mga-vid: 2.6.32-1
Kernel: 3.12.0-7-generic #15-Ubuntu SMP

It is not possible to build the mga-vid module on kernels >= 3.4.

In kernel 3.4, asm/system.h was removed; this file is referred to by mga_vid.c and its absence causes the compilation to fail.
Further, in kernel 3.7, VM_RESERVED was removed; this symbol is also referred to by mga_vid.c and its absence causes the compilation to fail.

This compilation failure will occur on all versions of Ubuntu which use kernels >= 3.4 by default, ie. everything from quantal onwards.

To reproduce the bug, install mga-vid-source and execute "sudo m-a a-i mga-vid" on a system running a kernel >=3.4 (>=3.7 to see both failures).

Below is a patch which resolves the problem. With this patch, the compilation succeeds; mga_vid_test produces the expected results; mplayer works fine; and I am getting 288fps from glxgears on a G450 with 16MB RAM.

--- modules/mga-vid.orig/mga_vid.c 2010-05-18 14:16:10.000000000 +0100
+++ modules/mga-vid/mga_vid.c 2013-12-16 00:01:08.000000000 +0000
@@ -52,6 +52,16 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
+/*
+ * VM_RESERVED is not in kernels >= 3.7
+ * Bug fix cribbed from:
+ * http://lists.alioth.debian.org/pipermail/pkg-nvidia-devel/2013-January/008414.html
+ * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=314e51b9851b4f4e8ab302243ff5a6fc6147f379
+ *
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
+#define VM_RESERVED (VM_IO | VM_DONTEXPAND | VM_DONTDUMP)
+#endif
 #include <linux/string.h>
 #include <linux/errno.h>

@@ -70,7 +80,15 @@
 #endif

 #include <asm/uaccess.h>
+/*
+ * asm/system.h is not in kernels >= 3.4
+ * Bug fix cribbed from:
+ * https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/993506
+ *
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
 #include <asm/system.h>
+#endif
 #include <asm/io.h>

 #ifndef PCI_DEVICE_ID_MATROX_G200_PCI

Tags: patch
Revision history for this message
Pigeon (x-launchpad-ubuntu) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to fix mga-vid module compilation failure on kernels >= 3.4" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.