diff options
author | Eamon Walsh <ewalsh@epoch.ncsc.mil> | 2004-05-04 19:43:30 +0000 |
---|---|---|
committer | Eamon Walsh <ewalsh@epoch.ncsc.mil> | 2004-05-04 19:43:30 +0000 |
commit | a0265ed13319eb27223a39c34a446b26ffa64037 (patch) | |
tree | 08800423ddf28be3a36b597733ec784a39bb8c68 | |
parent | 397653e558b5fa4936ee6c9ac1eb6acaa9cf1cbc (diff) |
Merge the new release from HEADXACE-SELINUX
-rw-r--r-- | README.ati.sgml | 57 | ||||
-rw-r--r-- | README.r128.sgml | 9 | ||||
-rw-r--r-- | man/ati.man | 6 | ||||
-rw-r--r-- | man/r128.man | 6 | ||||
-rw-r--r-- | man/radeon.man | 6 | ||||
-rw-r--r-- | src/atimisc.c | 2 | ||||
-rw-r--r-- | src/atimodule.c | 2 | ||||
-rw-r--r-- | src/r128_misc.c | 2 | ||||
-rw-r--r-- | src/radeon_common.h | 2 | ||||
-rw-r--r-- | src/radeon_driver.c | 195 | ||||
-rw-r--r-- | src/radeon_misc.c | 2 | ||||
-rw-r--r-- | src/radeon_reg.h | 11 |
12 files changed, 224 insertions, 76 deletions
diff --git a/README.ati.sgml b/README.ati.sgml index 85d52a3..ed18393 100644 --- a/README.ati.sgml +++ b/README.ati.sgml @@ -1,4 +1,4 @@ -<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN"[ +<!DOCTYPE linuxdoc PUBLIC "-//Xorg//DTD linuxdoc//EN"[ <!ENTITY % defs SYSTEM "defs.ent"> %defs; ]> @@ -15,11 +15,12 @@ <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.42 2003/01/20 03:43:07 dawes Exp $ +$Id$ +Based on XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.42 2003/01/20 03:43:07 dawes Exp </ident> <abstract> -This is the README for the XFree86 ATI driver included in this release. +This is the README for the XAA ATI driver included in this release. </abstract> <!-- Table of contents --> @@ -46,8 +47,8 @@ otherwise <it>and</it> the user has requested such support. </itemize> Thus, the level of support provided not only depends on what the driver detects -in the system, but also, on what the user specifies in the XF86Config file. -See the <bf>``XF86Config specifications''</bf> section below for details.<p> +in the system, but also, on what the user specifies in the xorg.conf file. +See the <bf>``xorg.conf specifications''</bf> section below for details.<p> If none of the above conditions are met, the ATI driver will essentially disable itself to allow other drivers to examine the system.<p> Note that I am currently considering removing the driver's support for generic @@ -138,18 +139,18 @@ functionality, but the driver currently only uses the VGA.<p> The driver <it>does</it> however support the accelerator CRTC present in all ATI Mach64 adapters. For 256-colour, and higher depth modes, this support will be used by default, -although an XF86Config option can be specified to use the SuperVGA CRTC +although an xorg.conf option can be specified to use the SuperVGA CRTC instead. A linear video memory aperture is also available in 256-colour and higher depth modes and enabled by default if a 264xT or 3D Rage controller is detected or, on 88800 controllers, if the accelerator CRTC is used. -XF86Config options are available to disable this aperture, or (for non-PCI +xorg.conf options are available to disable this aperture, or (for non-PCI adapters) enable it or move it to some other address.<p> By default, the driver provides some acceleration for Mach64 if the accelerator CRTC is used, and modes whose colour depth greater than or equal to 8 are to be used. This support is as yet incomplete and can be disabled entirely with an -XF86Config option.<p> +xorg.conf option.<p> On non-Intel platforms, the driver can, currently, only support PCI Mach64 adapters.<p> <sect>Current implementation of generic VGA support for non-ATI adapters<p> @@ -157,7 +158,7 @@ Support for generic VGA with non-ATI adapters is also implemented, but has undergone only limited testing. The driver will intentionally disallow the use of this support with ATI adapters. -This support must be explicitly requested through an XF86Config ChipSet +This support must be explicitly requested through an xorg.conf ChipSet specification. This prevents the current VGA generic driver from being disabled.<p> This driver's generic VGA support is intended as an extension of that provided @@ -174,8 +175,8 @@ VGA implementation: <item>Interlaced modes are not available. <item>Colour depths higher than 8 are not available. </itemize> -<sect>XF86Config specifications<p> -The driver recognises a number of XF86Config options. +<sect>xorg.conf specifications<p> +The driver recognises a number of xorg.conf options. In general, all such options should be specified in a ``Device'' section, and affect only that ``Device'' section.<p> Those options that affect how the driver associates adapters with ``Device'' @@ -248,7 +249,7 @@ This option limits the adapters that can be associated with the ``Device'' section to the one with the specified PCI Bus ID. This specification excludes non-PCI adapters.<p> <sect1>Clocks<p> -For the purpose of specifying a clock line in your XF86Config, one of four +For the purpose of specifying a clock line in your xorg.conf, one of four different situations can occur, as follows.<p> Those configuring the driver's generic VGA support for a non-ATI adapter, can skip ahead to the <bf>``Clocks for non-ATI adapters''</bf> section below. @@ -274,14 +275,14 @@ The clock numbers reserved in this way are dependent on the particular clock generator used by the adapter.<p> The driver currently supports all programmable clock generators known to exist on Mach64 adapters. -In this case, the driver will completely ignore any XF86Config clock +In this case, the driver will completely ignore any xorg.conf clock specification, and programme the clock generator as needed by the modes used during the X session.<p> <sect2>Clocks for unsupported programmable clock generators<p> This case is unlikely to occur, but is documented for the sake of completeness.<p> In this situation, the driver will probe the adapter for clock frequencies -unless XF86Config clocks are already specified. +unless xorg.conf clocks are already specified. In either case, the driver will then attempt to normalise the clocks to one of the following specifications: <verb> @@ -372,12 +373,12 @@ those that are zero above, or vice-versa.<p> The order of the clocks <it>is</it> very important, although the driver will reorder the specified clocks if it deems it appropriate to do so. Mach32 and Mach64 owners should note that this order is different than what -they would use for previous XFree86 accelerated servers.<p> +they would use for previous accelerated servers.<p> <sect2>Clocks for non-ATI adapters<p> -If no clocks are specified in the XF86Config, the driver will probe for four +If no clocks are specified in the xorg.conf, the driver will probe for four clocks, the second of which will be assumed to be 28.322 MHz. The first clock will typically be 25.175 MHz, but there are exceptions. -You can include up to four clock frequencies in your XF86Config to specify the +You can include up to four clock frequencies in your xorg.conf to specify the actual values used by the adapter. Any more will be ignored.<p> <sect1>Option <it>``nopanel_display''</it><p> @@ -479,8 +480,8 @@ generator, which means it will treat it as a fixed-frequency clock generator, as described under the heading <bf>``Clocks for unsupported programmable clock generators''</bf> above.<p> <sect>Video modes<p> -Mode timings can be derived from the information in XFree86's doc subdirectory. -However, it is no longer required to specify such timings in an XF86Config's +Mode timings can be derived from the information in X's doc subdirectory. +However, it is no longer required to specify such timings in an xorg.conf's ``Monitor'' section(s), if only standard mode timings are to be used. The server automatically inserts VESA standard mode timings in every ``Monitor'' section, and these modes will be checked first for mode constraints @@ -498,7 +499,7 @@ server entry. The driver also inserts timings for a mode called <it>"Native panel mode"</it> that represents the panel's native resolution.<p> <sect>Known problems and limitations<p> -There are several known problems or limitations related to the XFree86 ATI +There are several known problems or limitations related to the ATI driver. They include:<p> <itemize> @@ -544,7 +545,7 @@ should be on 264xT and 3D Rage adapters. For now, clocks will, by default, be limited to 80MHz, 135MHz, 170MHz, 200MHz or 230MHz, depending on the specific controller. This limit can only be increased (up to a driver-calculated absolute maximum) -through the DACSpeed specification in XF86Config. +through the DACSpeed specification in xorg.conf. Be aware however that doing so is untested and might damage the adapter. <item>Except as in the previous items, clocks are limited to 80MHz on most adapters, although many are capable of higher frequencies. @@ -580,18 +581,18 @@ DVD, etc.) in a window or full-screen. <sect>Reporting problems<p> If you are experiencing problems that are not already recorded in this document, first ensure that you have the latest current release of this driver -and XFree86. -Check the server's log (usually found in /var/log/XFree86.0.log) and <htmlurl -name="ftp://ftp.xfree86.org/pub/XFree86" -url="ftp://ftp.xfree86.org/pub/XFree86"> if you are uncertain.<p> -Secondly, please check XFree86's doc directory for additional information.<p> +and the Xorg X server.. +Check the server's log (usually found in /var/log/Xorg.0.log) and <htmlurl +name="ftp://ftp.freedesktop.org/pub/Xorg" +url="ftp://ftp.freedesktop.org/pub/Xorg"> if you are uncertain.<p> +Secondly, please check Xorg's doc directory for additional information.<p> Thirdly, a scan through the comp.windows.x.i386unix and comp.os.linux.x -newsgroups and the xfree86 mailing list using your favourite archiving +newsgroups and the xorg mailing list using your favourite archiving service can also prove useful in resolving problems.<p> If you are still experiencing problems, you can send me <it>non-HTMLised</it> e-mail at <email>tsi@xfree86.org</email>. Please be as specific as possible when describing the problem(s), and include -an <it>unedited</it> copy of the server's log and the XF86Config file used.<p> +an <it>unedited</it> copy of the server's log and the xorg.conf file used.<p> <sect>Driver history<p> The complete history of the driver is rather cloudy. The following is more than likely to be incomplete and inaccurate.<p> diff --git a/README.r128.sgml b/README.r128.sgml index 7c7ac88..8d7f448 100644 --- a/README.r128.sgml +++ b/README.r128.sgml @@ -1,4 +1,4 @@ -<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN"[ +<!DOCTYPE linuxdoc PUBLIC "-//Xorg//DTD linuxdoc//EN"[ <!ENTITY % defs SYSTEM "defs.ent"> %defs; ]> @@ -8,7 +8,6 @@ <date>13 June 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/r128.sgml,v 1.7 2000/03/08 15:14:48 dawes Exp $ </ident> <toc> @@ -54,14 +53,14 @@ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/r128.sgml,v 1.7 2000/03/08 15: <p> The driver auto-detects all device information necessary to initialize the card. The only lines you need in the "Device" -section of your XF86Config file are: +section of your xorg.conf file are: <verb> Section "Device" Identifier "Rage 128" Driver "r128" EndSection </verb> -or let <tt>xf86config</tt> do this for you. +or let <tt>xorgconfig</tt> do this for you. However, if you have problems with auto-detection, you can specify: <itemize> @@ -92,6 +91,8 @@ However, if you have problems with auto-detection, you can specify: <sect>Authors <p> +The X11R&relvers; driver was originally part of XFree86 4.4 rc2. + The XFree86 4 driver was ported from XFree86 3.3.x and enhanced by: <itemize> <item>Rickard E. (Rik) Faith <email>faith@precisioninsight.com</email> diff --git a/man/ati.man b/man/ati.man index 5708629..fa46bfc 100644 --- a/man/ati.man +++ b/man/ati.man @@ -14,17 +14,17 @@ ati \- ATI video driver .fi .SH DESCRIPTION .B ati -is an XFree86 driver for ATI video cards. +is an __xservername__ driver for ATI video cards. THIS MAN PAGE NEEDS TO BE FILLED IN. .SH SUPPORTED HARDWARE The .B ati driver supports... .SH CONFIGURATION DETAILS -Please refer to XF86Config(__filemansuffix__) for general configuration +Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS Authors include: ... diff --git a/man/r128.man b/man/r128.man index 606b9d6..2c2c872 100644 --- a/man/r128.man +++ b/man/r128.man @@ -14,7 +14,7 @@ r128 \- ATI Rage 128 video driver .fi .SH DESCRIPTION .B r128 -is an XFree86 driver for ATI Rage 128 based video cards. It contains +is an __xservername__ driver for ATI Rage 128 based video cards. It contains full support for 8, 15, 16 and 24 bit pixel depths, hardware acceleration of drawing primitives, hardware cursor, video modes up to 1800x1440 @ 70Hz, doublescan modes (e.g., 320x200 and 320x240), gamma @@ -26,7 +26,7 @@ The driver supports all ATI Rage 128 based video cards including the Rage Fury AGP 32MB, the XPERT 128 AGP 16MB and the XPERT 99 AGP 8MB. .SH CONFIGURATION DETAILS -Please refer to XF86Config(__filemansuffix__) for general configuration +Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP @@ -125,7 +125,7 @@ Enable or disable viewing offscreen cache memory. A development debug option. Default: off. .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS .nf Rickard E. (Rik) Faith \fIfaith@precisioninsight.com\fP diff --git a/man/radeon.man b/man/radeon.man index 7a7c2a9..c09ac46 100644 --- a/man/radeon.man +++ b/man/radeon.man @@ -13,7 +13,7 @@ radeon \- ATI RADEON video driver .fi .SH DESCRIPTION .B radeon -is a XFree86 driver for ATI RADEON based video cards. It contains +is a __xservername__ driver for ATI RADEON based video cards. It contains full support for 8, 15, 16 and 24 bit pixel depths, dual-head setup, flat panel, hardware 2D acceleration, hardware 3D acceleration (except R300 and IGP series cards), hardware cursor, XV extension, Xinerama extension. @@ -68,7 +68,7 @@ Radeon 9600PRO/9600SE/9600, M10/M11, FireGL T2 (2D only) Radeon 9600XT (2d only) .SH CONFIGURATION DETAILS -Please refer to XF86Config(__filemansuffix__) for general configuration +Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP @@ -311,7 +311,7 @@ parameter may be specified as a float value with standard suffixes like "k", "kHz", "M", "MHz". .SH SEE ALSO -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS .nf Authors include: ... diff --git a/src/atimisc.c b/src/atimisc.c index 53c97b5..8c8ae06 100644 --- a/src/atimisc.c +++ b/src/atimisc.c @@ -35,7 +35,7 @@ static XF86ModuleVersionInfo ATIVersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, diff --git a/src/atimodule.c b/src/atimodule.c index 206e281..a4393c9 100644 --- a/src/atimodule.c +++ b/src/atimodule.c @@ -77,7 +77,7 @@ static XF86ModuleVersionInfo ATIVersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, diff --git a/src/r128_misc.c b/src/r128_misc.c index 30202b3..dd77061 100644 --- a/src/r128_misc.c +++ b/src/r128_misc.c @@ -38,7 +38,7 @@ static XF86ModuleVersionInfo R128VersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, R128_VERSION_MAJOR, R128_VERSION_MINOR, R128_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, diff --git a/src/radeon_common.h b/src/radeon_common.h index 924c7ff..7e4e414 100644 --- a/src/radeon_common.h +++ b/src/radeon_common.h @@ -31,7 +31,7 @@ * Converted to common header format: * Jens Owen <jens@tungstengraphics.com> * - * $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.1.4.2 2003/12/06 13:24:24 kaleb Exp $ + * $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.2 2004/04/23 19:26:46 eich Exp $ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.8tsi Exp $ * */ diff --git a/src/radeon_driver.c b/src/radeon_driver.c index d190a52..1efa07a 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2258,27 +2258,66 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) #ifdef XF86DRI /* AGP/PCI */ - - /* There are signatures in BIOS and PCI-SSID for a PCI card, but - * they are not very reliable. Following detection method works for - * all cards tested so far. Note, checking AGP_ENABLE bit after - * drmAgpEnable call can also give the correct result. However, - * calling drmAgpEnable on a PCI card can cause some strange lockup - * when the server restarts next time. + /* 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 */ - agpCommand = pciReadLong(info->PciTag, RADEON_AGP_COMMAND_PCI_CONFIG); - pciWriteLong(info->PciTag, RADEON_AGP_COMMAND_PCI_CONFIG, - agpCommand | RADEON_AGP_ENABLE); - if (pciReadLong(info->PciTag, RADEON_AGP_COMMAND_PCI_CONFIG) - & RADEON_AGP_ENABLE) { - info->IsPCI = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "AGP card detected\n"); - } else { - info->IsPCI = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI card detected\n"); + info->IsPCI = TRUE; + + if (pciReadLong(info->PciTag, PCI_CMD_STAT_REG) & RADEON_CAP_LIST) { + CARD32 cap_ptr, cap_id; + + cap_ptr = pciReadLong(info->PciTag, + RADEON_CAPABILITIES_PTR_PCI_CONFIG) + & RADEON_CAP_PTR_MASK; + + while(cap_ptr != RADEON_CAP_ID_NULL) { + cap_id = pciReadLong(info->PciTag, cap_ptr); + if ((cap_id & 0xff)== RADEON_CAP_ID_AGP) { + info->IsPCI = FALSE; + break; + } + cap_ptr = (cap_id >> 8) & RADEON_CAP_PTR_MASK; + } } - pciWriteLong(info->PciTag, RADEON_AGP_COMMAND_PCI_CONFIG, agpCommand); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s card detected\n", + (info->IsPCI) ? "PCI" : "AGP"); if ((s = xf86GetOptValString(info->Options, OPTION_BUS_TYPE))) { if (strcmp(s, "AGP") == 0) { @@ -7031,12 +7070,79 @@ void RADEONFreeScreen(int scrnIndex, int flags) RADEONFreeRec(pScrn); } +/* + * Powering done DAC, needed for DPMS problem with ViewSonic P817 (or its variant). + * + * Note for current DAC mapping when calling this function: + * For most of cards: + * single CRT: Driver doesn't change the existing CRTC->DAC mapping, + * CRTC1 could be driving either DAC or both DACs. + * CRT+CRT: CRTC1->TV DAC, CRTC2->Primary DAC + * DFP/LCD+CRT: CRTC2->TV DAC, CRTC2->Primary DAC. + * Some boards have two DACs reversed or don't even have a primary DAC, + * this is reflected in pRADEONEnt->ReversedDAC. And radeon 7200 doesn't + * have a second DAC. + * It's kind of messy, we'll need to redo DAC mapping part some day. + */ +static void RADEONDacPowerSet(ScrnInfoPtr pScrn, Bool IsOn, Bool IsPrimaryDAC) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + + if (IsPrimaryDAC) { + CARD32 dac_cntl; + CARD32 dac_macro_cntl = 0; + dac_cntl = INREG(RADEON_DAC_CNTL); + if ((!info->IsMobility) || (info->ChipFamily == CHIP_FAMILY_RV350)) + dac_macro_cntl = INREG(RADEON_DAC_MACRO_CNTL); + if (IsOn) { + dac_cntl &= ~RADEON_DAC_PDWN; + dac_macro_cntl &= ~(RADEON_DAC_PDWN_R | + RADEON_DAC_PDWN_G | + RADEON_DAC_PDWN_B); + } else { + dac_cntl |= RADEON_DAC_PDWN; + dac_macro_cntl |= (RADEON_DAC_PDWN_R | + RADEON_DAC_PDWN_G | + RADEON_DAC_PDWN_B); + } + OUTREG(RADEON_DAC_CNTL, dac_cntl); + if ((!info->IsMobility) || (info->ChipFamily == CHIP_FAMILY_RV350)) + OUTREG(RADEON_DAC_MACRO_CNTL, dac_macro_cntl); + } else { + if (info->ChipFamily != CHIP_FAMILY_R200) { + CARD32 tv_dac_cntl = INREG(RADEON_TV_DAC_CNTL); + if (IsOn) { + tv_dac_cntl &= ~(RADEON_TV_DAC_RDACPD | + RADEON_TV_DAC_GDACPD | + RADEON_TV_DAC_BDACPD | + RADEON_TV_DAC_BGSLEEP); + } else { + tv_dac_cntl |= (RADEON_TV_DAC_RDACPD | + RADEON_TV_DAC_GDACPD | + RADEON_TV_DAC_BDACPD | + RADEON_TV_DAC_BGSLEEP); + } + OUTREG(RADEON_TV_DAC_CNTL, tv_dac_cntl); + } else { + CARD32 fp2_gen_cntl = INREG(RADEON_FP2_GEN_CNTL); + if (IsOn) { + fp2_gen_cntl |= RADEON_FP2_DV0_EN; + } else { + fp2_gen_cntl &= ~RADEON_FP2_DV0_EN; + } + OUTREG(RADEON_FP2_GEN_CNTL, fp2_gen_cntl); + } + } +} + /* Sets VESA Display Power Management Signaling (DPMS) Mode */ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags) { RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); unsigned char *RADEONMMIO = info->MMIO; #ifdef XF86DRI @@ -7055,8 +7161,6 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS); - /* TODO: additional handling for LCD ? */ - switch (PowerManagementMode) { case DPMSModeOn: /* Screen: On; HSync: On, VSync: On */ @@ -7123,13 +7227,19 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, if (info->ChipFamily >= CHIP_FAMILY_R200) { OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_DV0_EN, ~RADEON_FP2_DV0_EN); } + } else if (info->DisplayType == MT_CRT) { + RADEONDacPowerSet(pScrn, TRUE, !pRADEONEnt->ReversedDAC); } } else { - if ((info->Clone) && (info->CloneType == MT_DFP)) { - OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_BLANK_EN); - OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_ON, ~RADEON_FP2_ON); - if (info->ChipFamily >= CHIP_FAMILY_R200) { - OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_DV0_EN, ~RADEON_FP2_DV0_EN); + if (info->Clone) { + if (info->CloneType == MT_DFP) { + OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_BLANK_EN); + OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_ON, ~RADEON_FP2_ON); + if (info->ChipFamily >= CHIP_FAMILY_R200) { + OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_DV0_EN, ~RADEON_FP2_DV0_EN); + } + } else if (info->CloneType == MT_CRT) { + RADEONDacPowerSet(pScrn, TRUE, !pRADEONEnt->ReversedDAC); } } if (info->DisplayType == MT_DFP) { @@ -7140,6 +7250,14 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, OUTREGP (RADEON_LVDS_GEN_CNTL, RADEON_LVDS_BLON, ~RADEON_LVDS_BLON); usleep (info->PanelPwrDly * 1000); OUTREGP (RADEON_LVDS_GEN_CNTL, RADEON_LVDS_ON, ~RADEON_LVDS_ON); + } else if (info->DisplayType == MT_CRT) { + if ((pRADEONEnt->HasSecondary) || info->Clone) { + RADEONDacPowerSet(pScrn, TRUE, pRADEONEnt->ReversedDAC); + } else { + RADEONDacPowerSet(pScrn, TRUE, TRUE); + if (info->HasCRTC2) + RADEONDacPowerSet(pScrn, TRUE, FALSE); + } } } } else if ((PowerManagementMode == DPMSModeOff) || @@ -7152,13 +7270,19 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, if (info->ChipFamily >= CHIP_FAMILY_R200) { OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_DV0_EN); } + } else if (info->DisplayType == MT_CRT) { + RADEONDacPowerSet(pScrn, FALSE, !pRADEONEnt->ReversedDAC); } } else { - if ((info->Clone) && (info->CloneType == MT_DFP)) { - OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_BLANK_EN, ~RADEON_FP2_BLANK_EN); - OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_ON); - if (info->ChipFamily >= CHIP_FAMILY_R200) { - OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_DV0_EN); + if (info->Clone) { + if(info->CloneType == MT_DFP) { + OUTREGP (RADEON_FP2_GEN_CNTL, RADEON_FP2_BLANK_EN, ~RADEON_FP2_BLANK_EN); + OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_ON); + if (info->ChipFamily >= CHIP_FAMILY_R200) { + OUTREGP (RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_DV0_EN); + } + } else if (info->CloneType == MT_CRT) { + RADEONDacPowerSet(pScrn, FALSE, !pRADEONEnt->ReversedDAC); } } if (info->DisplayType == MT_DFP) { @@ -7179,6 +7303,17 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, if (info->IsMobility || info->IsIGP) { OUTPLL(RADEON_PIXCLKS_CNTL, tmpPixclksCntl); } + } else if (info->DisplayType == MT_CRT) { + if ((pRADEONEnt->HasSecondary) || info->Clone) { + RADEONDacPowerSet(pScrn, FALSE, pRADEONEnt->ReversedDAC); + } else { + /* single CRT, turning both DACs off, we don't really know + * which DAC is actually connected. + */ + RADEONDacPowerSet(pScrn, FALSE, TRUE); + if (info->HasCRTC2) /* don't apply this to old radeon (singel CRTC) card */ + RADEONDacPowerSet(pScrn, FALSE, FALSE); + } } } } diff --git a/src/radeon_misc.c b/src/radeon_misc.c index 6d6b17d..c7671b7 100644 --- a/src/radeon_misc.c +++ b/src/radeon_misc.c @@ -38,7 +38,7 @@ static XF86ModuleVersionInfo RADEONVersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, RADEON_VERSION_MAJOR, RADEON_VERSION_MINOR, RADEON_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, diff --git a/src/radeon_reg.h b/src/radeon_reg.h index 821a087..8af5da5 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -65,6 +65,12 @@ # define RADEON_AGP_APER_SIZE_8MB (0x3e << 0) # define RADEON_AGP_APER_SIZE_4MB (0x3f << 0) # define RADEON_AGP_APER_SIZE_MASK (0x3f << 0) +#define RADEON_STATUS_PCI_CONFIG 0x06 +# define RADEON_CAP_LIST 0x100000 +#define RADEON_CAPABILITIES_PTR_PCI_CONFIG 0x34 /* offset in PCI config*/ +# define RADEON_CAP_PTR_MASK 0xfc /* mask off reserved bits of CAP_PTR */ +# define RADEON_CAP_ID_NULL 0x00 /* End of capability list */ +# define RADEON_CAP_ID_AGP 0x02 /* AGP capability ID */ #define RADEON_AGP_COMMAND 0x0f60 /* PCI */ #define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ # define RADEON_AGP_ENABLE (1<<8) @@ -401,11 +407,16 @@ # define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6) # define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00 # define RADEON_DAC_FORCE_DATA_SHIFT 8 +#define RADEON_DAC_MACRO_CNTL 0x0d04 +# define RADEON_DAC_PDWN_R (1 << 16) +# define RADEON_DAC_PDWN_G (1 << 17) +# define RADEON_DAC_PDWN_B (1 << 18) #define RADEON_TV_DAC_CNTL 0x088c # define RADEON_TV_DAC_STD_MASK 0x0300 # define RADEON_TV_DAC_RDACPD (1 << 24) # define RADEON_TV_DAC_GDACPD (1 << 25) # define RADEON_TV_DAC_BDACPD (1 << 26) +# define RADEON_TV_DAC_BGSLEEP (1 << 26) #define RADEON_DISP_HW_DEBUG 0x0d14 # define RADEON_CRT2_DISP1_SEL (1 << 5) #define RADEON_DISP_OUTPUT_CNTL 0x0d64 |