summaryrefslogtreecommitdiff
path: root/src/atiprobe.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-06-16 09:22:56 +0000
committerEric Anholt <anholt@freebsd.org>2004-06-16 09:22:56 +0000
commit6cbb5bbff43d65a762d432659793333868837f0b (patch)
tree3a81f83b12ee7774bea68e1c0d9cfd444deef207 /src/atiprobe.c
parent3586c3c7955365a2af0b8a286ea0d0488ddfd137 (diff)
DRI XFree86-4_3_99_12-merge importDRI-XFree86-4_3_99_12-merge
Diffstat (limited to 'src/atiprobe.c')
-rw-r--r--src/atiprobe.c101
1 files changed, 57 insertions, 44 deletions
diff --git a/src/atiprobe.c b/src/atiprobe.c
index ec86179..5e2c31b 100644
--- a/src/atiprobe.c
+++ b/src/atiprobe.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.62tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.58 2003/07/02 17:31:29 martin Exp $ */
/*
- * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
+ * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -206,7 +206,7 @@ ATICheckSparseIOBases
/* User might wish to override this decision */
xf86Msg(X_WARNING,
- ATI_NAME ": Sparse I/O base 0x%04lX not probed.\n", IOBase);
+ ATI_NAME ": Sparse I/O base 0x%04X not probed.\n", IOBase);
return Allowed;
}
}
@@ -214,8 +214,6 @@ ATICheckSparseIOBases
return DoProbe;
}
-#ifndef AVOID_NON_PCI
-
/*
* ATIClaimSparseIOBases --
*
@@ -238,8 +236,6 @@ ATIClaimSparseIOBases
ProbeFlags[FirstPort] = ProbeFlag;
}
-#endif /* AVOID_NON_PCI */
-
/*
* ATIVGAProbe --
*
@@ -314,7 +310,7 @@ ATIVGAWonderProbe
case 0:
xf86Msg(X_WARNING,
ATI_NAME ": Expected VGA Wonder capability could not be"
- " detected at I/O port 0x%04lX because it would conflict with"
+ " detected at I/O port 0x%04X because it would conflict with"
" a non-video PCI/AGP device.\n", pATI->CPIO_VGAWonder);
pATI->CPIO_VGAWonder = 0;
break;
@@ -322,7 +318,7 @@ ATIVGAWonderProbe
case Detected8514A:
xf86Msg(X_WARNING,
ATI_NAME ": Expected VGA Wonder capability could not be"
- " detected at I/O port 0x%04lX because it would conflict with"
+ " detected at I/O port 0x%04X because it would conflict with"
" a %s %s.\n", pATI->CPIO_VGAWonder,
ATIBusNames[p8514->BusType], ATIAdapterNames[p8514->Adapter]);
pATI->CPIO_VGAWonder = 0;
@@ -331,7 +327,7 @@ ATIVGAWonderProbe
case DetectedMach64:
xf86Msg(X_WARNING,
ATI_NAME ": Expected VGA Wonder capability could not be"
- " detected at I/O port 0x%04lX because it would conflict with"
+ " detected at I/O port 0x%04X because it would conflict with"
" a Mach64.\n", pATI->CPIO_VGAWonder);
pATI->CPIO_VGAWonder = 0;
break;
@@ -371,14 +367,14 @@ ATIVGAWonderProbe
(IOValue6 == 0))
{
xf86MsgVerb(X_INFO, 3,
- ATI_NAME ": VGA Wonder at I/O port 0x%04lX detected.\n",
+ ATI_NAME ": VGA Wonder at I/O port 0x%04X detected.\n",
pATI->CPIO_VGAWonder);
}
else
{
xf86Msg(X_WARNING,
ATI_NAME ": Expected VGA Wonder capability at I/O port"
- " 0x%04lX was not detected.\n", pATI->CPIO_VGAWonder);
+ " 0x%04X was not detected.\n", pATI->CPIO_VGAWonder);
pATI->CPIO_VGAWonder = 0;
}
break;
@@ -807,8 +803,9 @@ ATIAssignVGA
outb(VGA_DAC_MASK, 0xA5U);
if (inb(IBM_DAC_MASK) == 0xA5U)
pATI->VGAAdapter = ATI_ADAPTER_VGA;
- outb(VGA_DAC_MASK, OldDACMask);
}
+
+ outb(VGA_DAC_MASK, OldDACMask);
}
break;
@@ -828,9 +825,10 @@ ATIAssignVGA
outb(VGA_DAC_MASK, 0xA5U);
if (inb(IBM_DAC_MASK) == 0xA5U)
pATI->VGAAdapter = ATI_ADAPTER_VGA;
- outb(VGA_DAC_MASK, OldDACMask);
}
+ outb(VGA_DAC_MASK, OldDACMask);
+
if (ClockSel & DISABPASSTHRU)
outw(CLOCK_SEL, ClockSel);
}
@@ -856,9 +854,10 @@ ATIAssignVGA
outb(VGA_DAC_MASK, 0xA5U);
if (inb(IBM_DAC_MASK) == 0xA5U)
pATI->VGAAdapter = ATI_ADAPTER_MACH32;
- outb(VGA_DAC_MASK, OldDACMask);
}
+ outb(VGA_DAC_MASK, OldDACMask);
+
if (ClockSel & DISABPASSTHRU)
outw(CLOCK_SEL, ClockSel);
if (MiscOptions & (DISABLE_VGA | DISABLE_DAC))
@@ -880,9 +879,10 @@ ATIAssignVGA
outb(VGA_DAC_MASK, 0xA5U);
if (in8(M64_DAC_MASK) == 0xA5U)
pATI->VGAAdapter = ATI_ADAPTER_MACH64;
- outb(VGA_DAC_MASK, OldDACMask);
}
+ outb(VGA_DAC_MASK, OldDACMask);
+
if (!(DACCntl & DAC_VGA_ADR_EN))
outr(DAC_CNTL, DACCntl);
}
@@ -927,8 +927,6 @@ ATIAssignVGA
xf86MsgVerb(X_INFO, 3, ATI_NAME ": VGA assigned to this adapter.\n");
}
-#ifndef AVOID_NON_PCI
-
/*
* ATIClaimVGA --
*
@@ -957,8 +955,6 @@ ATIClaimVGA
ATIClaimSparseIOBases(ProbeFlags, pATI->CPIO_VGAWonder, 2, Detected);
}
-#endif /* AVOID_NON_PCI */
-
/*
* ATIFindVGA --
*
@@ -1221,8 +1217,6 @@ ATIProbe
xfree(PCIPorts);
-#ifndef AVOID_NON_PCI
-
/*
* A note on probe strategy. I/O and memory response by certain PCI
* devices has been disabled by the common layer at this point,
@@ -1306,7 +1300,7 @@ ATIProbe
4, fChipsets[ATI_CHIPSET_MACH64]) != DoProbe)
{
xf86MsgVerb(X_INFO, 2,
- ATI_NAME ": Unshared Mach64 at PIO base 0x%04lX not"
+ ATI_NAME ": Unshared Mach64 at PIO base 0x%04X not"
" probed.\n",
Mach64SparseIOBases[i]);
continue;
@@ -1316,7 +1310,7 @@ ATIProbe
if (!pATI)
{
xf86MsgVerb(X_INFO, 4,
- ATI_NAME ": Unshared Mach64 at PIO base 0x%04lX not"
+ ATI_NAME ": Unshared Mach64 at PIO base 0x%04X not"
" detected.\n", Mach64SparseIOBases[i]);
continue;
}
@@ -1334,9 +1328,6 @@ ATIProbe
ATIClaimSparseIOBases(ProbeFlags, Mach64SparseIOBases[i], 4,
DetectedMach64);
}
-
-#endif /* AVOID_NON_PCI */
-
}
#endif /* AVOID_CPIO */
@@ -1379,7 +1370,7 @@ ATIProbe
"Unshared PCI sparse I/O Mach64 in slot %d:%d:%d",
pVideo->bus, pVideo->device, pVideo->func);
xf86MsgVerb(X_INFO, 3,
- ATI_NAME ": %s detected through Block 0 at 0x%08lX.\n",
+ ATI_NAME ": %s detected through Block 0 at 0x%08X.\n",
Identifier, pATI->Block0Base);
AddAdapter(pATI);
pATI->PCIInfo = pVideo;
@@ -1502,8 +1493,6 @@ ATIProbe
pVideo->bus, pVideo->device, pVideo->func);
break;
-#ifndef AVOID_NON_PCI
-
case Detected8514A:
if ((p8514->BusType >= ATI_BUS_PCI) && !p8514->PCIInfo)
p8514->PCIInfo = pVideo;
@@ -1525,8 +1514,6 @@ ATIProbe
pVideo->bus, pVideo->device, pVideo->func);
break;
-#endif /* AVOID_NON_PCI */
-
default: /* Must be DoProbe */
if (!xf86CheckPciSlot(pVideo->bus,
pVideo->device,
@@ -1600,8 +1587,6 @@ ATIProbe
pVideo->bus, pVideo->device, pVideo->func);
break;
-#ifndef AVOID_NON_PCI
-
case Detected8514A:
xf86Msg(X_WARNING,
ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not"
@@ -1619,14 +1604,12 @@ ATIProbe
ATI_NAME ": PCI Mach64 in slot %d:%d:%d will"
" not be enabled\n because it conflicts with"
" another %s Mach64 at sparse I/O base"
- " 0x%04lX.\n",
+ " 0x%04X.\n",
pVideo->bus, pVideo->device, pVideo->func,
ATIBusNames[pATI->BusType],
Mach64SparseIOBases[j]);
break;
-#endif /* AVOID_NON_PCI */
-
default: /* Must be DoProbe */
if (!xf86CheckPciSlot(pVideo->bus,
pVideo->device,
@@ -1656,7 +1639,7 @@ ATIProbe
"Shared PCI Mach64 in slot %d:%d:%d",
pVideo->bus, pVideo->device, pVideo->func);
xf86MsgVerb(X_INFO, 3,
- ATI_NAME ": %s with sparse PIO base 0x%04lX"
+ ATI_NAME ": %s with sparse PIO base 0x%04X"
" detected.\n", Identifier,
Mach64SparseIOBases[j]);
AddAdapter(pATI);
@@ -1706,7 +1689,7 @@ ATIProbe
sprintf(Identifier, "Shared PCI Mach64 in slot %d:%d:%d",
pVideo->bus, pVideo->device, pVideo->func);
xf86MsgVerb(X_INFO, 3,
- ATI_NAME ": %s with Block 0 base 0x%08lX detected.\n",
+ ATI_NAME ": %s with Block 0 base 0x%08X detected.\n",
Identifier, pATI->Block0Base);
AddAdapter(pATI);
pATI->SharedAccelerator = TRUE;
@@ -1741,12 +1724,42 @@ ATIProbe
Chip = ATIChipID(pVideo->chipType, pVideo->chipRev);
if (Chip > ATI_CHIP_Mach64)
{
- if (Chip <= ATI_CHIP_Rage128)
- DoRage128 = TRUE;
- else if (Chip <= ATI_CHIP_Radeon)
- DoRadeon = TRUE;
+ switch (Chip)
+ {
+ case ATI_CHIP_RAGE128GL:
+ case ATI_CHIP_RAGE128VR:
+ case ATI_CHIP_RAGE128PROULTRA:
+ case ATI_CHIP_RAGE128PROGL:
+ case ATI_CHIP_RAGE128PROVR:
+ case ATI_CHIP_RAGE128MOBILITY3:
+ case ATI_CHIP_RAGE128MOBILITY4:
+ DoRage128 = TRUE;
+ continue;
- continue;
+ case ATI_CHIP_RADEON:
+ case ATI_CHIP_RADEONVE:
+ case ATI_CHIP_RADEONMOBILITY6:
+ case ATI_CHIP_RS100:
+ case ATI_CHIP_RS200:
+ case ATI_CHIP_RS250:
+ case ATI_CHIP_RADEONMOBILITY7:
+ case ATI_CHIP_R200:
+ case ATI_CHIP_RV200:
+ case ATI_CHIP_RV250:
+ case ATI_CHIP_RADEONMOBILITY9:
+ case ATI_CHIP_RS300:
+ case ATI_CHIP_RV280:
+ case ATI_CHIP_RADEONMOBILITY9PLUS:
+ case ATI_CHIP_R300:
+ case ATI_CHIP_RV350:
+ case ATI_CHIP_R350:
+ DoRadeon = TRUE;
+ continue;
+
+ case ATI_CHIP_HDTV:
+ default:
+ continue;
+ }
}
if (!nATIGDev)