[Bug 2260] New: Make AGP/PCI detection a generic function

bugzilla-daemon@freedesktop.org bugzilla-daemon@freedesktop.org
Tue Jan 11 06:25:45 PST 2005


Please do not reply to this email: if you want to comment on the bug, go to          
the URL shown below and enter yourcomments there.   
 
https://bugs.freedesktop.org/show_bug.cgi?id=2260        
   
           Summary: Make AGP/PCI detection a generic function
           Product: xorg
           Version: CVS_head
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Server/general
        AssignedTo: xorg-bugzilla-noise@freedesktop.org
        ReportedBy: agd5f@yahoo.com


The PCI/AGP detection code in the radeon driver should work for any card.  Felix
used it in the savage driver, and I may port it to the r128 driver as well.  It
would probably be useful as a generic routine.

mharris' comment (from radeon driver):
/* Proper autodetection of an AGP capable device requires examining
* PCI config registers to determine if the device implements extended
* PCI capabilities, and then walking the capability list as indicated
* in the PCI 2.2 and AGP 2.0 specifications, to determine if AGP
* capability is present.  The procedure is outlined as follows:
*
* 1) Test bit 4 (CAP_LIST) of the PCI status register of the device
*    to determine wether or not this device implements any extended
*    capabilities.  If this bit is zero, then the device is a PCI 2.1
*    or earlier device and is not AGP capable, and we can conclude it
*    to be a PCI device.
*
* 2) If bit 4 of the status register is set, then the device implements
*    extended capabilities.  There is an 8 bit wide capabilities pointer
*    register located at offset 0x34 in PCI config space which points to
*    the first capability in a linked list of extended capabilities that
*    this device implements.  The lower two bits of this register are
*    reserved and MBZ so must be masked out.
*
* 3) The extended capabilities list is formed by one or more extended
*    capabilities structures which are aligned on DWORD boundaries.
*    The first byte of the structure is the capability ID (CAP_ID)
*    indicating what extended capability this structure refers to.  The
*    second byte of the structure is an offset from the beginning of
*    PCI config space pointing to the next capability in the linked
*    list (NEXT_PTR) or NULL (0x00) at the end of the list.  The lower
*    two bits of this pointer are reserved and MBZ.  By examining the
*    CAP_ID of each capability and walking through the list, we will
*    either find the AGP_CAP_ID (0x02) indicating this device is an
*    AGP device, or we'll reach the end of the list, indicating it is
*    a PCI device.
*
* Mike A. Harris <mharris@redhat.com>
*
* References:
*  - PCI Local Bus Specification Revision 2.2, Chapter 6
*  - AGP Interface Specification Revision 2.0, Section 6.1.5
*/        
   
   
--         
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email       
   
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list