The ati driver is the only one doing dynamic resource determination and multiple ClaimFixedResources
calls for a single device. Following that model, I put together a resource gathering scheme to allow
a single AddBusDeviceToConfig call per card. I tried it out with a VGA Wonder, Graphics Ultra Pro,
and a Mach64, and the probe lists matched the claims that followed, so I think I'm close. The changes
are all in atiprobe.c and at the end of this message.
All three cards control the mono resources when configured as color, so I need a third class of vga
resources (color, mono, both). Ati cards also respond to aliases for the standard ports, convincing
me to use the ChkConflict routines in xf86Bus.c rather than walking through the lists myself. The only
external change needed with this is adding xf86AddBusDeviceToConfig in loader/xf86sym.c, which
should probably be there anyway.
Enjoy Lee
diff -bc atiprobe.c*
*** atiprobe.c Fri Mar 26 12:10:36 2004
--- atiprobe.c.orig Tue Feb 24 17:19:09 2004
***************
*** 1037,1051 ****
static const IOADDRESS Mach64SparseIOBases[] = {0x02ECU, 0x01CCU, 0x01C8U};
CARD8 ProbeFlags[LongPort(SPARSE_IO_BASE) + 1];
- static resRange ATIResources[] = { - { 0, 0, 0}, /* 8514 or Mach64 */ - { 0, 0, 0}, /* VGAWonder */ - _VGA_EXCLUSIVE, /* chosen by size */ - _HGA_EXCLUSIVE, /* overwritten later */ - _END - }; - #define RES_VGA_OFFSET 2 - unsigned long BIOSBase; static const CARD8 ATISignature[] = " 761295520"; # define SignatureSize 10 --- 1037,1042 ---- *************** *** 2023,2087 **** #endif /* AVOID_CPIO */
{
- resRange *resPtr;
- int count;
-
ProbeSuccess = TRUE;
! if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
! {
! resPtr =
! (pATI->Chip <= ATI_CHIP_18800_1) ?
! (pATI->SharedVGA ?
! resVgaSparseShared : resVgaSparseExclusive) :
! (pATI->SharedVGA ? resVgaShared : resVgaExclusive);
! for (count = 0; resPtr[count].type != ResEnd; ++count)
! ;
! memcpy(&ATIResources[RES_VGA_OFFSET], resPtr, (count + 1) * sizeof(resRange));
! resPtr = &ATIResources[RES_VGA_OFFSET];
! }
! else /* no VGA, point to ResEnd */
! resPtr = &ATIResources[(sizeof(ATIResources)/sizeof(ATIResources[0]))-1];
!
! if (pATI->CPIO_VGAWonder)
! {
! --resPtr;
! if (pATI->SharedVGA)
! resPtr->type = ResShrIoSparse | ResBus;
! else
! resPtr->type = ResExcIoSparse | ResBus;
! resPtr->rBase = pATI->CPIO_VGAWonder;
! if (pATI->Chip <= ATI_CHIP_18800_1)
! resPtr->rMask = 0x03FEU;
! else
! resPtr->rMask = 0xF3FEU;
!
! }
! if (pATI->ChipHasSUBSYS_CNTL == TRUE)
! {
! resRange *res8514 = pATI->SharedAccelerator ?
! res8514Shared : res8514Exclusive;
! --resPtr;
! for (count = 0; res8514[count].type != ResEnd; ++count)
! ;
! memcpy(resPtr, res8514, count * sizeof(resRange));
! }
! if ((pATI->Adapter == ATI_ADAPTER_MACH64) &&
! (pATI->CPIODecoding == SPARSE_IO))
! {
! --resPtr;
! if (pATI->SharedAccelerator)
! resPtr->type = ResShrIoSparse | ResBus;
! else
! resPtr->type = ResExcIoSparse | ResBus;
! resPtr->rBase = pATI->CPIOBase;
! resPtr->rMask = 0x03FCU;
! }
!
!
! pGDev = xf86AddBusDeviceToConfigure(ATI_DRIVER_NAME,
! pATI->PCIInfo ? BUS_PCI: BUS_ISA,
! pATI->PCIInfo ? pATI->PCIInfo : (void *)resPtr,
! ATI_CHIPSET_ATI);
if (pGDev)
{
/* Fill in additional information */
--- 2014,2022 ----
#endif /* AVOID_CPIO */
{ ProbeSuccess = TRUE; ! pGDev = xf86AddDeviceToConfigure(ATI_DRIVER_NAME, ! pATI->PCIInfo, ATI_CHIPSET_ATI); if (pGDev) { /* Fill in additional information */
End of atiprobe.c diffs
_______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel