Commit bea8085e authored by Eric Anholt's avatar Eric Anholt

DRI trunk-20040613 import

parent 7b588cda
......@@ -16,7 +16,7 @@ radeon \- ATI RADEON video driver
is a XFree86 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.
(except R300 series cards), hardware cursor, XV extension, Xinerama extension.
.SH SUPPORTED HARDWARE
The
.B radeon
......@@ -29,37 +29,43 @@ Radeon 7200
Radeon 7000(VE), M6
.TP 12
.B RS100
Radeon IGP320(M) (2D only)
Radeon IGP320(M)
.TP 12
.B RV200
Radeon 7500, M7
Radeon 7500, M7, FireGL 7800
.TP 12
.B RS200
Radeon IGP330(M)/IGP340(M) (2D only)
Radeon IGP330(M)/IGP340(M)
.TP 12
.B RS250
Radeon Mobility 7000 IGP (2D only)
Radeon Mobility 7000 IGP
.TP 12
.B R200
Radeon 8500, 9100, FireGL 8800/8700
.TP 12
.B RV250
Radeon 9000, M9
Radeon 9000PRO/9000, M9
.TP 12
.B RS300
Radeon 9000 IGP (2D only)
Radeon 9100 IGP
.TP 12
.B RV280
Radeon 9200, M9+
Radeon 9200PRO/9200/9200SE, M9+
.TP 12
.B R300
Radeon 9700PRO/9700/9500PRO/9500, FireGL X1/Z1 (2D only)
Radeon 9700PRO/9700/9500PRO/9500/9600TX, FireGL X1/Z1 (2D only)
.TP 12
.B R350
Radeon 9800PRO (2D only)
Radeon 9800PRO/9800SE/9800, FireGL X2 (2D only)
.TP 12
.B R360
Radeon 9800XT (2d only)
.TP 12
.B RV350
Radeon 9600PRO/9600, M10 (2D only)
Radeon 9600PRO/9600SE/9600, M10/M11, FireGL T2 (2D only)
.TP 12
.B RV360
Radeon 9600XT (2d only)
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
......@@ -111,8 +117,8 @@ The default value is
.TP
.BI "Option \*qUseFBDev\*q \*q" boolean \*q
Enable or disable use of an OS\-specific framebuffer device interface
(which is not supported on all OSs). See fbdevhw(__drivermansuffix__)
for further information.
(which is not supported on all OSs). MergedFB does not work when this
option is in use. See fbdevhw(__drivermansuffix__) for further information.
.br
The default is
.B off.
......@@ -137,13 +143,22 @@ Enable AGP fast write.
The default is
.B off.
.TP
.BI "Option \*qForcePCIMode\*q \*q" boolean \*q
Force to use PCI GART for DRI acceleration.
.BI "Option \*qBusType\*q \*q" string \*q
Used to replace previous ForcePCIMode option.
Should only be used when driver's bus detection is incorrect
or you want to force a AGP card to PCI mode. Should NEVER force
a PCI card to AGP bus.
.br
PCI \-\- PCI bus
.br
AGP \-\- AGP bus
.br
PCIE \-\- PCI Express (falls back to PCI at present)
.br
(used only when DRI is enabled)
.br
The default is
.B off.
.B auto detect.
.TP
.BI "Option \*qDDCMode\*q \*q" boolean \*q
Force to use the modes queried from the connected monitor.
......@@ -151,6 +166,23 @@ Force to use the modes queried from the connected monitor.
The default is
.B off.
.TP
.BI "Option \*qDisplayPriority\*q \*q" string \*q
.br
Used to prevent flickering or tearing problem caused by display buffer underflow.
.br
AUTO \-\- Driver calculated (default).
.br
BIOS \-\- Remain unchanged from BIOS setting.
Use this if the calculation is not correct
for your card.
.br
HIGH \-\- Force to the highest priority.
Use this if you have problem with above options.
This may affect performance slightly.
.br
The default value is
.B AUTO.
.TP
.BI "Option \*qMonitorLayout\*q \*q" string \*q
.br
This option is used to overwrite the detected monitor types.
......@@ -163,7 +195,7 @@ CRT \-\- Analog CRT monitor
.br
TMDS \-\- Desktop flat panel
.br
LVDS \-\- Lapto flat panel
LVDS \-\- Laptop flat panel
.br
This option can be used in following format:
.br
......@@ -181,7 +213,7 @@ DVI port on DVI+VGA cards
.br
LCD output on laptops
.br
Internal TMDS prot on DVI+DVI cards
Internal TMDS port on DVI+DVI cards
.br
.B Secondary head:
.br
......@@ -194,40 +226,162 @@ External TMDS port on DVI+DVI cards
The default value is
.B undefined.
.TP
.BI "Option \*qCloneMode\*q \*q" "string" \*q
Set the first mode for the secondary head.
It can be different from the modes used for the primary head. If you don't
have this line while clone is on, the modes specified for the primary head
will be used for the secondary head.
.BI "Option \*qMergedFB\*q \*q" boolean \*q
This enables merged framebuffer mode. In this mode you have a single
shared framebuffer with two viewports looking into it. It is similar
to Xinerama, but has some advantages. It is faster than Xinerama, the
DRI works on both heads, and it supports clone modes.
.br
Merged framebuffer mode provides two linked viewports looking into a
single large shared framebuffer. The size of the framebuffer is
determined by the
.B Virtual
keyword defined on the
.B Screen
section of your XF86Config file. It works just like regular virtual
desktop except you have two viewports looking into it instead of one.
.br
For example, if you wanted a desktop composed of two 1024x768 viewports
looking into a single desktop you would create a virtual desktop of
2048x768 (left/right) or 1024x1536 (above/below), e.g.,
.br
.B Virtual 2048 768
or
.B Virtual 1024 1536
.br
The virtual desktop can be larger than larger than the size of the viewports
looking into it. In this case the linked viewports will scroll around in the
virtual desktop. Viewports with different sizes are also supported (e.g., one
that is 1024x768 and one that is 640x480). In this case the smaller viewport
will scroll relative to the larger one such that none of the virtual desktop
is inaccessable. If you do not define a virtual desktop the driver will create
one based on the orientation of the heads and size of the largest defined mode in
the display section that is supported on each head.
.br
For example, Option "CloneMode" "1024x768"
The relation of the viewports in specified by the
.B CRT2Position
Option. The options are
.B Clone
,
.B LeftOf
,
.B RightOf
,
.B Above
, and
.B Below.
MergedFB is enabled by default if a monitor is detected on each output. If
no position is given it defaults to clone mode (the old clone options are now
deprecated, also, the option OverlayOnCRTC2 has been replaced by the Xv
attribute XV_SWITCHCRT; the overlay can be switched to CRT1 or CRT2 on the fly
in clone mode).
.br
The maximum framebuffer size that the 2D acceleration engine can handle is
8192x8192. The maximum framebuffer size that the 3D engine can handle is
2048x2048.
.br
.B Note:
Page flipping does not work well in certain configurations with MergedFB. If you
see rendering errors or other strange behavior, disable page flipping. Also MergedFB
is not compatible with the
.B UseFBDev
option.
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCloneHSync\*q \*q" "string" \*q
.BI "Option \*qCRT2HSync\*q \*q" "string" \*q
Set the horizontal sync range for the secondary monitor.
It is not required if a DDC\-capable monitor is connected.
.br
For example, Option "CloneHSync" "30.0-86.0"
For example, Option "CRT2HSync" "30.0-86.0"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCloneVRefresh\*q \*q" "string" \*q
Set the vertical refresh range for the secondary monitor.
.BI "Option \*qCRT2VRefresh\*q \*q" "string" \*q
Set the vertical refresh range for the secondary monitor.
It is not required if a DDC\-capable monitor is connected.
.br
For example, Option "CloneVRefresh" "50.0-120.0"
For example, Option "CRT2VRefresh" "50.0-120.0"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCRT2Position\*q \*q" "string" \*q
Set the relationship of CRT2 relative to CRT1. Valid options are:
.B Clone
,
.B LeftOf
,
.B RightOf
,
.B Above
, and
.B Below
.
.br
For example, Option "CRT2Position" "RightOf"
.br
The default value is
.B Clone.
.TP
.BI "Option \*qMetaModes\*q \*q" "string" \*q
MetaModes are mode combinations for CRT1 and CRT2. If you are using merged
frame buffer mode and want to change modes (CTRL-ALT-+/-), these define which
modes will be switched to on CRT1 and CRT2. The MetaModes are defined as
CRT1Mode-CRT2Mode (800x600-1024x768). Modes listed individually (800x600)
define clone modes, that way you can mix clone modes with non-clone modes.
Also some programs require "standard" modes.
.br
Note: Any mode you use in the MetaModes must be defined in the
.B Screen
section of your XF86Config file. Modes not defined there will be ignored when
the MetaModes are parsed since the driver uses them to make sure the monitors can
handle those modes. If you do not define a MetaMode the driver will create
one based on the orientation of the heads and size of the largest defined mode in
the display section that is supported on each head.
.br
.B Modes "1024x768" "800x600" "640x480"
.br
For example, Option "MetaModes" "1024x768-1024x768 800x600-1024x768 640x480-800x600 800x600"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qOverlayOnCRTC2\*q \*q" boolean \*q
Force hardware overlay to clone head.
.BI "Option \*qNoMergedXinerama\*q \*q" boolean \*q
Since merged framebuffer mode does not use Xinerama, apps are not able to intelligently
place windows. Merged framebuffer mode provides its own pseudo-Xinerama. This allows
Xinerama compliant applications to place windows appropriately. There are some caveats.
Since merged framebuffer mode is able to change relative screen sizes and orientations on
the fly, as well has having overlapping viewports, pseudo-Xinerama, might not always
provide the right hints. Also many Xinerama compliant applications only query Xinerama
once at startup; if the information changes, they may not be aware of the change. If
you are already using Xinerama (e.g., a single head card and a dualhead card providing
three heads), pseudo-Xinerama will be disabled.
.br
This option allows you turn off the driver provided pseudo-Xinerama extension.
.br
The default value is
.B off.
.B FALSE.
.TP
.BI "Option \*qMergedXineramaCRT2IsScreen0\*q \*q" boolean \*q
By default the pseudo-Xinerama provided by the driver makes the left-most or bottom
head Xinerama screen 0. Certain Xinerama-aware applications do special things with
screen 0. To change that behavior, use this option.
.br
The default value is
.B undefined.
.TP
.BI "Option \*qMergedDPI\*q \*q" "string" \*q
The driver will attempt to figure out an appropriate DPI based on the DDC information
and the orientation of the heads when in merged framebuffer mode. If this value does
not suit you, you can manually set the DPI using this option.
.br
For example, Option "MergedDPI" "100 100"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qIgnoreEDID\*q \*q" boolean \*q
Do not use EDID data for mode validation, but DDC is still used
......@@ -236,8 +390,21 @@ for monitor detection. This is different from NoDDC option.
The default value is
.B off.
.TP
.BI "Option \*qPanelSize\*q \*q" "string" \*q
Should only be used when driver cannot detect the correct panel size.
Apply to both desktop (TMDS) and laptop (LVDS) digital panels.
When a valid panel size is specified, the timings collected from
DDC and BIOS will not be used. If you have a panel with timings
different from that of a standard VESA mode, you have to provide
this information through the Modeline.
.br
For example, Option "PanelSize" "1400x1050"
.br
The default value is
.B none.
.TP
.BI "Option \*qPanelOff\*q \*q" boolean \*q
Disable panel output. Only used when clone is enabled.
Disable panel output.
.br
The default value is
.B off.
......@@ -246,6 +413,10 @@ The default value is
Enable page flipping for 3D acceleration. This will increase performance
but not work correctly in some rare cases, hence the default is
.B off.
.br
.B Note:
Page flipping does not work well in certain configurations with MergedFB. If you
see rendering errors or other strange behavior, disable page flipping.
.SH SEE ALSO
......
......@@ -19,6 +19,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#include "atiaccel.h"
......@@ -64,6 +67,12 @@ ATIInitializeAcceleration
#endif /* AVOID_CPIO */
#ifdef XF86DRI
/* If DRI is enabled, we've already set up the FB manager in ATIScreenInit */
if (!pATI->directRenderingEnabled)
#endif /* XF86DRI */
{
/*
* Note: If PixelArea exceeds the engine's maximum, the excess is
......
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.35 2003/07/02 17:31:28 martin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.37 2003/10/07 22:47:11 martin Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
......@@ -101,6 +101,7 @@ const char *ATIChipNames[] =
"ATI Radeon 9700/9500",
"ATI Radeon 9600",
"ATI Radeon 9800",
"ATI Radeon 9800XT",
"ATI Rage HDTV"
};
......@@ -673,14 +674,11 @@ ATIChipID
case NewChipID('Q', 'X'):
return ATI_CHIP_RV200;
case NewChipID('I', 'd'):
case NewChipID('I', 'e'):
case NewChipID('I', 'f'):
case NewChipID('I', 'g'):
return ATI_CHIP_RV250;
case NewChipID('L', 'd'):
case NewChipID('L', 'e'):
case NewChipID('L', 'f'):
case NewChipID('L', 'g'):
return ATI_CHIP_RADEONMOBILITY9;
......@@ -691,14 +689,12 @@ ATIChipID
case NewChipID('Y', '\''):
case NewChipID('Y', 'a'):
case NewChipID('I', 'b'):
case NewChipID('I', 'c'):
case NewChipID('Y', 'b'):
case NewChipID('Y', 'd'):
return ATI_CHIP_RV280;
case NewChipID('Y', 'h'):
case NewChipID('Y', 'i'):
case NewChipID('Y', 'j'):
case NewChipID('Y', 'k'):
case NewChipID('\\', 'a'):
case NewChipID('\\', 'c'):
return ATI_CHIP_RADEONMOBILITY9PLUS;
case NewChipID('A', 'D'):
......@@ -711,16 +707,32 @@ ATIChipID
case NewChipID('N', 'G'):
return ATI_CHIP_R300;
case NewChipID('A', 'H'):
case NewChipID('A', 'I'):
case NewChipID('A', 'J'):
case NewChipID('A', 'K'):
case NewChipID('N', 'H'):
case NewChipID('N', 'I'):
case NewChipID('N', 'K'):
return ATI_CHIP_R350;
case NewChipID('N', 'P'):
case NewChipID('A', 'P'):
case NewChipID('A', 'Q'):
case NewChipID('A', 'R'):
case NewChipID('A', 'S'):
case NewChipID('A', 'T'):
case NewChipID('A', 'V'):
case NewChipID('N', 'P'):
case NewChipID('N', 'Q'):
case NewChipID('N', 'R'):
case NewChipID('N', 'S'):
case NewChipID('N', 'T'):
case NewChipID('N', 'V'):
return ATI_CHIP_RV350;
case NewChipID('N', 'J'):
return ATI_CHIP_R360;
case NewChipID('H', 'D'):
return ATI_CHIP_HDTV;
......
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.24 2003/07/02 17:31:29 martin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.25 2003/10/07 22:47:11 martin Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
......@@ -103,6 +103,7 @@ typedef enum
ATI_CHIP_R300, /* R300 */
ATI_CHIP_RV350, /* RV350 */
ATI_CHIP_R350, /* R350 */
ATI_CHIP_R360, /* R360 */
ATI_CHIP_HDTV /* HDTV */
} ATIChipType;
......
......@@ -19,6 +19,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#include "ati.h"
......@@ -29,6 +32,8 @@
#include "atioption.h"
#include "atistruct.h"
#include "mach64_common.h"
/*
* Non-publicised XF86Config options.
*/
......@@ -109,6 +114,17 @@ ATIProcessOptions
#endif /* AVOID_CPIO */
#ifdef XF86DRI
# define IsPCI PublicOption[ATI_OPTION_IS_PCI].value.bool
# define DMAMode PublicOption[ATI_OPTION_DMA_MODE].value.str
# define AGPMode PublicOption[ATI_OPTION_AGP_MODE].value.num
# define AGPSize PublicOption[ATI_OPTION_AGP_SIZE].value.num
# define LocalTex PublicOption[ATI_OPTION_LOCAL_TEXTURES].value.bool
# define BufferSize PublicOption[ATI_OPTION_BUFFER_SIZE].value.num
#endif /* XF86DRI */
# define CacheMMIO PublicOption[ATI_OPTION_MMIO_CACHE].value.bool
# define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.bool
# define PanelDisplay PublicOption[ATI_OPTION_PANEL_DISPLAY].value.bool
......@@ -155,6 +171,7 @@ ATIProcessOptions
}
Blend = PanelDisplay = TRUE;
DMAMode = "mmio";
xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
PublicOption);
......@@ -200,6 +217,32 @@ ATIProcessOptions
else
pATI->OptionPanelDisplay = !CRTScreen;
#ifdef XF86DRI
pATI->OptionIsPCI = IsPCI;
pATI->OptionAGPMode = AGPMode;
pATI->OptionAGPSize = AGPSize;
pATI->OptionLocalTextures = LocalTex;
pATI->OptionBufferSize = BufferSize;
if (strcasecmp(DMAMode, "async")==0)
pATI->OptionDMAMode = MACH64_MODE_DMA_ASYNC;
else if (strcasecmp(DMAMode, "sync")==0)
pATI->OptionDMAMode = MACH64_MODE_DMA_SYNC;
else if (strcasecmp(DMAMode, "mmio")==0 )
pATI->OptionDMAMode = MACH64_MODE_MMIO;
else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unkown dma_mode: '%s'\n", DMAMode);
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Valid dma_mode options are: 'async','sync','mmio'\n");
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Defaulting to async DMA mode\n");
pATI->OptionDMAMode = MACH64_MODE_DMA_ASYNC;
}
#endif /* XF86DRI */
/* Validate and set cursor options */
pATI->Cursor = ATI_CURSOR_SOFTWARE;
if (SWCursor || !HWCursor)
......
......@@ -19,19 +19,29 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* DRI support by:
* Manuel Teira
* Leif Delgass <ldelgass@retinalburn.net>
*/
#include "ati.h"
#include "atiadapter.h"
#include "aticonsole.h"
#include "aticrtc.h"
#include "atii2c.h"
#include "atilock.h"
#include "atimach64.h"
#include "atimach64io.h"
#include "atimode.h"
#include "atistruct.h"
#include "ativga.h"
#include "atividmem.h"
#include "mach64_common.h"
#include "xf86.h"
/*
......@@ -242,7 +252,28 @@ ATISwitchMode
if (pScreenInfo->vtSema)
{
pScreenInfo->currentMode = pMode;
#ifdef XF86DRI
if (pATI->directRenderingEnabled)
{
DRILock(pScreenInfo->pScreen,0);
ATIDRIWaitForIdle(pATI);
}
#endif /* XF86DRI */
ATIModeSet(pScreenInfo, pATI, &pATI->NewHW);
#ifdef XF86DRI
if (pATI->directRenderingEnabled)
{
DRIUnlock(pScreenInfo->pScreen);
}
#endif /* XF86DRI */
}
SetTimeSinceLastInputEvent();
......@@ -274,7 +305,19 @@ ATIEnterVT
/* The rest of this isn't needed for shadowfb */
if (pATI->OptionShadowFB)
{
#ifdef XF86DRI
if (pATI->directRenderingEnabled)
{
DRIUnlock(pScreen);
}
#endif /* XF86DRI */
return TRUE;
}
#ifndef AVOID_CPIO
......@@ -299,6 +342,15 @@ ATIEnterVT
pScreenPixmap->devPrivate.ptr = NULL;
}
#ifdef XF86DRI
if (pATI->directRenderingEnabled)
{
DRIUnlock(pScreen);
}
#endif /* XF86DRI */
return Entered;
}
......@@ -316,6 +368,18 @@ ATILeaveVT
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ScreenPtr pScreen = pScreenInfo->pScreen;
ATIPtr pATI = ATIPTR(pScreenInfo);
#ifdef XF86DRI
if (pATI->directRenderingEnabled)
{
<