summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2008-12-29 20:03:05 +0100
committerLuc Verhaegen <libv@skynet.be>2008-12-29 20:03:05 +0100
commit47406d957c43b0ebc51d261c8073e48c23e84e1a (patch)
tree27e74f1dd6eafb144f906a260a7715ae8029d6cc
parent07cd91b6f11b2b616dcb4fc297b20b51e3c498a5 (diff)
Probe: unify code for supported chipsets check.
This way i won't run into issues anymore when switching between libpciacces and proper pci support.
-rw-r--r--src/via_driver.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/via_driver.c b/src/via_driver.c
index b900f80..fefe24c 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -522,6 +522,30 @@ VIAIdentify(int flags)
}
/*
+ *
+ */
+static Bool
+VIAChipSupported(int Chip, int Id)
+{
+ switch (Chip) {
+ case VT3122:
+ case VT7205:
+ case VT3108:
+ return TRUE;
+ /* case VT3118: */
+ /* case VT3344: */
+ /* case VT3157: */
+ /* case VT3343: */
+ /* case VT3371: */
+ xf86Msg(X_WARNING, "VT%04X support is experimental.\n", Id);
+ return TRUE;
+ default:
+ xf86Msg(X_ERROR, "VT%04X is not supported yet.\n", Id);
+ return FALSE;
+ }
+}
+
+/*
* Wrap the probe between libpcicaccess and old pci infrastructure.
*/
#ifdef XSERVER_LIBPCIACCESS
@@ -535,13 +559,7 @@ VIAPciProbe(DriverPtr drv, int entityNum,
ScrnInfoPtr pScrn;
VIAPtr pVia;
- switch (matchData) {
- case VT3122:
- case VT7205:
- case VT3108:
- break;
- default:
- xf86Msg(X_ERROR, "VT%04X is not supported yet.\n", dev->device_id);
+ if (!VIAChipSupported(matchData, dev->device_id)) {
ViaIDKnown(dev, matchData);
return FALSE;
}
@@ -671,17 +689,7 @@ VIAProbe(DriverPtr drv, int flags)
EntityInfoPtr pEnt = xf86GetEntityInfo(usedChips[i]);
pciVideoPtr pPci = xf86GetPciInfoForEntity(usedChips[i]);
- /*
- * While we should support all of the above devices, we only support
- * the ones we can actually test.
- */
- switch (pEnt->chipset) {
- case VT3122:
- case VT7205:
- case VT3108:
- break;
- default:
- xf86Msg(X_ERROR, "VT%04X is not supported yet.\n", pPci->chipType);
+ if (!VIAChipSupported(pEnt->chipset, pPci->chipType)) {
ViaIDKnown(pPci, pEnt->chipset);
continue;
}