[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#697532: xserver-xorg-video-mga: refuses to start when matroxfb is active



Control: tag -1 upstream patch

On Sun, Jan  6, 2013 at 16:57:35 +0100, olafBuddenhagen@gmx.net wrote:

> Package: xserver-xorg-video-mga
> Version: 1:1.5.0-2
> Severity: important
> 
> Dear Maintainer,
> 
> The check introduced in -2 to not start the driver when the g200se KMS
> module is active, is too broad: apparently it only checks whether the
> device is claimed by any other driver -- but that is also the case when
> matroxfb is active, which should *not* prevent mga from starting.
> 
Please try this patch, let us know how it goes.

Cheers,
Julien

From: Julien Cristau <jcristau@debian.org>
Date: Mon, 7 Jan 2013 23:04:36 +0100
Subject: [PATCH] Restrict kernel driver matching to g200 server chips

Otherwise we might catch devices handled by matroxfb, not the mgag200
kms driver.

Debian bug#697532

Reported-by: olafBuddenhagen@gmx.net
Signed-off-by: Julien Cristau <jcristau@debian.org>
---
 src/mga_driver.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/mga_driver.c b/src/mga_driver.c
index 61eb96c..b90c592 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -683,12 +683,20 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
 #endif
 
     if (pci_device_has_kernel_driver(dev)) {
-	xf86DrvMsg(0, X_ERROR,
-                   "mga: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n",
-                   dev->device_id, dev->bus, dev->domain, dev->dev, dev->func);
-        xf86DrvMsg(0, X_ERROR,
-                   "mga: This driver cannot operate until it has been unloaded.\n");
-        return FALSE;
+	switch (dev->device_id) {
+	    case PCI_CHIP_MGAG200_SE_A_PCI:
+	    case PCI_CHIP_MGAG200_SE_B_PCI:
+	    case PCI_CHIP_MGAG200_EV_PCI:
+	    case PCI_CHIP_MGAG200_ER_PCI:
+	    case PCI_CHIP_MGAG200_WINBOND_PCI:
+	    case PCI_CHIP_MGAG200_EH_PCI:
+		xf86DrvMsg(0, X_ERROR,
+	                   "mga: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n",
+	                   dev->device_id, dev->bus, dev->domain, dev->dev, dev->func);
+	        xf86DrvMsg(0, X_ERROR,
+	                   "mga: This driver cannot operate until it has been unloaded.\n");
+	        return FALSE;
+	}
     }
 
     /* Allocate a ScrnInfoRec and claim the slot */
-- 
1.7.10.4

Attachment: signature.asc
Description: Digital signature


Reply to: