summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Dergachev <volodya@mindspring.com>2004-12-12 16:05:35 +0000
committerVladimir Dergachev <volodya@mindspring.com>2004-12-12 16:05:35 +0000
commit36b92808e4ff1311f91543388c18cbe8e9eb4aab (patch)
tree6db8c8aa8db6cc665e44d832629170e6a4b58d98
parent68ea67ce98b8f3ad4c17f987e0e2b92f79a96fbf (diff)
Modified:
programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h Add R300 (and later) DRM support, protected by X_R300_DRM option. Note: at the moment this is for 2d support only, if enabled running glxgears locks up my machine, but DMAForXv=yes works fine.
-rw-r--r--src/radeon_accel.c25
-rw-r--r--src/radeon_common.h5
-rw-r--r--src/radeon_dri.c16
-rw-r--r--src/radeon_driver.c22
-rw-r--r--src/radeon_version.h5
5 files changed, 62 insertions, 11 deletions
diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index ca7124b1..028f2727 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -168,6 +168,31 @@ void RADEONEngineReset(ScrnInfoPtr pScrn)
CARD32 rbbm_soft_reset;
CARD32 host_path_cntl;
+ /* The following RBBM_SOFT_RESET sequence can help un-wedge
+ * an R300 after the command processor got stuck.
+ */
+ rbbm_soft_reset = INREG(RADEON_RBBM_SOFT_RESET);
+ OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset |
+ RADEON_SOFT_RESET_CP |
+ RADEON_SOFT_RESET_HI |
+ RADEON_SOFT_RESET_SE |
+ RADEON_SOFT_RESET_RE |
+ RADEON_SOFT_RESET_PP |
+ RADEON_SOFT_RESET_E2 |
+ RADEON_SOFT_RESET_RB));
+ INREG(RADEON_RBBM_SOFT_RESET);
+ OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset & (CARD32)
+ ~(RADEON_SOFT_RESET_CP |
+ RADEON_SOFT_RESET_HI |
+ RADEON_SOFT_RESET_SE |
+ RADEON_SOFT_RESET_RE |
+ RADEON_SOFT_RESET_PP |
+ RADEON_SOFT_RESET_E2 |
+ RADEON_SOFT_RESET_RB)));
+ INREG(RADEON_RBBM_SOFT_RESET);
+ OUTREG(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset);
+ INREG(RADEON_RBBM_SOFT_RESET);
+
RADEONEngineFlush(pScrn);
clock_cntl_index = INREG(RADEON_CLOCK_CNTL_INDEX);
diff --git a/src/radeon_common.h b/src/radeon_common.h
index 994f5bb2..3fabc1ed 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.2 2004/04/23 19:26:46 eich Exp $
+ * $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.3 2004/06/16 09:43:58 anholt Exp $
* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_common.h,v 1.8tsi Exp $
*
*/
@@ -93,7 +93,8 @@ typedef struct {
enum {
DRM_RADEON_INIT_CP = 0x01,
DRM_RADEON_CLEANUP_CP = 0x02,
- DRM_RADEON_INIT_R200_CP = 0x03
+ DRM_RADEON_INIT_R200_CP = 0x03,
+ DRM_RADEON_INIT_R300_CP = 0x04
} func;
unsigned long sarea_priv_offset;
int is_pci;
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index c32ab18c..e99a6fe4 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1024,7 +1024,11 @@ static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
drmRadeonInit drmInfo;
memset(&drmInfo, 0, sizeof(drmRadeonInit));
-
+ if ( (info->ChipFamily == CHIP_FAMILY_R300) ||
+ (info->ChipFamily == CHIP_FAMILY_R350) ||
+ (info->ChipFamily == CHIP_FAMILY_RV350) )
+ drmInfo.func = DRM_RADEON_INIT_R300_CP;
+ else
if ( info->ChipFamily >= CHIP_FAMILY_R200 )
drmInfo.func = DRM_RADEON_INIT_R200_CP;
else
@@ -1238,7 +1242,12 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
if ( info->ChipFamily >= CHIP_FAMILY_R200 )
pDRIInfo->clientDriverName = R200_DRIVER_NAME;
- else
+ else
+ if ( (info->ChipFamily == CHIP_FAMILY_R300) ||
+ (info->ChipFamily == CHIP_FAMILY_R350) ||
+ (info->ChipFamily == CHIP_FAMILY_RV350) ) {
+ pDRIInfo->clientDriverName = R300_DRIVER_NAME;
+ } else
pDRIInfo->clientDriverName = RADEON_DRIVER_NAME;
if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
@@ -1371,6 +1380,9 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
} else if (info->ChipFamily >= CHIP_FAMILY_R200) {
req_minor = 5;
req_patch = 0;
+ } else if (info->ChipFamily >= CHIP_FAMILY_R300) {
+ req_minor = 12;
+ req_patch = 0;
} else {
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
req_minor = 1;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index faed1523..ba9f4c1c 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -142,6 +142,7 @@ typedef enum {
OPTION_PAGE_FLIP,
OPTION_NO_BACKBUFFER,
OPTION_XV_DMA,
+ OPTION_R300_DRM,
#endif
OPTION_PANEL_OFF,
OPTION_DDC_MODE,
@@ -195,6 +196,7 @@ static const OptionInfoRec RADEONOptions[] = {
{ OPTION_PAGE_FLIP, "EnablePageFlip", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NO_BACKBUFFER, "NoBackBuffer", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_XV_DMA, "DMAForXv", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_R300_DRM, "X_R300_DRM", OPTV_BOOLEAN, {0}, FALSE },
#endif
{ OPTION_PANEL_OFF, "PanelOff", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DDC_MODE, "DDCMode", OPTV_BOOLEAN, {0}, FALSE },
@@ -4709,11 +4711,21 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
(pScrn->displayWidth * pScrn->virtualY *
info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024);
info->directRenderingEnabled = FALSE;
- } else if (info->ChipFamily >= CHIP_FAMILY_R300) {
- info->directRenderingEnabled = FALSE;
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Direct rendering not yet supported on "
- "Radeon 9500 and newer cards\n");
+ } else if (info->ChipFamily >= CHIP_FAMILY_R300) {
+ if ( xf86ReturnOptValBool(info->Options, OPTION_R300_DRM, FALSE) ) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Direct rendering support is highly experimental for "
+ "Radeon 9500/9700 and newer cards\n"
+ "\t\tIn fact, the only thing you could probably use it for is better 2d acceleration.\n"
+ );
+ info->directRenderingEnabled = RADEONDRIScreenInit(pScreen);
+ } else {
+ info->directRenderingEnabled = FALSE;
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Direct rendering is not yet supported on "
+ "Radeon 9500 and newer cards. \n"
+ "\t\tTo enable it anyway turn on X_R300_DRM option. Note: this might lockup your computer\n");
+ }
} else if (info->IsSecondary) {
info->directRenderingEnabled = FALSE;
} else if (xf86IsEntityShared(info->pEnt->index)) {
diff --git a/src/radeon_version.h b/src/radeon_version.h
index 264724df..b1bca202 100644
--- a/src/radeon_version.h
+++ b/src/radeon_version.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h,v 1.9 2003/04/06 20:07:34 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h,v 1.10 2003/09/28 20:15:57 alanh Exp $ */
/*
- * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
+ * Copyright 2000 through 2004 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
@@ -38,6 +38,7 @@
#define RADEON_NAME "RADEON"
#define RADEON_DRIVER_NAME "radeon"
#define R200_DRIVER_NAME "r200"
+#define R300_DRIVER_NAME "r300"
#define RADEON_VERSION_MAJOR 4
#define RADEON_VERSION_MINOR 0