From bb226c9e7218d2a65c056fe74cb7eece0550670f Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Feb 2007 21:20:53 +0200 Subject: [mach64] Consolidate adjustments of mode timings, part 1. Move LCD block from atimode.c to atimach64.c . --- src/atimach64.c | 36 ++++++++++++++++++++++++++++++++++++ src/atimode.c | 42 ++---------------------------------------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/src/atimach64.c b/src/atimach64.c index 98eb894..dee82c4 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -594,6 +594,42 @@ ATIMach64Calculate { int VDisplay; + /* Clobber mode timings */ + if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0) && + !pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && + (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) + { + int VScan; + + pMode->Clock = pATI->LCDClock; + pMode->Flags &= ~(V_DBLSCAN | V_INTERLACE | V_CLKDIV2); + + /* + * Use doublescanning or multiscanning to get around vertical blending + * limitations. + */ + VScan = pATI->LCDVertical / pMode->VDisplay; + { + pMode->VScan = 0; + if (VScan > 1) + { + VScan = 2; + pMode->Flags |= V_DBLSCAN; + } + } + + pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart; + pMode->HSyncEnd = pMode->HSyncStart + pATI->LCDHSyncWidth; + pMode->HTotal = pMode->HDisplay + pATI->LCDHBlankWidth; + + pMode->VSyncStart = pMode->VDisplay + + ATIDivide(pATI->LCDVSyncStart, VScan, 0, 0); + pMode->VSyncEnd = pMode->VSyncStart + + ATIDivide(pATI->LCDVSyncWidth, VScan, 0, 1); + pMode->VTotal = pMode->VDisplay + + ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0); + } + /* If not already done adjust horizontal timings */ if (!pMode->CrtcHAdjusted) { diff --git a/src/atimode.c b/src/atimode.c index d455404..68c1342 100644 --- a/src/atimode.c +++ b/src/atimode.c @@ -528,46 +528,8 @@ ATIModeCalculate CARD32 lcd_index; int Index, ECPClock, MaxScalerClock; - /* Clobber mode timings */ - if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0) && - !pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && - (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) - { - int VScan; - - pMode->Clock = pATI->LCDClock; - pMode->Flags &= ~(V_DBLSCAN | V_INTERLACE | V_CLKDIV2); - - /* - * Use doublescanning or multiscanning to get around vertical blending - * limitations. - */ - VScan = pATI->LCDVertical / pMode->VDisplay; - { - pMode->VScan = 0; - if (VScan > 1) - { - VScan = 2; - pMode->Flags |= V_DBLSCAN; - } - } - - pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart; - pMode->HSyncEnd = pMode->HSyncStart + pATI->LCDHSyncWidth; - pMode->HTotal = pMode->HDisplay + pATI->LCDHBlankWidth; - - pMode->VSyncStart = pMode->VDisplay + - ATIDivide(pATI->LCDVSyncStart, VScan, 0, 0); - pMode->VSyncEnd = pMode->VSyncStart + - ATIDivide(pATI->LCDVSyncWidth, VScan, 0, 1); - pMode->VTotal = pMode->VDisplay + - ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0); - } - - { - /* Fill in Mach64 data */ - ATIMach64Calculate(pATI, pATIHW, pMode); - } + /* Fill in Mach64 data */ + ATIMach64Calculate(pATI, pATIHW, pMode); /* Set up LCD register values */ if (pATI->LCDPanelID >= 0) -- cgit v1.2.3 From 8b9a4ec8af90b2f9f0d0a3a7f6627061df7e01b3 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Feb 2007 21:22:49 +0200 Subject: [mach64] Consolidate adjustments of mode timings, part 2. Factor out to seperate function. --- src/atimach64.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/atimach64.c b/src/atimach64.c index dee82c4..e740003 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -580,12 +580,12 @@ ATIMach64Save } /* - * ATIMach64Calculate -- + * ATIMach64ModeAdjust -- * - * This function is called to fill in the Mach64 portion of an ATIHWRec. + * This function is called to adjust horizontal and vertical timings. */ -void -ATIMach64Calculate +static void +ATIMach64ModeAdjust ( ATIPtr pATI, ATIHWPtr pATIHW, @@ -711,6 +711,22 @@ ATIMach64Calculate (int)MaxBits(CRTC_V_SYNC_WID)) pMode->CrtcVSyncEnd = pMode->CrtcVSyncStart + MaxBits(CRTC_V_SYNC_WID); pMode->CrtcVAdjusted = TRUE; /* Redundant */ +} + +/* + * ATIMach64Calculate -- + * + * This function is called to fill in the Mach64 portion of an ATIHWRec. + */ +void +ATIMach64Calculate +( + ATIPtr pATI, + ATIHWPtr pATIHW, + DisplayModePtr pMode +) +{ + ATIMach64ModeAdjust(pATI, pATIHW, pMode); /* Build register contents */ pATIHW->crtc_h_total_disp = -- cgit v1.2.3 From 4374895d393bf170134ccffc188521fe515d5a77 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Feb 2007 21:25:13 +0200 Subject: [mach64] Consolidate adjustments of mode timings, part 3. Cosmetic. --- src/atimach64.c | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/src/atimach64.c b/src/atimach64.c index e740003..c7b0ecc 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -82,12 +82,6 @@ ATIMach64PreInit ATIHWPtr pATIHW ) { - CARD32 bus_cntl, config_cntl; - - { - pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH); - } - if ((pATI->LockData.crtc_gen_cntl & CRTC_CSYNC_EN) && !pATI->OptionCSync) { xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE, @@ -95,7 +89,7 @@ ATIMach64PreInit pATI->OptionCSync = TRUE; } - pATIHW->bus_cntl = bus_cntl = inr(BUS_CNTL); + pATIHW->bus_cntl = inr(BUS_CNTL); if (pATI->Chip < ATI_CHIP_264VT4) pATIHW->bus_cntl = (pATIHW->bus_cntl & ~BUS_HOST_ERR_INT_EN) | BUS_HOST_ERR_INT; @@ -142,7 +136,7 @@ ATIMach64PreInit if (pATI->DAC == ATI_DAC_IBMRGB514) pATIHW->gen_test_cntl |= GEN_OVR_OUTPUT_EN; - pATIHW->config_cntl = config_cntl = inr(CONFIG_CNTL); + pATIHW->config_cntl = inr(CONFIG_CNTL); #ifndef AVOID_CPIO @@ -212,6 +206,9 @@ ATIMach64PreInit /* Draw engine setup */ if (pATI->Block0Base) { + CARD32 bus_cntl = inr(BUS_CNTL); + CARD32 config_cntl = inr(CONFIG_CNTL); + /* Ensure apertures are enabled */ outr(BUS_CNTL, pATIHW->bus_cntl); outr(CONFIG_CNTL, pATIHW->config_cntl); @@ -595,27 +592,27 @@ ATIMach64ModeAdjust int VDisplay; /* Clobber mode timings */ - if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0) && - !pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && - (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) + if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0)) { + if (!pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && + (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) + { int VScan; pMode->Clock = pATI->LCDClock; pMode->Flags &= ~(V_DBLSCAN | V_INTERLACE | V_CLKDIV2); + pMode->VScan = 0; + /* * Use doublescanning or multiscanning to get around vertical blending * limitations. */ VScan = pATI->LCDVertical / pMode->VDisplay; + if (VScan > 1) { - pMode->VScan = 0; - if (VScan > 1) - { - VScan = 2; - pMode->Flags |= V_DBLSCAN; - } + VScan = 2; + pMode->Flags |= V_DBLSCAN; } pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart; @@ -628,6 +625,7 @@ ATIMach64ModeAdjust ATIDivide(pATI->LCDVSyncWidth, VScan, 0, 1); pMode->VTotal = pMode->VDisplay + ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0); + } } /* If not already done adjust horizontal timings */ @@ -731,27 +729,28 @@ ATIMach64Calculate /* Build register contents */ pATIHW->crtc_h_total_disp = SetBits(pMode->CrtcHTotal, CRTC_H_TOTAL) | - SetBits(pMode->CrtcHDisplay, CRTC_H_DISP); + SetBits(pMode->CrtcHDisplay, CRTC_H_DISP); + pATIHW->crtc_h_sync_strt_wid = SetBits(pMode->CrtcHSyncStart, CRTC_H_SYNC_STRT) | - SetBits(pMode->CrtcHSkew, CRTC_H_SYNC_DLY) | /* ? */ - SetBits(GetBits(pMode->CrtcHSyncStart, 0x0100U), - CRTC_H_SYNC_STRT_HI) | - SetBits(pMode->CrtcHSyncEnd - pMode->CrtcHSyncStart, - CRTC_H_SYNC_WID); + SetBits(pMode->CrtcHSkew, CRTC_H_SYNC_DLY) | /* ? */ + SetBits(GetBits(pMode->CrtcHSyncStart, 0x0100U), CRTC_H_SYNC_STRT_HI) | + SetBits(pMode->CrtcHSyncEnd - pMode->CrtcHSyncStart, CRTC_H_SYNC_WID); if (pMode->Flags & V_NHSYNC) pATIHW->crtc_h_sync_strt_wid |= CRTC_H_SYNC_POL; pATIHW->crtc_v_total_disp = SetBits(pMode->CrtcVTotal, CRTC_V_TOTAL) | - SetBits(pMode->CrtcVDisplay, CRTC_V_DISP); + SetBits(pMode->CrtcVDisplay, CRTC_V_DISP); + pATIHW->crtc_v_sync_strt_wid = SetBits(pMode->CrtcVSyncStart, CRTC_V_SYNC_STRT) | - SetBits(pMode->CrtcVSyncEnd - pMode->CrtcVSyncStart, - CRTC_V_SYNC_WID); + SetBits(pMode->CrtcVSyncEnd - pMode->CrtcVSyncStart, CRTC_V_SYNC_WID); if (pMode->Flags & V_NVSYNC) pATIHW->crtc_v_sync_strt_wid |= CRTC_V_SYNC_POL; + pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH); + pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL) & ~(CRTC_DBL_SCAN_EN | CRTC_INTERLACE_EN | CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_CSYNC_EN | -- cgit v1.2.3 From e1e55b533d3ae528c8da37dcb77ed906d05697fb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 4 Mar 2007 19:11:34 +1100 Subject: radeon: add option to set pci aperture size from config file This requires a drm > 1.26 to work --- src/radeon.h | 3 +++ src/radeon_common.h | 1 + src/radeon_dri.c | 34 +++++++++++++++++++++++++- src/radeon_dri.h | 2 +- src/radeon_driver.c | 69 ++++++++++++++++++++++++++++------------------------- src/radeon_exa.c | 2 +- 6 files changed, 76 insertions(+), 35 deletions(-) diff --git a/src/radeon.h b/src/radeon.h index 37ca67d..c976b0a 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -110,6 +110,7 @@ typedef enum { OPTION_XV_DMA, OPTION_FBTEX_PERCENT, OPTION_DEPTH_BITS, + OPTION_PCIAPER_SIZE, #ifdef USE_EXA OPTION_ACCEL_DFS, #endif @@ -607,6 +608,7 @@ typedef struct { #endif Bool have3DWindows; /* Are there any 3d clients? */ + unsigned int pciAperSize; drmSize gartSize; drm_handle_t agpMemHandle; /* Handle from drmAgpAlloc */ unsigned long gartOffset; @@ -832,6 +834,7 @@ extern RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn); extern void RADEONWaitForFifoFunction(ScrnInfoPtr pScrn, int entries); extern void RADEONWaitForIdleMMIO(ScrnInfoPtr pScrn); #ifdef XF86DRI +extern int RADEONDRISetParam(ScrnInfoPtr pScrn, unsigned int param, int64_t value); extern void RADEONWaitForIdleCP(ScrnInfoPtr pScrn); #endif diff --git a/src/radeon_common.h b/src/radeon_common.h index be6dc8f..3f2c6ab 100644 --- a/src/radeon_common.h +++ b/src/radeon_common.h @@ -472,6 +472,7 @@ typedef struct drm_radeon_set_param { #define RADEON_SETPARAM_SWITCH_TILING 2 #define RADEON_SETPARAM_PCIGART_LOCATION 3 #define RADEON_SETPARAM_NEW_MEMMAP 4 +#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* 1.14: Clients can allocate/free a surface */ diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 39c72db..ee6192e 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -2078,7 +2078,11 @@ void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen) if (info->FbSecureSize==0) return; - info->pciGartSize = RADEON_PCIGART_TABLE_SIZE; + /* set the old default size of pci gart table */ + if (info->pKernelDRMVersion->version_minor < 26) + info->pciGartSize = 32768; + + info->pciGartSize = RADEONDRIGetPciAperTableSize(pScrn); /* allocate space to back up PCIEGART table */ info->pciGartBackup = xnfcalloc(1, info->pciGartSize); @@ -2089,3 +2093,31 @@ void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen) } + +int RADEONDRIGetPciAperTableSize(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + int page_size = getpagesize(); + int ret_size; + int num_pages; + + num_pages = (info->pciAperSize * 1024 * 1024) / page_size; + + ret_size = num_pages * sizeof(unsigned int); + + return ret_size; +} + +int RADEONDRISetParam(ScrnInfoPtr pScrn, unsigned int param, int64_t value) +{ + drmRadeonSetParam radeonsetparam; + RADEONInfoPtr info = RADEONPTR(pScrn); + int ret; + + memset(&radeonsetparam, 0, sizeof(drmRadeonSetParam)); + radeonsetparam.param = param; + radeonsetparam.value = value; + ret = drmCommandWrite(info->drmFD, DRM_RADEON_SETPARAM, + &radeonsetparam, sizeof(drmRadeonSetParam)); + return ret; +} diff --git a/src/radeon_dri.h b/src/radeon_dri.h index 6fa7e35..3b54626 100644 --- a/src/radeon_dri.h +++ b/src/radeon_dri.h @@ -48,7 +48,7 @@ #define RADEON_DEFAULT_CP_TIMEOUT 10000 /* usecs */ -#define RADEON_PCIGART_TABLE_SIZE 32768 +#define RADEON_DEFAULT_PCI_APER_SIZE 32 /* in MB */ #define RADEON_CARD_TYPE_RADEON 1 diff --git a/src/radeon_driver.c b/src/radeon_driver.c index d1cd790..ca0b201 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -153,6 +153,7 @@ static const OptionInfoRec RADEONOptions[] = { { OPTION_XV_DMA, "DMAForXv", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FBTEX_PERCENT, "FBTexPercent", OPTV_INTEGER, {0}, FALSE }, { OPTION_DEPTH_BITS, "DepthBits", OPTV_INTEGER, {0}, FALSE }, + { OPTION_PCIAPER_SIZE, "PCIAPERSize", OPTV_INTEGER, {0}, FALSE }, #ifdef USE_EXA { OPTION_ACCEL_DFS, "AccelDFS", OPTV_BOOLEAN, {0}, FALSE }, #endif @@ -1482,7 +1483,8 @@ static Bool RADEONPreInitVRAM(ScrnInfoPtr pScrn) /* if the card is PCI Express reserve the last 32k for the gart table */ #ifdef XF86DRI if (info->cardType == CARD_PCIE && info->directRenderingEnabled) - info->FbSecureSize = RADEON_PCIGART_TABLE_SIZE; + /* work out the size of pcie aperture */ + info->FbSecureSize = RADEONDRIGetPciAperTableSize(pScrn); else #endif info->FbSecureSize = 0; @@ -2573,7 +2575,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) info->ringSize = RADEON_DEFAULT_RING_SIZE; info->bufSize = RADEON_DEFAULT_BUFFER_SIZE; info->gartTexSize = RADEON_DEFAULT_GART_TEX_SIZE; - + info->pciAperSize = RADEON_DEFAULT_PCI_APER_SIZE; info->CPusecTimeout = RADEON_DEFAULT_CP_TIMEOUT; if ((xf86GetOptValInteger(info->Options, @@ -2607,6 +2609,23 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) } } + if (xf86GetOptValInteger(info->Options, + OPTION_PCIAPER_SIZE, &(info->pciAperSize))) { + switch(info->pciAperSize) { + case 32: + case 64: + case 128: + case 256: + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Illegal pci aper size: %d MB\n", + info->pciAperSize); + return FALSE; + } + } + + if (xf86GetOptValInteger(info->Options, OPTION_BUFFER_SIZE, &(info->bufSize))) { if (info->bufSize < 1 || info->bufSize >= (int)info->gartSize) { @@ -3973,21 +3992,17 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, } } +#if defined(XF86DRI) /* Tell DRI about new memory map */ if (info->directRenderingEnabled && info->newMemoryMap) { - drmRadeonSetParam radeonsetparam; - RADEONTRACE(("DRI New memory map param\n")); - memset(&radeonsetparam, 0, sizeof(drmRadeonSetParam)); - radeonsetparam.param = RADEON_SETPARAM_NEW_MEMMAP; - radeonsetparam.value = 1; - if (drmCommandWrite(info->drmFD, DRM_RADEON_SETPARAM, - &radeonsetparam, sizeof(drmRadeonSetParam)) < 0) { + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_NEW_MEMMAP, 1) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] failed to enable new memory map\n"); RADEONDRICloseScreen(pScreen); info->directRenderingEnabled = FALSE; } } +#endif RADEONTRACE(("Initializing fb layer\n")); /* Init fb layer */ @@ -4065,15 +4080,15 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, if (info->directRenderingEnabled && info->cardType==CARD_PCIE && info->pKernelDRMVersion->version_minor >= 19) { - drmRadeonSetParam radeonsetparam; - RADEONTRACE(("DRI PCIGART param\n")); - memset(&radeonsetparam, 0, sizeof(drmRadeonSetParam)); - radeonsetparam.param = RADEON_SETPARAM_PCIGART_LOCATION; - radeonsetparam.value = info->pciGartOffset; - if (drmCommandWrite(info->drmFD, DRM_RADEON_SETPARAM, - &radeonsetparam, sizeof(drmRadeonSetParam)) < 0) + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_PCIGART_LOCATION, info->pciGartOffset) < 0) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[drm] failed set pci gart location\n"); + + if (info->pKernelDRMVersion->version_minor >= 26) { + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_PCIGART_TABLE_SIZE, info->pciGartSize) < 0) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] failed set pci gart table size\n"); + } } if (info->directRenderingEnabled) { RADEONTRACE(("DRI Finishing init !\n")); @@ -4094,14 +4109,9 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, /* we might already be in tiled mode, tell drm about it */ if (info->directRenderingEnabled && info->tilingEnabled) { - drmRadeonSetParam radeonsetparam; - memset(&radeonsetparam, 0, sizeof(drmRadeonSetParam)); - radeonsetparam.param = RADEON_SETPARAM_SWITCH_TILING; - radeonsetparam.value = info->tilingEnabled ? 1 : 0; - if (drmCommandWrite(info->drmFD, DRM_RADEON_SETPARAM, - &radeonsetparam, sizeof(drmRadeonSetParam)) < 0) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "[drm] failed changing tiling status\n"); + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] failed changing tiling status\n"); } } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -6542,14 +6552,9 @@ _X_EXPORT Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) #ifdef XF86DRI if (info->directRenderingEnabled && (info->tilingEnabled != tilingOld)) { RADEONSAREAPrivPtr pSAREAPriv; - drmRadeonSetParam radeonsetparam; - memset(&radeonsetparam, 0, sizeof(drmRadeonSetParam)); - radeonsetparam.param = RADEON_SETPARAM_SWITCH_TILING; - radeonsetparam.value = info->tilingEnabled ? 1 : 0; - if (drmCommandWrite(info->drmFD, DRM_RADEON_SETPARAM, - &radeonsetparam, sizeof(drmRadeonSetParam)) < 0) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "[drm] failed changing tiling status\n"); + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] failed changing tiling status\n"); pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); info->tilingEnabled = pSAREAPriv->tiling_enabled ? TRUE : FALSE; } diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 8dd13f2..f9bcace 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -430,7 +430,7 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) if (info->cardType==CARD_PCIE) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Will use %d kb for PCI GART at offset 0x%08x\n", - RADEON_PCIGART_TABLE_SIZE / 1024, + info->pciGartSize / 1024, (int)info->pciGartOffset); /* Reserve a static area for the back buffer the same size as the -- cgit v1.2.3 From 54f9b8c1d01ecb97e2d4d247918f0efc86ed6037 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sun, 4 Mar 2007 18:16:40 +0200 Subject: [mach64] Xv: use single surface and encoding structs. --- src/atimach64xv.c | 111 ++++++++++++------------------------------------------ 1 file changed, 24 insertions(+), 87 deletions(-) diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 5df903b..844f08d 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -41,20 +41,11 @@ static unsigned long ATIMach64XVAtomGeneration = (unsigned long)(-1); -static XF86VideoEncodingRec ATIMach64VideoEncoding_A[] = -{ - { 0, "XV_IMAGE", 384, 2048, {1, 1} } -}; -#define nATIMach64VideoEncoding_A NumberOf(ATIMach64VideoEncoding_A) - -static XF86VideoEncodingRec ATIMach64VideoEncoding_B[] = +static XF86VideoEncodingRec ATIMach64VideoEncoding[] = { { 0, "XV_IMAGE", 720, 2048, {1, 1} } }; -#define nATIMach64VideoEncoding_B NumberOf(ATIMach64VideoEncoding_B) - -/* nATIMach64VideoEncoding_[AB] should be equal */ -#define nATIMach64VideoEncoding nATIMach64VideoEncoding_A +#define nATIMach64VideoEncoding NumberOf(ATIMach64VideoEncoding) static XF86VideoFormatRec ATIMach64VideoFormat[] = { @@ -1306,69 +1297,7 @@ ATIMach64SetSurfaceAttribute } /* XVideo surface registration data */ -static XF86OffscreenImageRec ATIMach64Surface_A[] = -{ - { - &ATIMach64Image[0], /* YUY2 */ - VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, - ATIMach64AllocateSurface, - ATIMach64FreeSurface, - ATIMach64DisplaySurface, - ATIMach64StopSurface, - ATIMach64GetSurfaceAttribute, - ATIMach64SetSurfaceAttribute, - 384, 2048, - nATIMach64Attribute - 5, /* No double-buffering */ - ATIMach64Attribute + 4 /* No saturation nor brightness */ - }, - { - &ATIMach64Image[1], /* UYVY */ - VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, - ATIMach64AllocateSurface, - ATIMach64FreeSurface, - ATIMach64DisplaySurface, - ATIMach64StopSurface, - ATIMach64GetSurfaceAttribute, - ATIMach64SetSurfaceAttribute, - 384, 2048, - nATIMach64Attribute - 5, /* No double-buffering */ - ATIMach64Attribute + 4 /* No saturation nor brightness */ - } -}; -#define nATIMach64Surface_A NumberOf(ATIMach64Surface_A) - -static XF86OffscreenImageRec ATIMach64Surface_B[] = -{ - { - &ATIMach64Image[0], /* YUY2 */ - VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, - ATIMach64AllocateSurface, - ATIMach64FreeSurface, - ATIMach64DisplaySurface, - ATIMach64StopSurface, - ATIMach64GetSurfaceAttribute, - ATIMach64SetSurfaceAttribute, - 720, 2048, - nATIMach64Attribute - 5, /* No double-buffering */ - ATIMach64Attribute + 4 /* No saturation nor brightness */ - }, - { - &ATIMach64Image[1], /* UYVY */ - VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT, - ATIMach64AllocateSurface, - ATIMach64FreeSurface, - ATIMach64DisplaySurface, - ATIMach64StopSurface, - ATIMach64GetSurfaceAttribute, - ATIMach64SetSurfaceAttribute, - 720, 2048, - nATIMach64Attribute - 5, /* No double-buffering */ - ATIMach64Attribute + 4 /* No saturation nor brightness */ - } -}; -#define nATIMach64Surface_B NumberOf(ATIMach64Surface_B) - -static XF86OffscreenImageRec ATIMach64Surface_C[] = +static XF86OffscreenImageRec ATIMach64Surface[] = { { &ATIMach64Image[0], /* YUY2 */ @@ -1397,7 +1326,7 @@ static XF86OffscreenImageRec ATIMach64Surface_C[] = ATIMach64Attribute } }; -#define nATIMach64Surface_C NumberOf(ATIMach64Surface_C) +#define nATIMach64Surface NumberOf(ATIMach64Surface) /* * ATIMach64XVInitialiseAdaptor -- @@ -1418,6 +1347,10 @@ ATIMach64XVInitialiseAdaptor XF86VideoAdaptorPtr pAdaptor; int Index; + XF86VideoEncodingPtr enc = &(ATIMach64VideoEncoding[0]); + XF86OffscreenImagePtr surf0 = &(ATIMach64Surface[0]); + XF86OffscreenImagePtr surf1 = &(ATIMach64Surface[1]); + if (pppAdaptor) *pppAdaptor = NULL; @@ -1440,14 +1373,14 @@ ATIMach64XVInitialiseAdaptor if (pATI->Chip < ATI_CHIP_264VTB) { - pAdaptor->nEncodings = nATIMach64VideoEncoding_A; - pAdaptor->pEncodings = ATIMach64VideoEncoding_A; + enc->width = 384; } else { - pAdaptor->nEncodings = nATIMach64VideoEncoding_B; - pAdaptor->pEncodings = ATIMach64VideoEncoding_B; + /* Do nothing */ } + pAdaptor->nEncodings = nATIMach64VideoEncoding; + pAdaptor->pEncodings = ATIMach64VideoEncoding; pAdaptor->nFormats = nATIMach64VideoFormat; pAdaptor->pFormats = ATIMach64VideoFormat; @@ -1490,19 +1423,23 @@ ATIMach64XVInitialiseAdaptor if (pATI->Chip < ATI_CHIP_264VTB) { - xf86XVRegisterOffscreenImages(pScreen, - ATIMach64Surface_A, nATIMach64Surface_A); + surf0->max_width = 384; + surf1->max_width = 384; } - else if (pATI->Chip < ATI_CHIP_264GTPRO) + else { - xf86XVRegisterOffscreenImages(pScreen, - ATIMach64Surface_B, nATIMach64Surface_B); + /* Do nothing */ } - else + + if (pATI->Chip < ATI_CHIP_264GTPRO) { - xf86XVRegisterOffscreenImages(pScreen, - ATIMach64Surface_C, nATIMach64Surface_C); + /* No saturation nor brightness */ + surf0->num_attributes -= 4; + surf1->num_attributes -= 4; + surf0->attributes += 4; + surf1->attributes += 4; } + xf86XVRegisterOffscreenImages(pScreen, ATIMach64Surface, nATIMach64Surface); if (pppAdaptor) *pppAdaptor = ppAdaptor; -- cgit v1.2.3 From 1e270b411cf691c69194932b864ee2c9db292263 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sun, 4 Mar 2007 18:21:49 +0200 Subject: [mach64] Bug 5586: overlay scaler limited to 720 pixels on ATI Rage Pro. --- src/atimach64xv.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 844f08d..997fa69 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -765,8 +765,10 @@ ATIMach64ClipVideo CARD32 HScale, VScale; /* Check hardware limits */ - if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 720) || - ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB))) + if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 768) || + ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)) || + ((Width > 720) && (pATI->Chip < ATI_CHIP_264GTPRO || + pATI->Chip > ATI_CHIP_264LTPRO))) return FALSE; ATIMach64ScaleVideo(pATI, pScreenInfo->currentMode, @@ -1132,8 +1134,10 @@ ATIMach64AllocateSurface if (pATI->ActiveSurface) return BadAlloc; - if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 720) || - ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB))) + if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 768) || + ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)) || + ((Width > 720) && (pATI->Chip < ATI_CHIP_264GTPRO || + pATI->Chip > ATI_CHIP_264LTPRO))) return BadValue; Width = (Width + 1) & ~1; @@ -1375,10 +1379,15 @@ ATIMach64XVInitialiseAdaptor { enc->width = 384; } - else + else if (pATI->Chip < ATI_CHIP_264GTPRO || + pATI->Chip > ATI_CHIP_264LTPRO) { /* Do nothing */ } + else + { + enc->width = 768; + } pAdaptor->nEncodings = nATIMach64VideoEncoding; pAdaptor->pEncodings = ATIMach64VideoEncoding; @@ -1426,10 +1435,16 @@ ATIMach64XVInitialiseAdaptor surf0->max_width = 384; surf1->max_width = 384; } - else + else if (pATI->Chip < ATI_CHIP_264GTPRO || + pATI->Chip > ATI_CHIP_264LTPRO) { /* Do nothing */ } + else + { + surf0->max_width = 768; + surf1->max_width = 768; + } if (pATI->Chip < ATI_CHIP_264GTPRO) { -- cgit v1.2.3 From 52684241ba1ffb393cb655ecc09cbd0cef5b1717 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 8 Mar 2007 07:07:02 +0200 Subject: Move atiprobe.c from ati to atimisc. --- src/Makefile.am | 11 ++- src/ati.c | 96 +++++++++++++++++++++- src/atibus.h | 1 - src/atidga.c | 1 - src/atifillin.c | 1 - src/atifillin.h | 1 - src/atiident.c | 50 ------------ src/atiident.h | 28 ------- src/atimach64probe.c | 175 +++++++++++++++++++++++++++++++++++++++ src/atimach64probe.h | 30 +++++++ src/atipreinit.c | 2 +- src/atiprobe.c | 225 +-------------------------------------------------- src/atiprobe.h | 2 +- 13 files changed, 307 insertions(+), 316 deletions(-) delete mode 100644 src/atiident.c delete mode 100644 src/atiident.h create mode 100644 src/atimach64probe.c create mode 100644 src/atimach64probe.h diff --git a/src/Makefile.am b/src/Makefile.am index f31c018..24f5516 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,8 +33,7 @@ RADEON_DRI_SRCS = radeon_dri.c endif if ATIMISC_CPIO -ATI_CPIO_SOURCES = ativgaio.c -ATIMISC_CPIO_SOURCES = ativga.c atibank.c atiwonder.c atiwonderio.c +ATIMISC_CPIO_SOURCES = ativga.c ativgaio.c atibank.c atiwonder.c atiwonderio.c endif if ATIMISC_DGA @@ -52,14 +51,14 @@ ati_drv_la_LTLIBRARIES = ati_drv.la ati_drv_la_LDFLAGS = -module -avoid-version ati_drv_ladir = @moduledir@/drivers ati_drv_la_SOURCES = \ - ati.c atibus.c atichip.c atiident.c atioption.c \ - atiprobe.c atividmem.c atimodule.c $(ATI_CPIO_SOURCES) \ + ati.c atichip.c atioption.c atimodule.c atimach64probe.c \ radeon_probe.c r128_probe.c atimisc_drv_la_LTLIBRARIES = atimisc_drv.la atimisc_drv_la_LDFLAGS = -module -avoid-version atimisc_drv_ladir = @moduledir@/drivers atimisc_drv_la_SOURCES = \ + atibus.c atiprobe.c atividmem.c \ atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \ atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \ atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ @@ -105,6 +104,7 @@ theatre200_drv_la_SOURCES = \ theatre200.c theatre200_module.c EXTRA_DIST = \ + atimach64render.c \ radeon_render.c \ radeon_accelfuncs.c \ \ @@ -127,14 +127,13 @@ EXTRA_DIST = \ atifillin.h \ ati.h \ atii2c.h \ - atiident.h \ atiload.h \ atilock.h \ atimach64accel.h \ atimach64.h \ atimach64i2c.h \ atimach64io.h \ - atimach64render.c \ + atimach64probe.h \ atimode.h \ atimodule.h \ atioption.h \ diff --git a/src/ati.c b/src/ati.c index d9c7441..4d50aec 100644 --- a/src/ati.c +++ b/src/ati.c @@ -57,10 +57,102 @@ #include "config.h" #endif -#include "atiident.h" +#include "ati.h" +#include "atichip.h" #include "atioption.h" -#include "atiprobe.h" #include "ativersion.h" +#include "atimach64probe.h" + +#include "radeon_probe.h" +#include "radeon_version.h" +#include "r128_probe.h" +#include "r128_version.h" + +/* + * ATIIdentify -- + * + * Print the driver's list of chipset names. + */ +static void +ATIIdentify +( + int flags +) +{ + xf86Msg(X_INFO, "%s: %s\n", ATI_NAME, + "ATI driver (version " ATI_VERSION_NAME ") for chipset: mach64"); + R128Identify(flags); + RADEONIdentify(flags); +} + +/* + * ATIProbe -- + * + * This function is called once, at the start of the first server generation to + * do a minimal probe for supported hardware. + */ +static Bool +ATIProbe +( + DriverPtr pDriver, + int flags +) +{ + pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); + Bool ProbeSuccess = FALSE; + Bool DoMach64 = FALSE; + Bool DoRage128 = FALSE, DoRadeon = FALSE; + int i; + ATIChipType Chip; + + if (!(flags & PROBE_DETECT)) + { + if (xf86MatchDevice(ATI_NAME, NULL) > 0) + DoMach64 = TRUE; + if (xf86MatchDevice(R128_NAME, NULL) > 0) + DoRage128 = TRUE; + if (xf86MatchDevice(RADEON_NAME, NULL) > 0) + DoRadeon = TRUE; + } + + if (xf86PciVideoInfo) + { + for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) + { + if ((pVideo->vendor != PCI_VENDOR_ATI) || + (pVideo->chipType == PCI_CHIP_MACH32)) + continue; + + /* Check for Rage128's, Radeon's and later adapters */ + Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); + if (Chip > ATI_CHIP_Mach64) + { + if (Chip <= ATI_CHIP_Rage128) + DoRage128 = TRUE; + else if (Chip <= ATI_CHIP_Radeon) + DoRadeon = TRUE; + + continue; + } + + DoMach64 = TRUE; + } + } + + /* Call Mach64 driver probe */ + if (DoMach64 && Mach64Probe(pDriver, flags)) + ProbeSuccess = TRUE; + + /* Call Rage 128 driver probe */ + if (DoRage128 && R128Probe(pDriver, flags)) + ProbeSuccess = TRUE; + + /* Call Radeon driver probe */ + if (DoRadeon && RADEONProbe(pDriver, flags)) + ProbeSuccess = TRUE; + + return ProbeSuccess; +} /* The root of all evil... */ _X_EXPORT DriverRec ATI = diff --git a/src/atibus.h b/src/atibus.h index c5c676e..e5f1afd 100644 --- a/src/atibus.h +++ b/src/atibus.h @@ -44,7 +44,6 @@ typedef enum extern const char *ATIBusNames[]; -extern Bool ATIMach64ProbeIO(pciVideoPtr, ATIPtr); extern int ATIClaimBusSlot(Bool, ATIPtr); #endif /* ___ATIBUS_H___ */ diff --git a/src/atidga.c b/src/atidga.c index e6783a4..fb6d1d7 100644 --- a/src/atidga.c +++ b/src/atidga.c @@ -32,7 +32,6 @@ #include "atichip.h" #include "atidac.h" #include "atidga.h" -#include "atiident.h" #include "atimode.h" #include "atistruct.h" diff --git a/src/atifillin.c b/src/atifillin.c index 32e8483..dcbcb3c 100644 --- a/src/atifillin.c +++ b/src/atifillin.c @@ -36,7 +36,6 @@ _X_EXPORT void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo) pScreenInfo->driverVersion = ATI_VERSION_CURRENT; pScreenInfo->driverName = ATI_DRIVER_NAME; pScreenInfo->name = ATI_NAME; - pScreenInfo->Probe = ATIProbe; pScreenInfo->PreInit = ATIPreInit; pScreenInfo->ScreenInit = ATIScreenInit; pScreenInfo->SwitchMode = ATISwitchMode; diff --git a/src/atifillin.h b/src/atifillin.h index 2e9c5d4..7d5e54d 100644 --- a/src/atifillin.h +++ b/src/atifillin.h @@ -30,7 +30,6 @@ /* include headers corresponding to fields touched by ATIFillInScreenInfo() */ #include "ativersion.h" -#include "atiprobe.h" #include "atipreinit.h" #include "atiscreen.h" #include "aticonsole.h" diff --git a/src/atiident.c b/src/atiident.c deleted file mode 100644 index cffa817..0000000 --- a/src/atiident.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 1997 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 - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of Marc Aurele La France not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Marc Aurele La France makes no representations - * about the suitability of this software for any purpose. It is provided - * "as-is" without express or implied warranty. - * - * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO - * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "ati.h" -#include "atiident.h" -#include "atiutil.h" -#include "ativersion.h" - -#include "r128_probe.h" -#include "radeon_probe.h" - -/* - * ATIIdentify -- - * - * Print the driver's list of chipset names. - */ -void -ATIIdentify -( - int flags -) -{ - xf86Msg(X_INFO, "%s: %s\n", ATI_NAME, - "ATI driver (version " ATI_VERSION_NAME ") for chipset: mach64"); - R128Identify(flags); - RADEONIdentify(flags); -} diff --git a/src/atiident.h b/src/atiident.h deleted file mode 100644 index 38699ec..0000000 --- a/src/atiident.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 1997 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 - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of Marc Aurele La France not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Marc Aurele La France makes no representations - * about the suitability of this software for any purpose. It is provided - * "as-is" without express or implied warranty. - * - * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO - * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * 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. - */ - -#ifndef ___ATIIDENT_H___ -#define ___ATIIDENT_H___ 1 - -extern void ATIIdentify(int); - -#endif /* ___ATIIDENT_H___ */ diff --git a/src/atimach64probe.c b/src/atimach64probe.c new file mode 100644 index 0000000..ea01f67 --- /dev/null +++ b/src/atimach64probe.c @@ -0,0 +1,175 @@ +/* + * Copyright 1997 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 + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ati.h" +#include "atichip.h" +#include "atifillin.h" +#include "atimodule.h" +#include "atimach64io.h" +#include "atimach64probe.h" +#include "ativersion.h" + +static SymTabRec +Mach64Chipsets[] = { + {ATI_CHIP_88800GXC, "ATI 88800GX-C"}, + {ATI_CHIP_88800GXD, "ATI 88800GX-D"}, + {ATI_CHIP_88800GXE, "ATI 88800GX-E"}, + {ATI_CHIP_88800GXF, "ATI 88800GX-F"}, + {ATI_CHIP_88800GX, "ATI 88800GX"}, + {ATI_CHIP_88800CX, "ATI 88800CX"}, + {ATI_CHIP_264CT, "ATI 264CT"}, + {ATI_CHIP_264ET, "ATI 264ET"}, + {ATI_CHIP_264VT, "ATI 264VT"}, + {ATI_CHIP_264VTB, "ATI 264VT-B"}, + {ATI_CHIP_264GT, "ATI 3D Rage"}, + {ATI_CHIP_264GTB, "ATI 3D Rage II"}, + {ATI_CHIP_264VT3, "ATI 264VT3"}, + {ATI_CHIP_264GTDVD, "ATI 3D Rage II+DVD"}, + {ATI_CHIP_264LT, "ATI 3D Rage LT"}, + {ATI_CHIP_264VT4, "ATI 264VT4"}, + {ATI_CHIP_264GT2C, "ATI 3D Rage IIc"}, + {ATI_CHIP_264GTPRO, "ATI 3D Rage Pro"}, + {ATI_CHIP_264LTPRO, "ATI 3D Rage LT Pro"}, + {ATI_CHIP_264XL, "ATI 3D Rage XL or XC"}, + {ATI_CHIP_MOBILITY, "ATI 3D Rage Mobility"}, + {-1, NULL } +}; + +/* + * This table maps a PCI device ID to a chipset family identifier. + */ +static PciChipsets +Mach64PciChipsets[] = { + {ATI_CHIP_88800GX, PCI_CHIP_MACH64GX, RES_SHARED_VGA}, + {ATI_CHIP_88800CX, PCI_CHIP_MACH64CX, RES_SHARED_VGA}, + {ATI_CHIP_264CT, PCI_CHIP_MACH64CT, RES_SHARED_VGA}, + {ATI_CHIP_264ET, PCI_CHIP_MACH64ET, RES_SHARED_VGA}, + {ATI_CHIP_264VT, PCI_CHIP_MACH64VT, RES_SHARED_VGA}, + {ATI_CHIP_264GT, PCI_CHIP_MACH64GT, RES_SHARED_VGA}, + {ATI_CHIP_264VT3, PCI_CHIP_MACH64VU, RES_SHARED_VGA}, + {ATI_CHIP_264GTDVD, PCI_CHIP_MACH64GU, RES_SHARED_VGA}, + {ATI_CHIP_264LT, PCI_CHIP_MACH64LG, RES_SHARED_VGA}, + {ATI_CHIP_264VT4, PCI_CHIP_MACH64VV, RES_SHARED_VGA}, + {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GV, RES_SHARED_VGA}, + {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GW, RES_SHARED_VGA}, + {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GY, RES_SHARED_VGA}, + {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GZ, RES_SHARED_VGA}, + {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GB, RES_SHARED_VGA}, + {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GD, RES_SHARED_VGA}, + {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GI, RES_SHARED_VGA}, + {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GP, RES_SHARED_VGA}, + {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GQ, RES_SHARED_VGA}, + {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LB, RES_SHARED_VGA}, + {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LD, RES_SHARED_VGA}, + {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LI, RES_SHARED_VGA}, + {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LP, RES_SHARED_VGA}, + {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LQ, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GL, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GM, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GN, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GO, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GR, RES_SHARED_VGA}, + {ATI_CHIP_264XL, PCI_CHIP_MACH64GS, RES_SHARED_VGA}, + {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LM, RES_SHARED_VGA}, + {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LN, RES_SHARED_VGA}, + {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LR, RES_SHARED_VGA}, + {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LS, RES_SHARED_VGA}, + {-1, -1, RES_UNDEFINED} +}; + +/* + * Mach64Probe -- + * + * This function is called once, at the start of the first server generation to + * do a minimal probe for supported hardware. + */ +Bool +Mach64Probe(DriverPtr pDriver, int flags) +{ + GDevPtr *devSections; + int *usedChips; + int numDevSections; + int numUsed; + Bool ProbeSuccess = FALSE; + + if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0) + return FALSE; + + if (xf86GetPciVideoInfo() == NULL) + return FALSE; + + numUsed = xf86MatchPciInstances(ATI_DRIVER_NAME, PCI_VENDOR_ATI, + Mach64Chipsets, Mach64PciChipsets, + devSections, numDevSections, + pDriver, &usedChips); + xfree(devSections); + + if (numUsed <= 0) + return FALSE; + + if (flags & PROBE_DETECT) { + ProbeSuccess = TRUE; + } else { + int i; + + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn; + EntityInfoPtr pEnt; + pciVideoPtr pVideo; + + pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i], Mach64PciChipsets, + 0, 0, 0, 0, NULL); + + if (!pScrn) + continue; + + pEnt = xf86GetEntityInfo(usedChips[i]); + pVideo = xf86GetPciInfoForEntity(usedChips[i]); + +#ifdef XFree86LOADER + + if (!xf86LoadSubModule(pScrn, "atimisc")) + { + xf86Msg(X_ERROR, + ATI_NAME ": Failed to load \"atimisc\" module.\n"); + xf86DeleteScreen(pScrn->scrnIndex, 0); + continue; + } + + xf86LoaderReqSymLists(ATISymbols, NULL); + +#endif + + ATIFillInScreenInfo(pScrn); + + pScrn->Probe = Mach64Probe; + + ProbeSuccess = TRUE; + } + } + + return ProbeSuccess; +} diff --git a/src/atimach64probe.h b/src/atimach64probe.h new file mode 100644 index 0000000..24e85d8 --- /dev/null +++ b/src/atimach64probe.h @@ -0,0 +1,30 @@ +/* + * Copyright 1997 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 + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * 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. + */ + +#ifndef ___ATIMACH64PROBE_H___ +#define ___ATIMACH64PROBE_H___ 1 + +#include "xf86str.h" + +extern Bool Mach64Probe(DriverPtr, int); + +#endif /* ___ATIMACH64PROBE_H___ */ diff --git a/src/atipreinit.c b/src/atipreinit.c index e18e27a..8ca16eb 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -37,7 +37,6 @@ #include "atidac.h" #include "atidsp.h" #include "atii2c.h" -#include "atiident.h" #include "atiload.h" #include "atilock.h" #include "atimach64.h" @@ -46,6 +45,7 @@ #include "atimode.h" #include "atipreinit.h" #include "atiprint.h" +#include "atiprobe.h" #include "atividmem.h" #include "atiwonderio.h" #include "atixv.h" diff --git a/src/atiprobe.c b/src/atiprobe.c index e869bf0..4a70f81 100644 --- a/src/atiprobe.c +++ b/src/atiprobe.c @@ -28,27 +28,15 @@ #include #include "ati.h" -#include "atiadjust.h" #include "atibus.h" #include "atichip.h" -#include "aticonsole.h" -#include "atifillin.h" -#include "atiident.h" #include "atimach64io.h" #include "atimodule.h" -#include "atipreinit.h" #include "atiprobe.h" -#include "atiscreen.h" -#include "ativalid.h" #include "ativersion.h" #include "atividmem.h" #include "atiwonderio.h" -#include "radeon_probe.h" -#include "radeon_version.h" -#include "r128_probe.h" -#include "r128_version.h" - #ifndef AVOID_CPIO /* @@ -280,7 +268,7 @@ LastProbe: * This function looks for a Mach64 at a particular PIO address and returns an * ATIRec if one is found. */ -ATIPtr +static ATIPtr ATIMach64Probe ( ATIPtr pATI, @@ -530,214 +518,3 @@ SkipSparse: return ProbeSuccess; } - -static SymTabRec -Mach64Chipsets[] = { - {ATI_CHIP_88800GXC, "ATI 88800GX-C"}, - {ATI_CHIP_88800GXD, "ATI 88800GX-D"}, - {ATI_CHIP_88800GXE, "ATI 88800GX-E"}, - {ATI_CHIP_88800GXF, "ATI 88800GX-F"}, - {ATI_CHIP_88800GX, "ATI 88800GX"}, - {ATI_CHIP_88800CX, "ATI 88800CX"}, - {ATI_CHIP_264CT, "ATI 264CT"}, - {ATI_CHIP_264ET, "ATI 264ET"}, - {ATI_CHIP_264VT, "ATI 264VT"}, - {ATI_CHIP_264VTB, "ATI 264VT-B"}, - {ATI_CHIP_264GT, "ATI 3D Rage"}, - {ATI_CHIP_264GTB, "ATI 3D Rage II"}, - {ATI_CHIP_264VT3, "ATI 264VT3"}, - {ATI_CHIP_264GTDVD, "ATI 3D Rage II+DVD"}, - {ATI_CHIP_264LT, "ATI 3D Rage LT"}, - {ATI_CHIP_264VT4, "ATI 264VT4"}, - {ATI_CHIP_264GT2C, "ATI 3D Rage IIc"}, - {ATI_CHIP_264GTPRO, "ATI 3D Rage Pro"}, - {ATI_CHIP_264LTPRO, "ATI 3D Rage LT Pro"}, - {ATI_CHIP_264XL, "ATI 3D Rage XL or XC"}, - {ATI_CHIP_MOBILITY, "ATI 3D Rage Mobility"}, - {-1, NULL } -}; - -/* - * This table maps a PCI device ID to a chipset family identifier. - */ -static PciChipsets -Mach64PciChipsets[] = { - {ATI_CHIP_88800GX, PCI_CHIP_MACH64GX, RES_SHARED_VGA}, - {ATI_CHIP_88800CX, PCI_CHIP_MACH64CX, RES_SHARED_VGA}, - {ATI_CHIP_264CT, PCI_CHIP_MACH64CT, RES_SHARED_VGA}, - {ATI_CHIP_264ET, PCI_CHIP_MACH64ET, RES_SHARED_VGA}, - {ATI_CHIP_264VT, PCI_CHIP_MACH64VT, RES_SHARED_VGA}, - {ATI_CHIP_264GT, PCI_CHIP_MACH64GT, RES_SHARED_VGA}, - {ATI_CHIP_264VT3, PCI_CHIP_MACH64VU, RES_SHARED_VGA}, - {ATI_CHIP_264GTDVD, PCI_CHIP_MACH64GU, RES_SHARED_VGA}, - {ATI_CHIP_264LT, PCI_CHIP_MACH64LG, RES_SHARED_VGA}, - {ATI_CHIP_264VT4, PCI_CHIP_MACH64VV, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GV, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GW, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GY, RES_SHARED_VGA}, - {ATI_CHIP_264GT2C, PCI_CHIP_MACH64GZ, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GB, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GD, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GI, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GP, RES_SHARED_VGA}, - {ATI_CHIP_264GTPRO, PCI_CHIP_MACH64GQ, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LB, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LD, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LI, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LP, RES_SHARED_VGA}, - {ATI_CHIP_264LTPRO, PCI_CHIP_MACH64LQ, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GL, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GM, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GN, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GO, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GR, RES_SHARED_VGA}, - {ATI_CHIP_264XL, PCI_CHIP_MACH64GS, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LM, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LN, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LR, RES_SHARED_VGA}, - {ATI_CHIP_MOBILITY, PCI_CHIP_MACH64LS, RES_SHARED_VGA}, - {-1, -1, RES_UNDEFINED} -}; - -/* - * Mach64Probe -- - * - * This function is called once, at the start of the first server generation to - * do a minimal probe for supported hardware. - */ -static Bool -Mach64Probe(DriverPtr pDriver, int flags) -{ - GDevPtr *devSections; - int *usedChips; - int numDevSections; - int numUsed; - Bool ProbeSuccess = FALSE; - - if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0) - return FALSE; - - if (xf86GetPciVideoInfo() == NULL) - return FALSE; - - numUsed = xf86MatchPciInstances(ATI_DRIVER_NAME, PCI_VENDOR_ATI, - Mach64Chipsets, Mach64PciChipsets, - devSections, numDevSections, - pDriver, &usedChips); - xfree(devSections); - - if (numUsed <= 0) - return FALSE; - - if (flags & PROBE_DETECT) { - ProbeSuccess = TRUE; - } else { - int i; - - for (i = 0; i < numUsed; i++) { - ScrnInfoPtr pScrn; - EntityInfoPtr pEnt; - pciVideoPtr pVideo; - - pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i], Mach64PciChipsets, - 0, 0, 0, 0, NULL); - - if (!pScrn) - continue; - - pEnt = xf86GetEntityInfo(usedChips[i]); - pVideo = xf86GetPciInfoForEntity(usedChips[i]); - -#ifdef XFree86LOADER - - if (!xf86LoadSubModule(pScrn, "atimisc")) - { - xf86Msg(X_ERROR, - ATI_NAME ": Failed to load \"atimisc\" module.\n"); - xf86DeleteScreen(pScrn->scrnIndex, 0); - continue; - } - - xf86LoaderReqSymLists(ATISymbols, NULL); - -#endif - - ATIFillInScreenInfo(pScrn); - - pScrn->Probe = Mach64Probe; - - ProbeSuccess = TRUE; - } - } - - return ProbeSuccess; -} - -/* - * ATIProbe -- - * - * This function is called once, at the start of the first server generation to - * do a minimal probe for supported hardware. - */ -Bool -ATIProbe -( - DriverPtr pDriver, - int flags -) -{ - pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); - Bool ProbeSuccess = FALSE; - Bool DoMach64 = FALSE; - Bool DoRage128 = FALSE, DoRadeon = FALSE; - int i; - ATIChipType Chip; - - if (!(flags & PROBE_DETECT)) - { - if (xf86MatchDevice(ATI_NAME, NULL) > 0) - DoMach64 = TRUE; - if (xf86MatchDevice(R128_NAME, NULL) > 0) - DoRage128 = TRUE; - if (xf86MatchDevice(RADEON_NAME, NULL) > 0) - DoRadeon = TRUE; - } - - if (xf86PciVideoInfo) - { - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType == PCI_CHIP_MACH32)) - continue; - - /* Check for Rage128's, Radeon's and later adapters */ - Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - if (Chip > ATI_CHIP_Mach64) - { - if (Chip <= ATI_CHIP_Rage128) - DoRage128 = TRUE; - else if (Chip <= ATI_CHIP_Radeon) - DoRadeon = TRUE; - - continue; - } - - DoMach64 = TRUE; - } - } - - /* Call Mach64 driver probe */ - if (DoMach64 && Mach64Probe(pDriver, flags)) - ProbeSuccess = TRUE; - - /* Call Rage 128 driver probe */ - if (DoRage128 && R128Probe(pDriver, flags)) - ProbeSuccess = TRUE; - - /* Call Radeon driver probe */ - if (DoRadeon && RADEONProbe(pDriver, flags)) - ProbeSuccess = TRUE; - - return ProbeSuccess; -} diff --git a/src/atiprobe.h b/src/atiprobe.h index 4081fb3..6195eb4 100644 --- a/src/atiprobe.h +++ b/src/atiprobe.h @@ -25,6 +25,6 @@ #include "xf86str.h" -extern Bool ATIProbe(DriverPtr, int); +extern Bool ATIMach64ProbeIO(pciVideoPtr, ATIPtr); #endif /* ___ATIPROBE_H___ */ -- cgit v1.2.3 From 50a524445ed1ea3c4fab56de772921ba86a21d35 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 8 Mar 2007 17:43:48 +0200 Subject: Move atioption.c from ati to atimisc. --- src/Makefile.am | 3 +- src/ati.c | 24 ++++- src/aticonfig.c | 201 +++++++++++++++++++++++++++++++++++++++- src/aticonfig.h | 32 ------- src/atimach64probe.c | 11 +++ src/atimach64probe.h | 3 +- src/atimodule.c | 1 + src/atioption.c | 254 --------------------------------------------------- src/atioption.h | 5 +- src/atipreinit.c | 2 +- 10 files changed, 241 insertions(+), 295 deletions(-) delete mode 100644 src/aticonfig.h delete mode 100644 src/atioption.c diff --git a/src/Makefile.am b/src/Makefile.am index 24f5516..5c1bee6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,7 +51,7 @@ ati_drv_la_LTLIBRARIES = ati_drv.la ati_drv_la_LDFLAGS = -module -avoid-version ati_drv_ladir = @moduledir@/drivers ati_drv_la_SOURCES = \ - ati.c atichip.c atioption.c atimodule.c atimach64probe.c \ + ati.c atichip.c atimodule.c atimach64probe.c \ radeon_probe.c r128_probe.c atimisc_drv_la_LTLIBRARIES = atimisc_drv.la @@ -114,7 +114,6 @@ EXTRA_DIST = \ atibus.h \ atichip.h \ aticlock.h \ - aticonfig.h \ aticonsole.h \ aticrtc.h \ aticursor.h \ diff --git a/src/ati.c b/src/ati.c index 4d50aec..e7a5aee 100644 --- a/src/ati.c +++ b/src/ati.c @@ -59,7 +59,6 @@ #include "ati.h" #include "atichip.h" -#include "atioption.h" #include "ativersion.h" #include "atimach64probe.h" @@ -154,6 +153,29 @@ ATIProbe return ProbeSuccess; } +/* + * ATIAvailableOptions -- + * + * Return recognised options that are intended for public consumption. + */ +const OptionInfoRec * +ATIAvailableOptions +( + int ChipId, + int BusId +) +{ + const OptionInfoRec *pOptions; + + if ((pOptions = R128AvailableOptions(ChipId, BusId))) + return pOptions; + + if ((pOptions = RADEONAvailableOptions(ChipId, BusId))) + return pOptions; + + return Mach64AvailableOptions(ChipId, BusId); +} + /* The root of all evil... */ _X_EXPORT DriverRec ATI = { diff --git a/src/aticonfig.c b/src/aticonfig.c index eeb0a70..a4ceddf 100644 --- a/src/aticonfig.c +++ b/src/aticonfig.c @@ -31,13 +31,212 @@ #include "ati.h" #include "atichip.h" -#include "aticonfig.h" #include "aticursor.h" #include "atioption.h" #include "atistruct.h" #include "mach64_common.h" +#ifdef TV_OUT + +/* + * List of supported TV standard names + */ +const char *ATITVStandardNames[ATI_TV_STDS_MAX_VALID+1] = { + "NTSC", + "PAL", + "PAL-M", + "PAL-60", + "NTSC-J", + "PAL-CN", + "PAL-N", + "Reserved1", + "Reserved2", + "SCART-PAL", + "None", + "Invalid" +}; + +#endif /* TV_OUT */ + +/* + * Recognised XF86Config options. + */ +static const OptionInfoRec ATIPublicOptions[] = +{ + { + ATI_OPTION_PROBE_SPARSE, + "probe_sparse", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_ACCEL, + "accel", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_CRT_DISPLAY, + "crt_display", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_CSYNC, + "composite_sync", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_HWCURSOR, + "hw_cursor", + OPTV_BOOLEAN, + {0, }, + FALSE, + }, + +#ifdef XF86DRI_DEVEL + + { + ATI_OPTION_IS_PCI, + "force_pci_mode", + OPTV_BOOLEAN, + {0, }, + FALSE, + }, + { + ATI_OPTION_DMA_MODE, + "dma_mode", + OPTV_STRING, + {0, }, + FALSE, + }, + { + ATI_OPTION_AGP_MODE, + "agp_mode", + OPTV_INTEGER, + {0, }, + FALSE, + }, + { + ATI_OPTION_AGP_SIZE, + "agp_size", + OPTV_INTEGER, + {0, }, + FALSE, + }, + { + ATI_OPTION_LOCAL_TEXTURES, + "local_textures", + OPTV_BOOLEAN, + {0, }, + FALSE, + }, + { + ATI_OPTION_BUFFER_SIZE, + "buffer_size", + OPTV_INTEGER, + {0, }, + FALSE, + }, + +#endif /* XF86DRI_DEVEL */ + +#ifdef TV_OUT + { + ATI_OPTION_TV_OUT, + "tv_out", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_TV_STD, + "tv_standard", + OPTV_STRING, + {0, }, + FALSE + }, + +#endif /* TV_OUT */ + + { + ATI_OPTION_MMIO_CACHE, + "mmio_cache", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + + + { + ATI_OPTION_TEST_MMIO_CACHE, + "test_mmio_cache", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_PANEL_DISPLAY, + "panel_display", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_REFERENCE_CLOCK, + "reference_clock", + OPTV_FREQ, + {0, }, + FALSE + }, + { + ATI_OPTION_SHADOW_FB, + "shadow_fb", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + ATI_OPTION_SWCURSOR, + "sw_cursor", + OPTV_BOOLEAN, + {0, }, + FALSE, + }, + { + ATI_OPTION_ACCELMETHOD, + "AccelMethod", + OPTV_STRING, + {0, }, + FALSE + }, + { + ATI_OPTION_RENDER_ACCEL, + "RenderAccel", + OPTV_BOOLEAN, + {0, }, + FALSE + }, + { + -1, + NULL, + OPTV_NONE, + {0, }, + FALSE + } +}; + +static const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions); + +_X_EXPORT const OptionInfoRec * +ATIOptionsWeak(void) { return ATIPublicOptions; } + /* * Non-publicised XF86Config options. */ diff --git a/src/aticonfig.h b/src/aticonfig.h deleted file mode 100644 index ec68c31..0000000 --- a/src/aticonfig.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of Marc Aurele La France not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Marc Aurele La France makes no representations - * about the suitability of this software for any purpose. It is provided - * "as-is" without express or implied warranty. - * - * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO - * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * 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. - */ - -#ifndef ___ATICONFIG_H___ -#define ___ATICONFIG_H___ 1 - -#include "atipriv.h" - -#include "xf86str.h" - -extern void ATIProcessOptions(ScrnInfoPtr, ATIPtr); - -#endif /* ___ATICONFIG_H___ */ diff --git a/src/atimach64probe.c b/src/atimach64probe.c index ea01f67..47340a5 100644 --- a/src/atimach64probe.c +++ b/src/atimach64probe.c @@ -30,6 +30,7 @@ #include "atimodule.h" #include "atimach64io.h" #include "atimach64probe.h" +#include "atioption.h" #include "ativersion.h" static SymTabRec @@ -100,6 +101,16 @@ Mach64PciChipsets[] = { {-1, -1, RES_UNDEFINED} }; +const OptionInfoRec * +Mach64AvailableOptions(int chipid, int busid) +{ + /* + * Return options defined in the atimisc submodule which will have been + * loaded by this point. + */ + return ATIOptionsWeak(); +} + /* * Mach64Probe -- * diff --git a/src/atimach64probe.h b/src/atimach64probe.h index 24e85d8..4e474ca 100644 --- a/src/atimach64probe.h +++ b/src/atimach64probe.h @@ -25,6 +25,7 @@ #include "xf86str.h" -extern Bool Mach64Probe(DriverPtr, int); +extern const OptionInfoRec * Mach64AvailableOptions(int, int); +extern Bool Mach64Probe(DriverPtr, int); #endif /* ___ATIMACH64PROBE_H___ */ diff --git a/src/atimodule.c b/src/atimodule.c index 39a2eeb..05456e7 100644 --- a/src/atimodule.c +++ b/src/atimodule.c @@ -42,6 +42,7 @@ const char *ATISymbols[] = "ATILeaveVT", "ATIFreeScreen", "ATIValidMode", + "ATIOptionsWeak", "ATIFillInScreenInfo", NULL }; diff --git a/src/atioption.c b/src/atioption.c deleted file mode 100644 index 4cb965d..0000000 --- a/src/atioption.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 1999 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 - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of Marc Aurele La France not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Marc Aurele La France makes no representations - * about the suitability of this software for any purpose. It is provided - * "as-is" without express or implied warranty. - * - * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO - * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * 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 - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "atioption.h" -#include "atiutil.h" - -#include "radeon_probe.h" -#include "r128_probe.h" - -#ifdef TV_OUT - -/* - * List of supported TV standard names - */ -const char *ATITVStandardNames[ATI_TV_STDS_MAX_VALID+1] = { - "NTSC", - "PAL", - "PAL-M", - "PAL-60", - "NTSC-J", - "PAL-CN", - "PAL-N", - "Reserved1", - "Reserved2", - "SCART-PAL", - "None", - "Invalid" -}; - -#endif /* TV_OUT */ - -/* - * Recognised XF86Config options. - */ -const OptionInfoRec ATIPublicOptions[] = -{ - { - ATI_OPTION_PROBE_SPARSE, - "probe_sparse", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_ACCEL, - "accel", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_CRT_DISPLAY, - "crt_display", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_CSYNC, - "composite_sync", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_HWCURSOR, - "hw_cursor", - OPTV_BOOLEAN, - {0, }, - FALSE, - }, - -#ifdef XF86DRI_DEVEL - - { - ATI_OPTION_IS_PCI, - "force_pci_mode", - OPTV_BOOLEAN, - {0, }, - FALSE, - }, - { - ATI_OPTION_DMA_MODE, - "dma_mode", - OPTV_STRING, - {0, }, - FALSE, - }, - { - ATI_OPTION_AGP_MODE, - "agp_mode", - OPTV_INTEGER, - {0, }, - FALSE, - }, - { - ATI_OPTION_AGP_SIZE, - "agp_size", - OPTV_INTEGER, - {0, }, - FALSE, - }, - { - ATI_OPTION_LOCAL_TEXTURES, - "local_textures", - OPTV_BOOLEAN, - {0, }, - FALSE, - }, - { - ATI_OPTION_BUFFER_SIZE, - "buffer_size", - OPTV_INTEGER, - {0, }, - FALSE, - }, - -#endif /* XF86DRI_DEVEL */ - -#ifdef TV_OUT - { - ATI_OPTION_TV_OUT, - "tv_out", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_TV_STD, - "tv_standard", - OPTV_STRING, - {0, }, - FALSE - }, - -#endif /* TV_OUT */ - - { - ATI_OPTION_MMIO_CACHE, - "mmio_cache", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - - - { - ATI_OPTION_TEST_MMIO_CACHE, - "test_mmio_cache", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_PANEL_DISPLAY, - "panel_display", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_REFERENCE_CLOCK, - "reference_clock", - OPTV_FREQ, - {0, }, - FALSE - }, - { - ATI_OPTION_SHADOW_FB, - "shadow_fb", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - ATI_OPTION_SWCURSOR, - "sw_cursor", - OPTV_BOOLEAN, - {0, }, - FALSE, - }, - { - ATI_OPTION_ACCELMETHOD, - "AccelMethod", - OPTV_STRING, - {0, }, - FALSE - }, - { - ATI_OPTION_RENDER_ACCEL, - "RenderAccel", - OPTV_BOOLEAN, - {0, }, - FALSE - }, - { - -1, - NULL, - OPTV_NONE, - {0, }, - FALSE - } -}; - -const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions); - -/* - * ATIAvailableOptions -- - * - * Return recognised options that are intended for public consumption. - */ -const OptionInfoRec * -ATIAvailableOptions -( - int ChipId, - int BusId -) -{ - const OptionInfoRec *pOptions; - - if ((pOptions = R128AvailableOptions(ChipId, BusId))) - return pOptions; - - if ((pOptions = RADEONAvailableOptions(ChipId, BusId))) - return pOptions; - - return ATIPublicOptions; -} diff --git a/src/atioption.h b/src/atioption.h index f68f641..37303ef 100644 --- a/src/atioption.h +++ b/src/atioption.h @@ -91,9 +91,8 @@ extern const char * ATITVStandardNames[]; #endif /* TV_OUT */ -extern const OptionInfoRec ATIPublicOptions[]; -extern const unsigned long ATIPublicOptionSize; +extern const OptionInfoRec * ATIOptionsWeak(void); -extern const OptionInfoRec * ATIAvailableOptions(int, int); +extern void ATIProcessOptions(ScrnInfoPtr, ATIPtr); #endif /* ___ATIOPTION_H___ */ diff --git a/src/atipreinit.c b/src/atipreinit.c index 8ca16eb..8f80824 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -32,7 +32,6 @@ #include "atiaudio.h" #include "atibus.h" #include "atichip.h" -#include "aticonfig.h" #include "aticursor.h" #include "atidac.h" #include "atidsp.h" @@ -43,6 +42,7 @@ #include "atimach64accel.h" #include "atimach64io.h" #include "atimode.h" +#include "atioption.h" #include "atipreinit.h" #include "atiprint.h" #include "atiprobe.h" -- cgit v1.2.3 From cfb82631fb683a0dc9bbc8f2d214646a8f1bca0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 15 Mar 2007 17:12:43 +0100 Subject: radeon: Fix build warnings. --- src/radeon.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/radeon.h b/src/radeon.h index c976b0a..5bb005b 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -608,7 +608,7 @@ typedef struct { #endif Bool have3DWindows; /* Are there any 3d clients? */ - unsigned int pciAperSize; + int pciAperSize; drmSize gartSize; drm_handle_t agpMemHandle; /* Handle from drmAgpAlloc */ unsigned long gartOffset; @@ -930,6 +930,7 @@ extern void RADEONDRICloseScreen(ScreenPtr pScreen); extern void RADEONDRIResume(ScreenPtr pScreen); extern Bool RADEONDRIFinishScreenInit(ScreenPtr pScreen); extern void RADEONDRIAllocatePCIGARTTable(ScreenPtr pScreen); +extern int RADEONDRIGetPciAperTableSize(ScrnInfoPtr pScrn); extern void RADEONDRIStop(ScreenPtr pScreen); extern drmBufPtr RADEONCPGetBuffer(ScrnInfoPtr pScrn); -- cgit v1.2.3 From 2d2fb54ba370c1df9ef5102e83c17a7ff5c55403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 15 Mar 2007 17:26:56 +0100 Subject: atimisc: Fix strict aliasing violation flagged by -Wall. --- src/atimach64render.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/atimach64render.c b/src/atimach64render.c index 8a6ebbc..dda3938 100644 --- a/src/atimach64render.c +++ b/src/atimach64render.c @@ -769,7 +769,14 @@ do { \ _v.argb = _col; \ } while (0) -#define FVAL(_fval) (*(CARD32 *)&(_fval)) +static __inline__ CARD32 +FVAL(float f) +{ + union { float f; CARD32 c; } fc; + + fc.f = f; + return fc.c; +} #define VTX_OUT(_v, n) \ do { \ -- cgit v1.2.3 From 4651d00b183cb498879d605c4b93cd3a0c63cb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:10:19 +0100 Subject: radeon: Make sure 3D clients will re-upload textures to video RAM after LeaveVT. Walk the SAREA texList and bump the age of every active object, so their owners will consider them kicked out when they grab the HW lock next time. --- src/radeon_driver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index ca0b201..4842542 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -6874,6 +6874,19 @@ _X_EXPORT void RADEONLeaveVT(int scrnIndex, int flags) /* we need to backup the PCIE GART TABLE from fb memory */ memcpy(info->pciGartBackup, (info->FB + info->pciGartOffset), info->pciGartSize); } + + /* Make sure 3D clients will re-upload textures to video RAM */ + if (info->textureSize) { + RADEONSAREAPrivPtr pSAREAPriv = + (RADEONSAREAPrivPtr)DRIGetSAREAPrivate(pScrn->pScreen); + drmTextureRegionPtr list = pSAREAPriv->texList[0]; + int age = ++pSAREAPriv->texAge[0], i = 0; + + do { + list[i].age = age; + i = list[i].next; + } while (i != 0); + } } #endif -- cgit v1.2.3 From 113fb4b61e709a9b54fc2ef73efce06011e771c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:12:09 +0100 Subject: radeon: Disable CP line acceleration on RV280s. There have been several reports of stability issues with things like the xscreensaver hack hypercube. --- src/radeon_accelfuncs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/radeon_accelfuncs.c b/src/radeon_accelfuncs.c index 784b074..212131f 100644 --- a/src/radeon_accelfuncs.c +++ b/src/radeon_accelfuncs.c @@ -1204,8 +1204,14 @@ FUNC_NAME(RADEONAccelInit)(ScreenPtr pScreen, XAAInfoRecPtr a) hardware accel two point lines */ miSetZeroLineBias(pScreen, (OCTANT5 | OCTANT6 | OCTANT7 | OCTANT8)); - a->SubsequentSolidTwoPointLine - = FUNC_NAME(RADEONSubsequentSolidTwoPointLine); +#ifdef ACCEL_CP + /* RV280s lock up with this using the CP for reasons to be determined. + * See https://bugs.freedesktop.org/show_bug.cgi?id=5986 . + */ + if (info->ChipFamily != CHIP_FAMILY_RV280) +#endif + a->SubsequentSolidTwoPointLine + = FUNC_NAME(RADEONSubsequentSolidTwoPointLine); /* Disabled on RV200 and newer because it does not pass XTest */ if (info->ChipFamily < CHIP_FAMILY_RV200) { -- cgit v1.2.3 From e174d8df8c801fad95e5f79cff69187c200bee6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:12:51 +0100 Subject: radeon: Minor BlockHandler cleanups. Don't flush indirect buffer in BlockHandler; it's done in LeaveServer. Also set the EXA engine mode to unknown only at the end. --- src/radeon_driver.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 4842542..9ed0d6c 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -3404,14 +3404,6 @@ static void RADEONBlockHandler(int i, pointer blockData, ScrnInfoPtr pScrn = xf86Screens[i]; RADEONInfoPtr info = RADEONPTR(pScrn); -#ifdef XF86DRI - if (info->directRenderingInited) { - FLUSH_RING(); - } -#endif -#ifdef USE_EXA - info->engineMode = EXA_ENGINEMODE_UNKNOWN; -#endif pScreen->BlockHandler = info->BlockHandler; (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); pScreen->BlockHandler = RADEONBlockHandler; @@ -3423,6 +3415,10 @@ static void RADEONBlockHandler(int i, pointer blockData, if(info->RenderCallback) (*info->RenderCallback)(pScrn); #endif + +#ifdef USE_EXA + info->engineMode = EXA_ENGINEMODE_UNKNOWN; +#endif } -- cgit v1.2.3 From 3cfa3a5c8daf03aaad6fc30d275709f6eb717d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:13:24 +0100 Subject: radeon: Unify code to release the CP. --- src/radeon.h | 18 ++++++++++-------- src/radeon_dri.c | 16 ++-------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/radeon.h b/src/radeon.h index 5bb005b..8d0115e 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -964,6 +964,16 @@ do { \ info->CPStarted = TRUE; \ } while (0) +#define RADEONCP_RELEASE(pScrn, info) \ +do { \ + if (info->CPInUse) { \ + RADEON_PURGE_CACHE(); \ + RADEON_WAIT_UNTIL_IDLE(); \ + RADEONCPReleaseIndirect(pScrn); \ + info->CPInUse = FALSE; \ + } \ +} while (0) + #define RADEONCP_STOP(pScrn, info) \ do { \ int _ret; \ @@ -1128,14 +1138,6 @@ do { \ ADVANCE_RING(); \ } while (0) -#define RADEON_FLUSH_CACHE() \ -do { \ - BEGIN_RING(2); \ - OUT_RING(CP_PACKET0(RADEON_RB3D_DSTCACHE_CTLSTAT, 0)); \ - OUT_RING(RADEON_RB3D_DC_FLUSH); \ - ADVANCE_RING(); \ -} while (0) - #define RADEON_PURGE_CACHE() \ do { \ BEGIN_RING(2); \ diff --git a/src/radeon_dri.c b/src/radeon_dri.c index ee6192e..7ebf958 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -409,13 +409,7 @@ static void RADEONLeaveServer(ScreenPtr pScreen) /* The CP is always running, but if we've generated any CP commands * we must flush them to the kernel module now. */ - if (info->CPInUse) { - RADEON_FLUSH_CACHE(); - RADEON_WAIT_UNTIL_IDLE(); - RADEONCPReleaseIndirect(pScrn); - - info->CPInUse = FALSE; - } + RADEONCP_RELEASE(pScrn, info); #ifdef USE_EXA info->engineMode = EXA_ENGINEMODE_UNKNOWN; @@ -1703,13 +1697,7 @@ void RADEONDRIStop(ScreenPtr pScreen) /* If we've generated any CP commands, we must flush them to the * kernel module now. */ - if (info->CPInUse) { - RADEON_FLUSH_CACHE(); - RADEON_WAIT_UNTIL_IDLE(); - RADEONCPReleaseIndirect(pScrn); - - info->CPInUse = FALSE; - } + RADEONCP_RELEASE(pScrn, info); RADEONCP_STOP(pScrn, info); } info->directRenderingInited = FALSE; -- cgit v1.2.3 From 1bdd376dbd57de8925244f0808f974d6d8cff39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:14:39 +0100 Subject: radeon: Only sync to hardware when really necessary with EXA. In particular, don't sync again after accelerated DownloadFromScreen, which syncs implicitly. This avoids calling into the kernel when it's not necessary, which can be relevant in some situations. --- src/radeon.h | 2 ++ src/radeon_exa_funcs.c | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/radeon.h b/src/radeon.h index 8d0115e..ce2fe19 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -497,6 +497,8 @@ typedef struct { #ifdef USE_EXA ExaDriverPtr exa; + int exaSyncMarker; + int exaMarkerSynced; int engineMode; #define EXA_ENGINEMODE_UNKNOWN 0 #define EXA_ENGINEMODE_2D 1 diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index 0d847d1..c356de7 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -59,14 +59,30 @@ #include "exa.h" +static int +FUNC_NAME(RADEONMarkSync)(ScreenPtr pScreen) +{ + RINFO_FROM_SCREEN(pScreen); + + TRACE; + + return ++info->exaSyncMarker; +} + static void FUNC_NAME(RADEONSync)(ScreenPtr pScreen, int marker) { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); + TRACE; - FUNC_NAME(RADEONWaitForIdle)(xf86Screens[pScreen->myNum]); + if (info->exaMarkerSynced != marker) { + FUNC_NAME(RADEONWaitForIdle)(pScrn); + info->exaMarkerSynced = marker; + } - RADEONPTR(xf86Screens[pScreen->myNum])->engineMode = EXA_ENGINEMODE_UNKNOWN; + RADEONPTR(pScrn)->engineMode = EXA_ENGINEMODE_UNKNOWN; } static Bool @@ -444,6 +460,8 @@ FUNC_NAME(RADEONDownloadFromScreen)(PixmapPtr pSrc, int x, int y, int w, int h, drmCommandWriteRead(info->drmFD, DRM_RADEON_INDIRECT, &indirect, sizeof(drmRadeonIndirect)); + info->exaMarkerSynced = info->exaSyncMarker; + return TRUE; } #endif @@ -504,6 +522,7 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) info->exa->Copy = FUNC_NAME(RADEONCopy); info->exa->DoneCopy = FUNC_NAME(RADEONDoneCopy); + info->exa->MarkSync = FUNC_NAME(RADEONMarkSync); info->exa->WaitMarker = FUNC_NAME(RADEONSync); info->exa->UploadToScreen = FUNC_NAME(RADEONUploadToScreen); info->exa->DownloadFromScreen = FUNC_NAME(RADEONDownloadFromScreen); -- cgit v1.2.3 From 166c760a86165330175023e07c4b2bd6891633c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 20 Mar 2007 09:16:02 +0100 Subject: Fix advertised minimum minor version of the DRI module. We don't automatically require bumped minor versions. --- src/atidri.c | 4 ++-- src/r128_dri.c | 4 ++-- src/radeon_dri.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/atidri.c b/src/atidri.c index 83cb25f..d4fbead 100644 --- a/src/atidri.c +++ b/src/atidri.c @@ -1197,13 +1197,13 @@ Bool ATIDRIScreenInit( ScreenPtr pScreen ) /* Check the DRI version */ DRIQueryVersion( &major, &minor, &patch ); - if ( major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION ) { + if ( major != DRIINFO_MAJOR_VERSION || minor < 0 ) { xf86DrvMsg( pScreen->myNum, X_ERROR, "[dri] ATIDRIScreenInit failed because of a version mismatch.\n" "[dri] libdri version is %d.%d.%d but version %d.%d.x is needed.\n" "[dri] Disabling the DRI.\n", major, minor, patch, - DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION ); + DRIINFO_MAJOR_VERSION, 0 ); return FALSE; } diff --git a/src/r128_dri.c b/src/r128_dri.c index 21a13c1..fc91421 100644 --- a/src/r128_dri.c +++ b/src/r128_dri.c @@ -988,13 +988,13 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) /* Check the DRI version */ DRIQueryVersion(&major, &minor, &patch); - if (major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) { + if (major != DRIINFO_MAJOR_VERSION || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] R128DRIScreenInit failed because of a version mismatch.\n" "[dri] libdri version is %d.%d.%d but version %d.%d.x is needed.\n" "[dri] Disabling the DRI.\n", major, minor, patch, - DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION); + DRIINFO_MAJOR_VERSION, 0); return FALSE; } diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 7ebf958..b09a8cf 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1244,7 +1244,7 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn) /* Check the DRI version */ DRIQueryVersion(&major, &minor, &patch); - if (major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) { + if (major != DRIINFO_MAJOR_VERSION || minor < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] RADEONDRIGetVersion failed because of a version " "mismatch.\n" @@ -1252,7 +1252,7 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn) "needed.\n" "[dri] Disabling DRI.\n", major, minor, patch, - DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION); + DRIINFO_MAJOR_VERSION, 0); return FALSE; } -- cgit v1.2.3 From 58626d8b78f26f0d9c480033d3c3a12e541342b1 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 23 Mar 2007 21:30:19 +0200 Subject: Move {atimach64,r128,radeon}_probe.c from ati to subdrivers. Subdrivers are now loaded from the wrapper Probe function rather than at screen creation time. The wrapper Identify callback only prints chip families now, chip lists are printed when a subdriver is loaded. This also avoids duplication of subdriver Identify callbacks. Unknown radeons should still get a list of known radeon and then probe fails... Probe for atimisc last to avoid needless loading in most cases (r128, radeon). --- src/Makefile.am | 12 +++--- src/ati.c | 102 +++++++++++++++++++++++++++++++++++++++++---------- src/atimach64probe.c | 33 +++++++++-------- src/atimach64probe.h | 1 + src/atimodule.c | 40 +++++--------------- src/r128_probe.c | 20 ++-------- src/radeon_probe.c | 17 ++------- 7 files changed, 121 insertions(+), 104 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5c1bee6..197c486 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,8 +51,7 @@ ati_drv_la_LTLIBRARIES = ati_drv.la ati_drv_la_LDFLAGS = -module -avoid-version ati_drv_ladir = @moduledir@/drivers ati_drv_la_SOURCES = \ - ati.c atichip.c atimodule.c atimach64probe.c \ - radeon_probe.c r128_probe.c + ati.c atichip.c atimodule.c atimisc_drv_la_LTLIBRARIES = atimisc_drv.la atimisc_drv_la_LDFLAGS = -module -avoid-version @@ -64,15 +63,15 @@ atimisc_drv_la_SOURCES = \ atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \ atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \ - atiload.c atimisc.c $(ATIMISC_DRI_SRCS) $(ATIMISC_DGA_SOURCES) \ - $(ATIMISC_CPIO_SOURCES) $(ATIMISC_EXA_SOURCES) + atiload.c atimisc.c atimach64probe.c $(ATIMISC_CPIO_SOURCES) \ + $(ATIMISC_DGA_SOURCES) $(ATIMISC_DRI_SRCS) $(ATIMISC_EXA_SOURCES) r128_drv_la_LTLIBRARIES = r128_drv.la r128_drv_la_LDFLAGS = -module -avoid-version r128_drv_ladir = @moduledir@/drivers r128_drv_la_SOURCES = \ r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ - r128_video.c r128_misc.c $(R128_DRI_SRCS) + r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) radeon_drv_la_LTLIBRARIES = radeon_drv.la radeon_drv_la_LDFLAGS = -module -avoid-version @@ -80,7 +79,8 @@ radeon_drv_ladir = @moduledir@/drivers radeon_drv_la_SOURCES = \ radeon_accel.c radeon_mergedfb.c radeon_cursor.c radeon_dga.c \ radeon_driver.c radeon_video.c radeon_bios.c radeon_mm_i2c.c \ - radeon_vip.c radeon_misc.c radeon_display.c radeon_modes.c $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) + radeon_vip.c radeon_misc.c radeon_probe.c radeon_display.c \ + radeon_modes.c $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la theatre_detect_drv_la_LDFLAGS = -module -avoid-version diff --git a/src/ati.c b/src/ati.c index e7a5aee..fa7d9e8 100644 --- a/src/ati.c +++ b/src/ati.c @@ -59,6 +59,7 @@ #include "ati.h" #include "atichip.h" +#include "atimodule.h" #include "ativersion.h" #include "atimach64probe.h" @@ -78,10 +79,13 @@ ATIIdentify int flags ) { + /* + * Only print chip families here, chip lists are printed when a subdriver + * is loaded. + */ xf86Msg(X_INFO, "%s: %s\n", ATI_NAME, - "ATI driver (version " ATI_VERSION_NAME ") for chipset: mach64"); - R128Identify(flags); - RADEONIdentify(flags); + "ATI driver wrapper (version " ATI_VERSION_NAME ") for chipsets: " + "mach64, rage128, radeon"); } /* @@ -98,7 +102,6 @@ ATIProbe ) { pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); - Bool ProbeSuccess = FALSE; Bool DoMach64 = FALSE; Bool DoRage128 = FALSE, DoRadeon = FALSE; int i; @@ -138,19 +141,73 @@ ATIProbe } } - /* Call Mach64 driver probe */ - if (DoMach64 && Mach64Probe(pDriver, flags)) - ProbeSuccess = TRUE; + /* Call Radeon driver probe */ + if (DoRadeon) + { + pointer radeon = xf86LoadDrvSubModule(pDriver, "radeon"); + + if (!radeon) + { + xf86Msg(X_ERROR, + ATI_NAME ": Failed to load \"radeon\" module.\n"); + return FALSE; + } + + xf86LoaderReqSymLists(RADEONSymbols, NULL); + + RADEONIdentify(flags); + + if (RADEONProbe(pDriver, flags)) + return TRUE; + + xf86UnloadSubModule(radeon); + } /* Call Rage 128 driver probe */ - if (DoRage128 && R128Probe(pDriver, flags)) - ProbeSuccess = TRUE; + if (DoRage128) + { + pointer r128 = xf86LoadDrvSubModule(pDriver, "r128"); - /* Call Radeon driver probe */ - if (DoRadeon && RADEONProbe(pDriver, flags)) - ProbeSuccess = TRUE; + if (!r128) + { + xf86Msg(X_ERROR, + ATI_NAME ": Failed to load \"r128\" module.\n"); + return FALSE; + } + + xf86LoaderReqSymLists(R128Symbols, NULL); - return ProbeSuccess; + R128Identify(flags); + + if (R128Probe(pDriver, flags)) + return TRUE; + + xf86UnloadSubModule(r128); + } + + /* Call Mach64 driver probe */ + if (DoMach64) + { + pointer atimisc = xf86LoadDrvSubModule(pDriver, "atimisc"); + + if (!atimisc) + { + xf86Msg(X_ERROR, + ATI_NAME ": Failed to load \"atimisc\" module.\n"); + return FALSE; + } + + xf86LoaderReqSymLists(ATISymbols, NULL); + + Mach64Identify(flags); + + if (Mach64Probe(pDriver, flags)) + return TRUE; + + xf86UnloadSubModule(atimisc); + } + + return FALSE; } /* @@ -158,22 +215,27 @@ ATIProbe * * Return recognised options that are intended for public consumption. */ -const OptionInfoRec * +static const OptionInfoRec * ATIAvailableOptions ( int ChipId, int BusId ) { - const OptionInfoRec *pOptions; + CARD16 ChipType = ChipId & 0xffff; + ATIChipType Chip; - if ((pOptions = R128AvailableOptions(ChipId, BusId))) - return pOptions; + /* Probe should have loaded the appropriate subdriver by this point */ - if ((pOptions = RADEONAvailableOptions(ChipId, BusId))) - return pOptions; + Chip = ATIChipID(ChipType, 0x0); /* chip revision is don't care */ + if (Chip <= ATI_CHIP_Mach64) + return Mach64AvailableOptions(ChipId, BusId); + else if (Chip <= ATI_CHIP_Rage128) + return R128AvailableOptions(ChipId, BusId); + else if (Chip <= ATI_CHIP_Radeon) + return RADEONAvailableOptions(ChipId, BusId); - return Mach64AvailableOptions(ChipId, BusId); + return NULL; } /* The root of all evil... */ diff --git a/src/atimach64probe.c b/src/atimach64probe.c index 47340a5..cff8bfb 100644 --- a/src/atimach64probe.c +++ b/src/atimach64probe.c @@ -101,7 +101,7 @@ Mach64PciChipsets[] = { {-1, -1, RES_UNDEFINED} }; -const OptionInfoRec * +_X_EXPORT const OptionInfoRec * Mach64AvailableOptions(int chipid, int busid) { /* @@ -111,13 +111,28 @@ Mach64AvailableOptions(int chipid, int busid) return ATIOptionsWeak(); } +/* + * Mach64Identify -- + * + * Print the driver's list of chipset names. + */ +_X_EXPORT void +Mach64Identify +( + int flags +) +{ + xf86Msg(X_INFO, "%s: %s\n", ATI_NAME, + "Driver for ATI Mach64 chipsets"); +} + /* * Mach64Probe -- * * This function is called once, at the start of the first server generation to * do a minimal probe for supported hardware. */ -Bool +_X_EXPORT Bool Mach64Probe(DriverPtr pDriver, int flags) { GDevPtr *devSections; @@ -160,20 +175,6 @@ Mach64Probe(DriverPtr pDriver, int flags) pEnt = xf86GetEntityInfo(usedChips[i]); pVideo = xf86GetPciInfoForEntity(usedChips[i]); -#ifdef XFree86LOADER - - if (!xf86LoadSubModule(pScrn, "atimisc")) - { - xf86Msg(X_ERROR, - ATI_NAME ": Failed to load \"atimisc\" module.\n"); - xf86DeleteScreen(pScrn->scrnIndex, 0); - continue; - } - - xf86LoaderReqSymLists(ATISymbols, NULL); - -#endif - ATIFillInScreenInfo(pScrn); pScrn->Probe = Mach64Probe; diff --git a/src/atimach64probe.h b/src/atimach64probe.h index 4e474ca..fa9e713 100644 --- a/src/atimach64probe.h +++ b/src/atimach64probe.h @@ -26,6 +26,7 @@ #include "xf86str.h" extern const OptionInfoRec * Mach64AvailableOptions(int, int); +extern void Mach64Identify(int); extern Bool Mach64Probe(DriverPtr, int); #endif /* ___ATIMACH64PROBE_H___ */ diff --git a/src/atimodule.c b/src/atimodule.c index 05456e7..6aa9a2e 100644 --- a/src/atimodule.c +++ b/src/atimodule.c @@ -34,47 +34,25 @@ const char *ATISymbols[] = { - "ATIPreInit", - "ATIScreenInit", - "ATISwitchMode", - "ATIAdjustFrame", - "ATIEnterVT", - "ATILeaveVT", - "ATIFreeScreen", - "ATIValidMode", - "ATIOptionsWeak", - "ATIFillInScreenInfo", + "Mach64Identify", + "Mach64Probe", + "Mach64AvailableOptions", NULL }; const char *R128Symbols[] = { - "R128PreInit", - "R128ScreenInit", - "R128SwitchMode", - "R128AdjustFrame", - "R128EnterVT", - "R128LeaveVT", - "R128FreeScreen", - "R128ValidMode", - "R128OptionsWeak", - "R128FillInScreenInfo", + "R128Identify", + "R128Probe", + "R128AvailableOptions", NULL }; const char *RADEONSymbols[] = { - "RADEONPreInit", - "RADEONScreenInit", - "RADEONSwitchMode", - "RADEONAdjustFrame", - "RADEONEnterVT", - "RADEONLeaveVT", - "RADEONFreeScreen", - "RADEONValidMode", - "RADEONOptionsWeak", - "RADEONHandleMessage", - "RADEONFillInScreenInfo", + "RADEONIdentify", + "RADEONProbe", + "RADEONAvailableOptions", NULL }; diff --git a/src/r128_probe.c b/src/r128_probe.c index 96e7897..836f1d0 100644 --- a/src/r128_probe.c +++ b/src/r128_probe.c @@ -107,7 +107,7 @@ PciChipsets R128PciChipsets[] = { int gR128EntityIndex = -1; /* Return the options for supported chipset 'n'; NULL otherwise */ -const OptionInfoRec * +_X_EXPORT const OptionInfoRec * R128AvailableOptions(int chipid, int busid) { int i; @@ -126,7 +126,7 @@ R128AvailableOptions(int chipid, int busid) } /* Return the string name for supported chipset 'n'; NULL otherwise. */ -void +_X_EXPORT void R128Identify(int flags) { xf86PrintChipsets(R128_NAME, @@ -135,7 +135,7 @@ R128Identify(int flags) } /* Return TRUE if chipset is present; FALSE otherwise. */ -Bool +_X_EXPORT Bool R128Probe(DriverPtr drv, int flags) { int numUsed; @@ -194,20 +194,6 @@ R128Probe(DriverPtr drv, int flags) if((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], R128PciChipsets, 0, 0, 0, 0, 0))) { - -#ifdef XFree86LOADER - - if (!xf86LoadSubModule(pScrn, "r128")) { - xf86Msg(X_ERROR, - R128_NAME ": Failed to load \"r128\" module.\n"); - xf86DeleteScreen(pScrn->scrnIndex, 0); - continue; - } - - xf86LoaderReqSymLists(R128Symbols, NULL); - -#endif - pScrn->Probe = R128Probe; R128FillInScreenInfo(pScrn); diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 98b35aa..4ff11ea 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -200,7 +200,7 @@ PciChipsets RADEONPciChipsets[] = { int gRADEONEntityIndex = -1; /* Return the options for supported chipset 'n'; NULL otherwise */ -const OptionInfoRec * +_X_EXPORT const OptionInfoRec * RADEONAvailableOptions(int chipid, int busid) { int i; @@ -219,7 +219,7 @@ RADEONAvailableOptions(int chipid, int busid) } /* Return the string name for supported chipset 'n'; NULL otherwise. */ -void +_X_EXPORT void RADEONIdentify(int flags) { xf86PrintChipsets(RADEON_NAME, @@ -228,7 +228,7 @@ RADEONIdentify(int flags) } /* Return TRUE if chipset is present; FALSE otherwise. */ -Bool +_X_EXPORT Bool RADEONProbe(DriverPtr drv, int flags) { int numUsed; @@ -285,17 +285,6 @@ RADEONProbe(DriverPtr drv, int flags) if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], RADEONPciChipsets, 0, 0, 0, 0, 0))) { -#ifdef XFree86LOADER - if (!xf86LoadSubModule(pScrn, "radeon")) { - xf86Msg(X_ERROR, RADEON_NAME - ": Failed to load \"radeon\" module.\n"); - xf86DeleteScreen(pScrn->scrnIndex, 0); - continue; - } - - xf86LoaderReqSymLists(RADEONSymbols, NULL); -#endif - pScrn->Probe = RADEONProbe; RADEONFillInScreenInfo(pScrn); foundScreen = TRUE; -- cgit v1.2.3 From d7a8cd0e476034796fc38e25a28cd28d05ea4a13 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 23 Mar 2007 22:10:03 +0200 Subject: Drop now unneeded _X_EXPORT's. --- src/atiadjust.c | 2 +- src/aticonfig.c | 2 +- src/aticonsole.c | 8 ++++---- src/atifillin.c | 2 +- src/atipreinit.c | 2 +- src/atiscreen.c | 2 +- src/ativalid.c | 2 +- src/r128_driver.c | 20 ++++++++++---------- src/radeon_driver.c | 22 +++++++++++----------- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/atiadjust.c b/src/atiadjust.c index f01fee6..267186f 100644 --- a/src/atiadjust.c +++ b/src/atiadjust.c @@ -82,7 +82,7 @@ ATIAdjustPreInit * displayed location in video memory. This is used to implement the virtual * window. */ -_X_EXPORT void +void ATIAdjustFrame ( int scrnIndex, diff --git a/src/aticonfig.c b/src/aticonfig.c index a4ceddf..1e119e0 100644 --- a/src/aticonfig.c +++ b/src/aticonfig.c @@ -234,7 +234,7 @@ static const OptionInfoRec ATIPublicOptions[] = static const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions); -_X_EXPORT const OptionInfoRec * +const OptionInfoRec * ATIOptionsWeak(void) { return ATIPublicOptions; } /* diff --git a/src/aticonsole.c b/src/aticonsole.c index 6d0c662..bd5ec9c 100644 --- a/src/aticonsole.c +++ b/src/aticonsole.c @@ -628,7 +628,7 @@ ATILeaveGraphics * * This function switches to another graphics video state. */ -_X_EXPORT Bool +Bool ATISwitchMode ( int iScreen, @@ -681,7 +681,7 @@ ATISwitchMode * * This function sets the server's virtual console to a graphics video state. */ -_X_EXPORT Bool +Bool ATIEnterVT ( int iScreen, @@ -751,7 +751,7 @@ ATIEnterVT * This function restores the server's virtual console to its state on server * entry. */ -_X_EXPORT void +void ATILeaveVT ( int iScreen, @@ -780,7 +780,7 @@ ATILeaveVT * * This function frees all driver data related to a screen. */ -_X_EXPORT void +void ATIFreeScreen ( int iScreen, diff --git a/src/atifillin.c b/src/atifillin.c index dcbcb3c..41d4964 100644 --- a/src/atifillin.c +++ b/src/atifillin.c @@ -31,7 +31,7 @@ #include "atifillin.h" -_X_EXPORT void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo) +void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo) { pScreenInfo->driverVersion = ATI_VERSION_CURRENT; pScreenInfo->driverName = ATI_DRIVER_NAME; diff --git a/src/atipreinit.c b/src/atipreinit.c index 8f80824..7f0c4b2 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -146,7 +146,7 @@ ATIPrintNoiseIfRequested * This function is only called once per screen at the start of the first * server generation. */ -_X_EXPORT Bool +Bool ATIPreInit ( ScrnInfoPtr pScreenInfo, diff --git a/src/atiscreen.c b/src/atiscreen.c index 58b0bda..bc57934 100644 --- a/src/atiscreen.c +++ b/src/atiscreen.c @@ -349,7 +349,7 @@ ATIMach64SetupMemXAA * * This function is called by DIX to initialise the screen. */ -_X_EXPORT Bool +Bool ATIScreenInit ( int iScreen, diff --git a/src/ativalid.c b/src/ativalid.c index 8a92e82..51cf5ae 100644 --- a/src/ativalid.c +++ b/src/ativalid.c @@ -35,7 +35,7 @@ * * This checks for hardware-related limits on mode timings. */ -_X_EXPORT ModeStatus +ModeStatus ATIValidMode ( int iScreen, diff --git a/src/r128_driver.c b/src/r128_driver.c index 81c9015..01276e0 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -182,7 +182,7 @@ static const OptionInfoRec R128Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; -_X_EXPORT const OptionInfoRec *R128OptionsWeak(void) { return R128Options; } +const OptionInfoRec *R128OptionsWeak(void) { return R128Options; } R128RAMRec R128RAM[] = { /* Memory Specifications From RAGE 128 Software Development @@ -2044,7 +2044,7 @@ R128ProbeDDC(ScrnInfoPtr pScrn, int indx) } /* R128PreInit is called once at server startup. */ -_X_EXPORT Bool R128PreInit(ScrnInfoPtr pScrn, int flags) +Bool R128PreInit(ScrnInfoPtr pScrn, int flags) { R128InfoPtr info; xf86Int10InfoPtr pInt10 = NULL; @@ -2334,7 +2334,7 @@ R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) } /* Called at the start of each server generation. */ -_X_EXPORT Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, +Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -4238,7 +4238,7 @@ static Bool R128SaveScreen(ScreenPtr pScreen, int mode) * The workaround is to switch the mode, then switch to another VT, then * switch back. --AGD */ -_X_EXPORT Bool R128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +Bool R128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; R128InfoPtr info = R128PTR(pScrn); @@ -4251,7 +4251,7 @@ _X_EXPORT Bool R128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) } /* Used to disallow modes that are not supported by the hardware. */ -_X_EXPORT ModeStatus R128ValidMode(int scrnIndex, DisplayModePtr mode, +ModeStatus R128ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; @@ -4327,7 +4327,7 @@ _X_EXPORT ModeStatus R128ValidMode(int scrnIndex, DisplayModePtr mode, /* Adjust viewport into virtual desktop such that (0,0) in viewport space is (x,y) in virtual space. */ -_X_EXPORT void R128AdjustFrame(int scrnIndex, int x, int y, int flags) +void R128AdjustFrame(int scrnIndex, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; R128InfoPtr info = R128PTR(pScrn); @@ -4363,7 +4363,7 @@ _X_EXPORT void R128AdjustFrame(int scrnIndex, int x, int y, int flags) /* Called when VT switching back to the X server. Reinitialize the video mode. */ -_X_EXPORT Bool R128EnterVT(int scrnIndex, int flags) +Bool R128EnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; R128InfoPtr info = R128PTR(pScrn); @@ -4396,7 +4396,7 @@ _X_EXPORT Bool R128EnterVT(int scrnIndex, int flags) /* Called when VT switching away from the X server. Restore the original text mode. */ -_X_EXPORT void R128LeaveVT(int scrnIndex, int flags) +void R128LeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; R128InfoPtr info = R128PTR(pScrn); @@ -4466,7 +4466,7 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen) return (*pScreen->CloseScreen)(scrnIndex, pScreen); } -_X_EXPORT void R128FreeScreen(int scrnIndex, int flags) +void R128FreeScreen(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; R128InfoPtr info = R128PTR(pScrn); @@ -4606,7 +4606,7 @@ static int r128_set_backlight_enable(ScrnInfoPtr pScrn, int on) return 0; } -_X_EXPORT void R128FillInScreenInfo(ScrnInfoPtr pScrn) +void R128FillInScreenInfo(ScrnInfoPtr pScrn) { pScrn->driverVersion = R128_VERSION_CURRENT; pScrn->driverName = R128_DRIVER_NAME; diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 9ed0d6c..0a79483 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -203,7 +203,7 @@ static const OptionInfoRec RADEONOptions[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; -_X_EXPORT const OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions; } +const OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions; } #ifdef WITH_VGAHW static const char *vgahwSymbols[] = { @@ -2971,7 +2971,7 @@ RADEONProbeDDC(ScrnInfoPtr pScrn, int indx) } } -_X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) +Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) { RADEONInfoPtr info; xf86Int10InfoPtr pInt10 = NULL; @@ -3759,7 +3759,7 @@ Bool RADEONSetupMemXAA(int scrnIndex, ScreenPtr pScreen) #endif /* USE_XAA */ /* Called at the start of each server generation. */ -_X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, +Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -6516,7 +6516,7 @@ RADEONResetDPI(ScrnInfoPtr pScrn, Bool force) } } -_X_EXPORT Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -6610,7 +6610,7 @@ _X_EXPORT Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) } #ifdef X_XF86MiscPassMessage -_X_EXPORT Bool RADEONHandleMessage(int scrnIndex, const char* msgtype, +Bool RADEONHandleMessage(int scrnIndex, const char* msgtype, const char* msgval, char** retmsg) { ErrorF("RADEONHandleMessage(%d, \"%s\", \"%s\", retmsg)\n", scrnIndex, @@ -6621,7 +6621,7 @@ _X_EXPORT Bool RADEONHandleMessage(int scrnIndex, const char* msgtype, #endif /* Used to disallow modes that are not supported by the hardware */ -_X_EXPORT ModeStatus RADEONValidMode(int scrnIndex, DisplayModePtr mode, +ModeStatus RADEONValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flag) { /* There are problems with double scan mode at high clocks @@ -6754,7 +6754,7 @@ void RADEONDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int clone) } -_X_EXPORT void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags) +void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -6782,7 +6782,7 @@ _X_EXPORT void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags) /* Called when VT switching back to the X server. Reinitialize the * video mode. */ -_X_EXPORT Bool RADEONEnterVT(int scrnIndex, int flags) +Bool RADEONEnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -6853,7 +6853,7 @@ _X_EXPORT Bool RADEONEnterVT(int scrnIndex, int flags) /* Called when VT switching away from the X server. Restore the * original text mode. */ -_X_EXPORT void RADEONLeaveVT(int scrnIndex, int flags) +void RADEONLeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -6981,7 +6981,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen) return (*pScreen->CloseScreen)(scrnIndex, pScreen); } -_X_EXPORT void RADEONFreeScreen(int scrnIndex, int flags) +void RADEONFreeScreen(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -7620,7 +7620,7 @@ static void RADEONSetDynamicClock(ScrnInfoPtr pScrn, int mode) } } -_X_EXPORT void RADEONFillInScreenInfo(ScrnInfoPtr pScrn) +void RADEONFillInScreenInfo(ScrnInfoPtr pScrn) { pScrn->driverVersion = RADEON_VERSION_CURRENT; pScrn->driverName = RADEON_DRIVER_NAME; -- cgit v1.2.3 From 9cd175d9cd4ed710fccb303664c77519ecaf1e21 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 23 Mar 2007 22:12:48 +0200 Subject: Fold FillIn() back to Probe(). --- src/Makefile.am | 3 +-- src/atifillin.c | 47 ----------------------------------------------- src/atifillin.h | 41 ----------------------------------------- src/atimach64probe.c | 45 ++++++++++++++++++++++++++++----------------- src/atiprobe.c | 1 - src/r128_driver.c | 15 --------------- src/r128_probe.c | 13 +++++++++++-- src/r128_probe.h | 2 -- src/radeon_driver.c | 18 ------------------ src/radeon_probe.c | 17 +++++++++++++++-- src/radeon_probe.h | 2 -- 11 files changed, 55 insertions(+), 149 deletions(-) delete mode 100644 src/atifillin.c delete mode 100644 src/atifillin.h diff --git a/src/Makefile.am b/src/Makefile.am index 197c486..1da3740 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -59,7 +59,7 @@ atimisc_drv_ladir = @moduledir@/drivers atimisc_drv_la_SOURCES = \ atibus.c atiprobe.c atividmem.c \ atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \ - atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \ + atidac.c atidecoder.c atidsp.c atii2c.c \ atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \ atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \ @@ -123,7 +123,6 @@ EXTRA_DIST = \ atidri.h \ atidripriv.h \ atidsp.h \ - atifillin.h \ ati.h \ atii2c.h \ atiload.h \ diff --git a/src/atifillin.c b/src/atifillin.c deleted file mode 100644 index 41d4964..0000000 --- a/src/atifillin.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2004 Adam Jackson. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * atifillin.c: fill in a ScrnInfoPtr with the relevant information for - * atimisc. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "atifillin.h" - -void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo) -{ - pScreenInfo->driverVersion = ATI_VERSION_CURRENT; - pScreenInfo->driverName = ATI_DRIVER_NAME; - pScreenInfo->name = ATI_NAME; - pScreenInfo->PreInit = ATIPreInit; - pScreenInfo->ScreenInit = ATIScreenInit; - pScreenInfo->SwitchMode = ATISwitchMode; - pScreenInfo->AdjustFrame = ATIAdjustFrame; - pScreenInfo->EnterVT = ATIEnterVT; - pScreenInfo->LeaveVT = ATILeaveVT; - pScreenInfo->FreeScreen = ATIFreeScreen; - pScreenInfo->ValidMode = ATIValidMode; -} diff --git a/src/atifillin.h b/src/atifillin.h deleted file mode 100644 index 7d5e54d..0000000 --- a/src/atifillin.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2004 Adam Jackson. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * atifillin.h: header for atifillin.c. - */ - -#ifndef ATI_FILLIN_H -#define ATI_FILLIN_H - -/* include headers corresponding to fields touched by ATIFillInScreenInfo() */ - -#include "ativersion.h" -#include "atipreinit.h" -#include "atiscreen.h" -#include "aticonsole.h" -#include "atiadjust.h" -#include "ativalid.h" - -extern void ATIFillInScreenInfo(ScrnInfoPtr); - -#endif diff --git a/src/atimach64probe.c b/src/atimach64probe.c index cff8bfb..043cad9 100644 --- a/src/atimach64probe.c +++ b/src/atimach64probe.c @@ -26,13 +26,18 @@ #include "ati.h" #include "atichip.h" -#include "atifillin.h" -#include "atimodule.h" #include "atimach64io.h" #include "atimach64probe.h" #include "atioption.h" #include "ativersion.h" +/* include headers corresponding to ScrnInfoPtr fields */ +#include "atipreinit.h" +#include "atiscreen.h" +#include "aticonsole.h" +#include "atiadjust.h" +#include "ativalid.h" + static SymTabRec Mach64Chipsets[] = { {ATI_CHIP_88800GXC, "ATI 88800GX-C"}, @@ -135,16 +140,16 @@ Mach64Identify _X_EXPORT Bool Mach64Probe(DriverPtr pDriver, int flags) { - GDevPtr *devSections; - int *usedChips; - int numDevSections; - int numUsed; - Bool ProbeSuccess = FALSE; + GDevPtr *devSections; + int *usedChips; + int numDevSections; + int numUsed; + Bool ProbeSuccess = FALSE; - if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0) + if (xf86GetPciVideoInfo() == NULL) return FALSE; - if (xf86GetPciVideoInfo() == NULL) + if ((numDevSections = xf86MatchDevice(ATI_DRIVER_NAME, &devSections)) <= 0) return FALSE; numUsed = xf86MatchPciInstances(ATI_DRIVER_NAME, PCI_VENDOR_ATI, @@ -163,8 +168,6 @@ Mach64Probe(DriverPtr pDriver, int flags) for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn; - EntityInfoPtr pEnt; - pciVideoPtr pVideo; pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i], Mach64PciChipsets, 0, 0, 0, 0, NULL); @@ -172,16 +175,24 @@ Mach64Probe(DriverPtr pDriver, int flags) if (!pScrn) continue; - pEnt = xf86GetEntityInfo(usedChips[i]); - pVideo = xf86GetPciInfoForEntity(usedChips[i]); - - ATIFillInScreenInfo(pScrn); - - pScrn->Probe = Mach64Probe; + pScrn->driverVersion = ATI_VERSION_CURRENT; + pScrn->driverName = ATI_DRIVER_NAME; + pScrn->name = ATI_NAME; + pScrn->Probe = Mach64Probe; + pScrn->PreInit = ATIPreInit; + pScrn->ScreenInit = ATIScreenInit; + pScrn->SwitchMode = ATISwitchMode; + pScrn->AdjustFrame = ATIAdjustFrame; + pScrn->EnterVT = ATIEnterVT; + pScrn->LeaveVT = ATILeaveVT; + pScrn->FreeScreen = ATIFreeScreen; + pScrn->ValidMode = ATIValidMode; ProbeSuccess = TRUE; } } + xfree(usedChips); + return ProbeSuccess; } diff --git a/src/atiprobe.c b/src/atiprobe.c index 4a70f81..5f22032 100644 --- a/src/atiprobe.c +++ b/src/atiprobe.c @@ -31,7 +31,6 @@ #include "atibus.h" #include "atichip.h" #include "atimach64io.h" -#include "atimodule.h" #include "atiprobe.h" #include "ativersion.h" #include "atividmem.h" diff --git a/src/r128_driver.c b/src/r128_driver.c index 01276e0..b03bd42 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -4605,18 +4605,3 @@ static int r128_set_backlight_enable(ScrnInfoPtr pScrn, int on) return 0; } - -void R128FillInScreenInfo(ScrnInfoPtr pScrn) -{ - pScrn->driverVersion = R128_VERSION_CURRENT; - pScrn->driverName = R128_DRIVER_NAME; - pScrn->name = R128_NAME; - pScrn->PreInit = R128PreInit; - pScrn->ScreenInit = R128ScreenInit; - pScrn->SwitchMode = R128SwitchMode; - pScrn->AdjustFrame = R128AdjustFrame; - pScrn->EnterVT = R128EnterVT; - pScrn->LeaveVT = R128LeaveVT; - pScrn->FreeScreen = R128FreeScreen; - pScrn->ValidMode = R128ValidMode; -} diff --git a/src/r128_probe.c b/src/r128_probe.c index 836f1d0..81ff663 100644 --- a/src/r128_probe.c +++ b/src/r128_probe.c @@ -41,7 +41,6 @@ * Modified by Marc Aurele La France for ATI driver merge. */ -#include "atimodule.h" #include "ativersion.h" #include "r128_probe.h" @@ -194,8 +193,18 @@ R128Probe(DriverPtr drv, int flags) if((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], R128PciChipsets, 0, 0, 0, 0, 0))) { + pScrn->driverVersion = R128_VERSION_CURRENT; + pScrn->driverName = R128_DRIVER_NAME; + pScrn->name = R128_NAME; pScrn->Probe = R128Probe; - R128FillInScreenInfo(pScrn); + pScrn->PreInit = R128PreInit; + pScrn->ScreenInit = R128ScreenInit; + pScrn->SwitchMode = R128SwitchMode; + pScrn->AdjustFrame = R128AdjustFrame; + pScrn->EnterVT = R128EnterVT; + pScrn->LeaveVT = R128LeaveVT; + pScrn->FreeScreen = R128FreeScreen; + pScrn->ValidMode = R128ValidMode; foundScreen = TRUE; diff --git a/src/r128_probe.h b/src/r128_probe.h index 9150296..180e52a 100644 --- a/src/r128_probe.h +++ b/src/r128_probe.h @@ -73,6 +73,4 @@ extern ModeStatus R128ValidMode(int, DisplayModePtr, Bool, int); extern const OptionInfoRec * R128OptionsWeak(void); -extern void R128FillInScreenInfo(ScrnInfoPtr); - #endif /* _R128_PROBE_H_ */ diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 0a79483..28580a5 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -7619,21 +7619,3 @@ static void RADEONSetDynamicClock(ScrnInfoPtr pScrn, int mode) break; } } - -void RADEONFillInScreenInfo(ScrnInfoPtr pScrn) -{ - pScrn->driverVersion = RADEON_VERSION_CURRENT; - pScrn->driverName = RADEON_DRIVER_NAME; - pScrn->name = RADEON_NAME; - pScrn->PreInit = RADEONPreInit; - pScrn->ScreenInit = RADEONScreenInit; - pScrn->SwitchMode = RADEONSwitchMode; -#ifdef X_XF86MiscPassMessage - pScrn->HandleMessage = RADEONHandleMessage; -#endif - pScrn->AdjustFrame = RADEONAdjustFrame; - pScrn->EnterVT = RADEONEnterVT; - pScrn->LeaveVT = RADEONLeaveVT; - pScrn->FreeScreen = RADEONFreeScreen; - pScrn->ValidMode = RADEONValidMode; -} diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 4ff11ea..d7ff643 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -40,7 +40,6 @@ * Modified by Marc Aurele La France for ATI driver merge. */ -#include "atimodule.h" #include "ativersion.h" #include "radeon_probe.h" @@ -285,8 +284,22 @@ RADEONProbe(DriverPtr drv, int flags) if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], RADEONPciChipsets, 0, 0, 0, 0, 0))) { + pScrn->driverVersion = RADEON_VERSION_CURRENT; + pScrn->driverName = RADEON_DRIVER_NAME; + pScrn->name = RADEON_NAME; pScrn->Probe = RADEONProbe; - RADEONFillInScreenInfo(pScrn); + pScrn->PreInit = RADEONPreInit; + pScrn->ScreenInit = RADEONScreenInit; + pScrn->SwitchMode = RADEONSwitchMode; +#ifdef X_XF86MiscPassMessage + pScrn->HandleMessage = RADEONHandleMessage; +#endif + pScrn->AdjustFrame = RADEONAdjustFrame; + pScrn->EnterVT = RADEONEnterVT; + pScrn->LeaveVT = RADEONLeaveVT; + pScrn->FreeScreen = RADEONFreeScreen; + pScrn->ValidMode = RADEONValidMode; + foundScreen = TRUE; } diff --git a/src/radeon_probe.h b/src/radeon_probe.h index b651e7d..f446516 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -172,6 +172,4 @@ extern ModeStatus RADEONValidMode(int, DisplayModePtr, Bool, int); extern const OptionInfoRec *RADEONOptionsWeak(void); -extern void RADEONFillInScreenInfo(ScrnInfoPtr); - #endif /* _RADEON_PROBE_H_ */ -- cgit v1.2.3 From f046a910ca117279fbabc6281b2e23439ec9ea4e Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 23 Mar 2007 22:19:17 +0200 Subject: Drop probing by driver name from "Device" section. atimisc is PCI-only now, so we only need to scan the PCI space. --- src/ati.c | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/src/ati.c b/src/ati.c index fa7d9e8..4ef53e3 100644 --- a/src/ati.c +++ b/src/ati.c @@ -101,44 +101,31 @@ ATIProbe int flags ) { - pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); + pciVideoPtr pVideo; + pciVideoPtr *xf86PciVideoInfo; Bool DoMach64 = FALSE; Bool DoRage128 = FALSE, DoRadeon = FALSE; - int i; ATIChipType Chip; - if (!(flags & PROBE_DETECT)) - { - if (xf86MatchDevice(ATI_NAME, NULL) > 0) - DoMach64 = TRUE; - if (xf86MatchDevice(R128_NAME, NULL) > 0) - DoRage128 = TRUE; - if (xf86MatchDevice(RADEON_NAME, NULL) > 0) - DoRadeon = TRUE; - } + xf86PciVideoInfo = xf86GetPciVideoInfo(); - if (xf86PciVideoInfo) + if (xf86PciVideoInfo == NULL) + return FALSE; + + while ((pVideo = *xf86PciVideoInfo++) != NULL) { - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType == PCI_CHIP_MACH32)) - continue; - - /* Check for Rage128's, Radeon's and later adapters */ - Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - if (Chip > ATI_CHIP_Mach64) - { - if (Chip <= ATI_CHIP_Rage128) - DoRage128 = TRUE; - else if (Chip <= ATI_CHIP_Radeon) - DoRadeon = TRUE; - - continue; - } + if ((pVideo->vendor != PCI_VENDOR_ATI) || + (pVideo->chipType == PCI_CHIP_MACH32)) + continue; + /* Check for Rage128's, Radeon's and later adapters */ + Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); + if (Chip <= ATI_CHIP_Mach64) DoMach64 = TRUE; - } + else if (Chip <= ATI_CHIP_Rage128) + DoRage128 = TRUE; + else if (Chip <= ATI_CHIP_Radeon) + DoRadeon = TRUE; } /* Call Radeon driver probe */ -- cgit v1.2.3 From 39e896a1e688ea2d2d21f88c1c5d34c5810aac1c Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Mar 2007 19:47:18 +0200 Subject: [mach64] Set pATI->ChipRevision correctly, instead of overriding. There is no need to override pATI->ChipRevision for GX/CX, as it is only reported with a printf. --- src/atichip.c | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/src/atichip.c b/src/atichip.c index ddc7e0a..6ef423b 100644 --- a/src/atichip.c +++ b/src/atichip.c @@ -115,18 +115,18 @@ ATIMach64ChipID ) { pATI->config_chip_id = inr(CONFIG_CHIP_ID); - pATI->ChipType = GetBits(pATI->config_chip_id, 0xFFFFU); + pATI->ChipType = GetBits(pATI->config_chip_id, CFG_CHIP_TYPE); pATI->ChipClass = GetBits(pATI->config_chip_id, CFG_CHIP_CLASS); - pATI->ChipRevision = GetBits(pATI->config_chip_id, CFG_CHIP_REV); + pATI->ChipRev = GetBits(pATI->config_chip_id, CFG_CHIP_REV); pATI->ChipVersion = GetBits(pATI->config_chip_id, CFG_CHIP_VERSION); pATI->ChipFoundry = GetBits(pATI->config_chip_id, CFG_CHIP_FOUNDRY); - pATI->ChipRev = pATI->ChipRevision; + pATI->ChipRevision = GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); switch (pATI->ChipType) { case OldChipID('G', 'X'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'X'): - switch (pATI->ChipRevision) + switch (pATI->ChipRev) { case 0x00U: pATI->Chip = ATI_CHIP_88800GXC; @@ -159,8 +159,6 @@ ATIMach64ChipID case OldChipID('C', 'T'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('C', 'T'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264CT; pATI->BusType = ATI_BUS_PCI; break; @@ -168,8 +166,6 @@ ATIMach64ChipID case OldChipID('E', 'T'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('E', 'T'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264ET; pATI->BusType = ATI_BUS_PCI; break; @@ -177,8 +173,6 @@ ATIMach64ChipID case OldChipID('V', 'T'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('V', 'T'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264VT; pATI->BusType = ATI_BUS_PCI; /* Some early GT's are detected as VT's */ @@ -199,8 +193,6 @@ ATIMach64ChipID case OldChipID('G', 'T'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'T'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->BusType = ATI_BUS_PCI; if (!pATI->ChipVersion) pATI->Chip = ATI_CHIP_264GT; @@ -211,8 +203,6 @@ ATIMach64ChipID case OldChipID('V', 'U'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('V', 'U'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264VT3; pATI->BusType = ATI_BUS_PCI; break; @@ -220,8 +210,6 @@ ATIMach64ChipID case OldChipID('G', 'U'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'U'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264GTDVD; pATI->BusType = ATI_BUS_PCI; break; @@ -229,8 +217,6 @@ ATIMach64ChipID case OldChipID('L', 'G'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('L', 'G'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264LT; pATI->BusType = ATI_BUS_PCI; break; @@ -238,8 +224,6 @@ ATIMach64ChipID case OldChipID('V', 'V'): pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('V', 'V'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264VT4; pATI->BusType = ATI_BUS_PCI; break; @@ -249,8 +233,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'V'): case NewChipID('G', 'Y'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264GT2C; pATI->BusType = ATI_BUS_PCI; break; @@ -260,8 +242,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'W'): case NewChipID('G', 'Z'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264GT2C; pATI->BusType = ATI_BUS_AGP; break; @@ -273,8 +253,6 @@ ATIMach64ChipID case NewChipID('G', 'I'): case NewChipID('G', 'P'): case NewChipID('G', 'Q'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264GTPRO; pATI->BusType = ATI_BUS_PCI; break; @@ -284,8 +262,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'B'): case NewChipID('G', 'D'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264GTPRO; pATI->BusType = ATI_BUS_AGP; break; @@ -297,8 +273,6 @@ ATIMach64ChipID case NewChipID('L', 'I'): case NewChipID('L', 'P'): case NewChipID('L', 'Q'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264LTPRO; pATI->BusType = ATI_BUS_PCI; pATI->LCDVBlendFIFOSize = 800; @@ -309,8 +283,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('L', 'B'): case NewChipID('L', 'D'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264LTPRO; pATI->BusType = ATI_BUS_AGP; pATI->LCDVBlendFIFOSize = 800; @@ -325,8 +297,6 @@ ATIMach64ChipID case NewChipID('G', 'O'): case NewChipID('G', 'R'): case NewChipID('G', 'S'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264XL; pATI->BusType = ATI_BUS_PCI; pATI->LCDVBlendFIFOSize = 1024; @@ -337,8 +307,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('G', 'M'): case NewChipID('G', 'N'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_264XL; pATI->BusType = ATI_BUS_AGP; pATI->LCDVBlendFIFOSize = 1024; @@ -349,8 +317,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('L', 'R'): case NewChipID('L', 'S'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_MOBILITY; pATI->BusType = ATI_BUS_PCI; pATI->LCDVBlendFIFOSize = 1024; @@ -361,8 +327,6 @@ ATIMach64ChipID pATI->ChipType = OldToNewChipID(pATI->ChipType); case NewChipID('L', 'M'): case NewChipID('L', 'N'): - pATI->ChipRevision = - GetBits(pATI->config_chip_id, CFG_CHIP_REVISION); pATI->Chip = ATI_CHIP_MOBILITY; pATI->BusType = ATI_BUS_AGP; pATI->LCDVBlendFIFOSize = 1024; -- cgit v1.2.3 From aa8f5b02ebc9be60df48722588261627d6a457e8 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Mar 2007 19:53:02 +0200 Subject: [mach64] Use Mach64Chipsets[] instead of ATIChipNames[]. atimisc is PCI-only now, we can get the chip name with xf86TokenToString(). --- src/atimach64probe.c | 2 +- src/atimach64probe.h | 2 ++ src/atipreinit.c | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/atimach64probe.c b/src/atimach64probe.c index 043cad9..c5330cc 100644 --- a/src/atimach64probe.c +++ b/src/atimach64probe.c @@ -38,7 +38,7 @@ #include "atiadjust.h" #include "ativalid.h" -static SymTabRec +SymTabRec Mach64Chipsets[] = { {ATI_CHIP_88800GXC, "ATI 88800GX-C"}, {ATI_CHIP_88800GXD, "ATI 88800GX-D"}, diff --git a/src/atimach64probe.h b/src/atimach64probe.h index fa9e713..65ced98 100644 --- a/src/atimach64probe.h +++ b/src/atimach64probe.h @@ -25,6 +25,8 @@ #include "xf86str.h" +extern SymTabRec Mach64Chipsets[]; + extern const OptionInfoRec * Mach64AvailableOptions(int, int); extern void Mach64Identify(int); extern Bool Mach64Probe(DriverPtr, int); diff --git a/src/atipreinit.c b/src/atipreinit.c index 7f0c4b2..d960e88 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -41,6 +41,7 @@ #include "atimach64.h" #include "atimach64accel.h" #include "atimach64io.h" +#include "atimach64probe.h" #include "atimode.h" #include "atioption.h" #include "atipreinit.h" @@ -982,7 +983,8 @@ ATIPreInit /* Report what was found */ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, - "%s graphics controller detected.\n", ATIChipNames[pATI->Chip]); + "%s graphics controller detected.\n", + xf86TokenToString(Mach64Chipsets, pATI->Chip)); { Message = Buffer + snprintf(Buffer, SizeOf(Buffer), "Chip type %04X", -- cgit v1.2.3 From 97d8d1ed10d069343f2b3172ba64ca421821a602 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 24 Mar 2007 20:02:12 +0200 Subject: Move atichip.c from ati to atimisc. --- src/Makefile.am | 4 +- src/ati.c | 469 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/ati.h | 72 +++++++++ src/atichip.c | 464 ------------------------------------------------------- src/atichip.h | 71 --------- 5 files changed, 540 insertions(+), 540 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1da3740..84642f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,13 +51,13 @@ ati_drv_la_LTLIBRARIES = ati_drv.la ati_drv_la_LDFLAGS = -module -avoid-version ati_drv_ladir = @moduledir@/drivers ati_drv_la_SOURCES = \ - ati.c atichip.c atimodule.c + ati.c atimodule.c atimisc_drv_la_LTLIBRARIES = atimisc_drv.la atimisc_drv_la_LDFLAGS = -module -avoid-version atimisc_drv_ladir = @moduledir@/drivers atimisc_drv_la_SOURCES = \ - atibus.c atiprobe.c atividmem.c \ + atibus.c atichip.c atiprobe.c atividmem.c \ atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \ atidac.c atidecoder.c atidsp.c atii2c.c \ atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ diff --git a/src/ati.c b/src/ati.c index 4ef53e3..423fd95 100644 --- a/src/ati.c +++ b/src/ati.c @@ -58,15 +58,12 @@ #endif #include "ati.h" -#include "atichip.h" #include "atimodule.h" #include "ativersion.h" #include "atimach64probe.h" #include "radeon_probe.h" -#include "radeon_version.h" #include "r128_probe.h" -#include "r128_version.h" /* * ATIIdentify -- @@ -236,3 +233,469 @@ _X_EXPORT DriverRec ATI = NULL, 0 }; + +/* + * Chip-related definitions. + */ +const char *ATIChipNames[] = +{ + "Unknown", + "ATI 88800GX-C", + "ATI 88800GX-D", + "ATI 88800GX-E", + "ATI 88800GX-F", + "ATI 88800GX", + "ATI 88800CX", + "ATI 264CT", + "ATI 264ET", + "ATI 264VT", + "ATI 3D Rage", + "ATI 264VT-B", + "ATI 3D Rage II", + "ATI 264VT3", + "ATI 3D Rage II+DVD", + "ATI 3D Rage LT", + "ATI 264VT4", + "ATI 3D Rage IIc", + "ATI 3D Rage Pro", + "ATI 3D Rage LT Pro", + "ATI 3D Rage XL or XC", + "ATI 3D Rage Mobility", + "ATI unknown Mach64", + "ATI Rage 128 GL", + "ATI Rage 128 VR", + "ATI Rage 128 Pro GL", + "ATI Rage 128 Pro VR", + "ATI Rage 128 Pro ULTRA", + "ATI Rage 128 Mobility M3", + "ATI Rage 128 Mobility M4", + "ATI unknown Rage 128" + "ATI Radeon 7200", + "ATI Radeon 7000 (VE)", + "ATI Radeon Mobility M6", + "ATI Radeon IGP320", + "ATI Radeon IGP330/340/350", + "ATI Radeon 7000 IGP", + "ATI Radeon 7500", + "ATI Radeon Mobility M7", + "ATI Radeon 8500/9100", + "ATI Radeon 9000", + "ATI Radeon Mobility M9", + "ATI Radeon 9100 IGP", + "ATI Radeon 9200 IGP", + "ATI Radeon 9200", + "ATI Radeon Mobility M9+", + "ATI Radeon 9700/9500", + "ATI Radeon 9600/9550", + "ATI Radeon 9800", + "ATI Radeon 9800XT", + "ATI Radeon X300/X550/M22", + "ATI Radeon X600/X550/M24", + "ATI Radeon X800/M18 AGP", + "ATI Radeon X800/M28 PCIE", + "ATI Radeon X800XL PCIE", + "ATI Radeon X850 PCIE", + "ATI Radeon X850 AGP", + "ATI Radeon X700", + "ATI Xpress 200" + "ATI unknown Radeon", + "ATI Rage HDTV" +}; + +#include "atichip.h" + +/* + * ATIChipID -- + * + * This returns the ATI_CHIP_* value (generally) associated with a particular + * ChipID/ChipRev combination. + */ +ATIChipType +ATIChipID +( + const CARD16 ChipID, + const CARD8 ChipRev +) +{ + switch (ChipID) + { + case OldChipID('G', 'X'): case NewChipID('G', 'X'): + switch (ChipRev) + { + case 0x00U: + return ATI_CHIP_88800GXC; + + case 0x01U: + return ATI_CHIP_88800GXD; + + case 0x02U: + return ATI_CHIP_88800GXE; + + case 0x03U: + return ATI_CHIP_88800GXF; + + default: + return ATI_CHIP_88800GX; + } + + case OldChipID('C', 'X'): case NewChipID('C', 'X'): + return ATI_CHIP_88800CX; + + case OldChipID('C', 'T'): case NewChipID('C', 'T'): + return ATI_CHIP_264CT; + + case OldChipID('E', 'T'): case NewChipID('E', 'T'): + return ATI_CHIP_264ET; + + case OldChipID('V', 'T'): case NewChipID('V', 'T'): + /* For simplicity, ignore ChipID discrepancy that can occur here */ + if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) + return ATI_CHIP_264VT; + return ATI_CHIP_264VTB; + + case OldChipID('G', 'T'): case NewChipID('G', 'T'): + if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) + return ATI_CHIP_264GT; + return ATI_CHIP_264GTB; + + case OldChipID('V', 'U'): case NewChipID('V', 'U'): + return ATI_CHIP_264VT3; + + case OldChipID('G', 'U'): case NewChipID('G', 'U'): + return ATI_CHIP_264GTDVD; + + case OldChipID('L', 'G'): case NewChipID('L', 'G'): + return ATI_CHIP_264LT; + + case OldChipID('V', 'V'): case NewChipID('V', 'V'): + return ATI_CHIP_264VT4; + + case OldChipID('G', 'V'): case NewChipID('G', 'V'): + case OldChipID('G', 'W'): case NewChipID('G', 'W'): + case OldChipID('G', 'Y'): case NewChipID('G', 'Y'): + case OldChipID('G', 'Z'): case NewChipID('G', 'Z'): + return ATI_CHIP_264GT2C; + + case OldChipID('G', 'B'): case NewChipID('G', 'B'): + case OldChipID('G', 'D'): case NewChipID('G', 'D'): + case OldChipID('G', 'I'): case NewChipID('G', 'I'): + case OldChipID('G', 'P'): case NewChipID('G', 'P'): + case OldChipID('G', 'Q'): case NewChipID('G', 'Q'): + return ATI_CHIP_264GTPRO; + + case OldChipID('L', 'B'): case NewChipID('L', 'B'): + case OldChipID('L', 'D'): case NewChipID('L', 'D'): + case OldChipID('L', 'I'): case NewChipID('L', 'I'): + case OldChipID('L', 'P'): case NewChipID('L', 'P'): + case OldChipID('L', 'Q'): case NewChipID('L', 'Q'): + return ATI_CHIP_264LTPRO; + + case OldChipID('G', 'L'): case NewChipID('G', 'L'): + case OldChipID('G', 'M'): case NewChipID('G', 'M'): + case OldChipID('G', 'N'): case NewChipID('G', 'N'): + case OldChipID('G', 'O'): case NewChipID('G', 'O'): + case OldChipID('G', 'R'): case NewChipID('G', 'R'): + case OldChipID('G', 'S'): case NewChipID('G', 'S'): + return ATI_CHIP_264XL; + + case OldChipID('L', 'M'): case NewChipID('L', 'M'): + case OldChipID('L', 'N'): case NewChipID('L', 'N'): + case OldChipID('L', 'R'): case NewChipID('L', 'R'): + case OldChipID('L', 'S'): case NewChipID('L', 'S'): + return ATI_CHIP_MOBILITY; + + case NewChipID('R', 'E'): + case NewChipID('R', 'F'): + case NewChipID('R', 'G'): + case NewChipID('S', 'K'): + case NewChipID('S', 'L'): + case NewChipID('S', 'M'): + /* "SN" is listed as ATI_CHIP_RAGE128_4X in ATI docs */ + case NewChipID('S', 'N'): + return ATI_CHIP_RAGE128GL; + + case NewChipID('R', 'K'): + case NewChipID('R', 'L'): + /* + * ATI documentation lists SE/SF/SG under both ATI_CHIP_RAGE128VR + * and ATI_CHIP_RAGE128_4X, and lists SH/SK/SL under Rage 128 4X only. + * I'm stuffing them here for now until this can be clarified as ATI + * documentation doesn't mention their details. + */ + case NewChipID('S', 'E'): + case NewChipID('S', 'F'): + case NewChipID('S', 'G'): + case NewChipID('S', 'H'): + return ATI_CHIP_RAGE128VR; + + /* case NewChipID('S', 'H'): */ + /* case NewChipID('S', 'K'): */ + /* case NewChipID('S', 'L'): */ + /* case NewChipID('S', 'N'): */ + /* return ATI_CHIP_RAGE128_4X; */ + + case NewChipID('P', 'A'): + case NewChipID('P', 'B'): + case NewChipID('P', 'C'): + case NewChipID('P', 'D'): + case NewChipID('P', 'E'): + case NewChipID('P', 'F'): + return ATI_CHIP_RAGE128PROGL; + + case NewChipID('P', 'G'): + case NewChipID('P', 'H'): + case NewChipID('P', 'I'): + case NewChipID('P', 'J'): + case NewChipID('P', 'K'): + case NewChipID('P', 'L'): + case NewChipID('P', 'M'): + case NewChipID('P', 'N'): + case NewChipID('P', 'O'): + case NewChipID('P', 'P'): + case NewChipID('P', 'Q'): + case NewChipID('P', 'R'): + case NewChipID('P', 'S'): + case NewChipID('P', 'T'): + case NewChipID('P', 'U'): + case NewChipID('P', 'V'): + case NewChipID('P', 'W'): + case NewChipID('P', 'X'): + return ATI_CHIP_RAGE128PROVR; + + case NewChipID('T', 'F'): + case NewChipID('T', 'L'): + case NewChipID('T', 'R'): + case NewChipID('T', 'S'): + case NewChipID('T', 'T'): + case NewChipID('T', 'U'): + return ATI_CHIP_RAGE128PROULTRA; + + case NewChipID('L', 'E'): + case NewChipID('L', 'F'): + /* + * "LK" and "LL" are not in any ATI documentation I can find + * - mharris + */ + case NewChipID('L', 'K'): + case NewChipID('L', 'L'): + return ATI_CHIP_RAGE128MOBILITY3; + + case NewChipID('M', 'F'): + case NewChipID('M', 'L'): + return ATI_CHIP_RAGE128MOBILITY4; + + case NewChipID('Q', 'D'): + case NewChipID('Q', 'E'): + case NewChipID('Q', 'F'): + case NewChipID('Q', 'G'): + return ATI_CHIP_RADEON; + + case NewChipID('Q', 'Y'): + case NewChipID('Q', 'Z'): + case NewChipID('Q', '^'): + return ATI_CHIP_RADEONVE; + + case NewChipID('L', 'Y'): + case NewChipID('L', 'Z'): + return ATI_CHIP_RADEONMOBILITY6; + + case NewChipID('A', '6'): + case NewChipID('C', '6'): + return ATI_CHIP_RS100; + + case NewChipID('A', '7'): + case NewChipID('C', '7'): + return ATI_CHIP_RS200; + + case NewChipID('D', '7'): + case NewChipID('B', '7'): + return ATI_CHIP_RS250; + + case NewChipID('L', 'W'): + case NewChipID('L', 'X'): + return ATI_CHIP_RADEONMOBILITY7; + + case NewChipID('Q', 'H'): + case NewChipID('Q', 'I'): + case NewChipID('Q', 'J'): + case NewChipID('Q', 'K'): + case NewChipID('Q', 'L'): + case NewChipID('Q', 'M'): + case NewChipID('Q', 'N'): + case NewChipID('Q', 'O'): + case NewChipID('Q', 'h'): + case NewChipID('Q', 'i'): + case NewChipID('Q', 'j'): + case NewChipID('Q', 'k'): + case NewChipID('Q', 'l'): + case NewChipID('B', 'B'): + return ATI_CHIP_R200; + + case NewChipID('Q', 'W'): + case NewChipID('Q', 'X'): + return ATI_CHIP_RV200; + + case NewChipID('I', 'f'): + case NewChipID('I', 'g'): + return ATI_CHIP_RV250; + + case NewChipID('L', 'd'): + case NewChipID('L', 'f'): + case NewChipID('L', 'g'): + return ATI_CHIP_RADEONMOBILITY9; + + case NewChipID('X', '4'): + case NewChipID('X', '5'): + return ATI_CHIP_RS300; + + case NewChipID('x', '4'): + case NewChipID('x', '5'): + return ATI_CHIP_RS350; + + case NewChipID('Y', '\''): + case NewChipID('Y', 'a'): + case NewChipID('Y', 'b'): + case NewChipID('Y', 'd'): + case NewChipID('Y', 'e'): + return ATI_CHIP_RV280; + + case NewChipID('\\', 'a'): + case NewChipID('\\', 'c'): + return ATI_CHIP_RADEONMOBILITY9PLUS; + + case NewChipID('A', 'D'): + case NewChipID('A', 'E'): + case NewChipID('A', 'F'): + case NewChipID('A', 'G'): + case NewChipID('N', 'D'): + case NewChipID('N', 'E'): + case NewChipID('N', 'F'): + 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('A', 'P'): + case NewChipID('A', 'Q'): + case NewChipID('A', 'R'): + case NewChipID('A', 'S'): + case NewChipID('A', 'T'): + case NewChipID('A', 'U'): + 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('[', '\''): + case NewChipID('[', 'b'): + case NewChipID('[', 'c'): + case NewChipID('[', 'd'): + case NewChipID('[', 'e'): + case NewChipID('T', '\''): + case NewChipID('T', 'b'): + case NewChipID('T', 'd'): + return ATI_CHIP_RV370; + + case NewChipID('>', 'P'): + case NewChipID('>', 'T'): + case NewChipID('1', 'P'): + case NewChipID('1', 'R'): + case NewChipID('1', 'T'): + return ATI_CHIP_RV380; + + case NewChipID('J', 'H'): + case NewChipID('J', 'I'): + case NewChipID('J', 'J'): + case NewChipID('J', 'K'): + case NewChipID('J', 'L'): + case NewChipID('J', 'M'): + case NewChipID('J', 'N'): + case NewChipID('J', 'O'): + case NewChipID('J', 'P'): + case NewChipID('J', 'T'): + return ATI_CHIP_R420; + + case NewChipID('U', 'H'): + case NewChipID('U', 'I'): + case NewChipID('U', 'J'): + case NewChipID('U', 'K'): + case NewChipID('U', 'P'): + case NewChipID('U', 'Q'): + case NewChipID('U', 'R'): + case NewChipID('U', 'T'): + case NewChipID(']', 'W'): + /* those are m28, not 100% certain they are r423 could + be r480 but not r430 as their pci id names indicate... */ + case NewChipID(']', 'H'): + case NewChipID(']', 'I'): + case NewChipID(']', 'J'): + return ATI_CHIP_R423; + + case NewChipID('U', 'L'): + case NewChipID('U', 'M'): + case NewChipID('U', 'N'): + case NewChipID('U', 'O'): + return ATI_CHIP_R430; + + case NewChipID(']', 'L'): + case NewChipID(']', 'M'): + case NewChipID(']', 'N'): + case NewChipID(']', 'O'): + case NewChipID(']', 'P'): + case NewChipID(']', 'R'): + return ATI_CHIP_R480; + + case NewChipID('K', 'I'): + case NewChipID('K', 'J'): + case NewChipID('K', 'K'): + case NewChipID('K', 'L'): + return ATI_CHIP_R481; + + case NewChipID('^', 'H'): + case NewChipID('^', 'J'): + case NewChipID('^', 'K'): + case NewChipID('^', 'L'): + case NewChipID('^', 'M'): + case NewChipID('^', 'O'): + case NewChipID('V', 'J'): + case NewChipID('V', 'K'): + case NewChipID('V', 'O'): + case NewChipID('V', 'R'): + case NewChipID('V', 'S'): + return ATI_CHIP_RV410; + + case NewChipID('Z', 'A'): + case NewChipID('Z', 'B'): + case NewChipID('Z', 'a'): + case NewChipID('Z', 'b'): + case NewChipID('Y', 'T'): + case NewChipID('Y', 'U'): + case NewChipID('Y', 't'): + case NewChipID('Y', 'u'): + return ATI_CHIP_RS400; + + case NewChipID('H', 'D'): + return ATI_CHIP_HDTV; + + default: + /* + * Treat anything else as an unknown Radeon. Please keep the above + * up-to-date however, as it serves as a central chip list. + */ + return ATI_CHIP_Radeon; + } +} diff --git a/src/ati.h b/src/ati.h index fbb8521..48ab1cd 100644 --- a/src/ati.h +++ b/src/ati.h @@ -33,4 +33,76 @@ extern DriverRec ATI; +/* + * Chip-related definitions. + */ +typedef enum +{ + ATI_CHIP_NONE = 0, + ATI_CHIP_88800GXC, /* Mach64 */ + ATI_CHIP_88800GXD, /* Mach64 */ + ATI_CHIP_88800GXE, /* Mach64 */ + ATI_CHIP_88800GXF, /* Mach64 */ + ATI_CHIP_88800GX, /* Mach64 */ + ATI_CHIP_88800CX, /* Mach64 */ + ATI_CHIP_264CT, /* Mach64 */ + ATI_CHIP_264ET, /* Mach64 */ + ATI_CHIP_264VT, /* Mach64 */ + ATI_CHIP_264GT, /* Mach64 */ + ATI_CHIP_264VTB, /* Mach64 */ + ATI_CHIP_264GTB, /* Mach64 */ + ATI_CHIP_264VT3, /* Mach64 */ + ATI_CHIP_264GTDVD, /* Mach64 */ + ATI_CHIP_264LT, /* Mach64 */ + ATI_CHIP_264VT4, /* Mach64 */ + ATI_CHIP_264GT2C, /* Mach64 */ + ATI_CHIP_264GTPRO, /* Mach64 */ + ATI_CHIP_264LTPRO, /* Mach64 */ + ATI_CHIP_264XL, /* Mach64 */ + ATI_CHIP_MOBILITY, /* Mach64 */ + ATI_CHIP_Mach64, /* Last among Mach64's */ + ATI_CHIP_RAGE128GL, /* Rage128 */ + ATI_CHIP_RAGE128VR, /* Rage128 */ + ATI_CHIP_RAGE128PROGL, /* Rage128 */ + ATI_CHIP_RAGE128PROVR, /* Rage128 */ + ATI_CHIP_RAGE128PROULTRA, /* Rage128 */ + ATI_CHIP_RAGE128MOBILITY3, /* Rage128 */ + ATI_CHIP_RAGE128MOBILITY4, /* Rage128 */ + ATI_CHIP_Rage128, /* Last among Rage128's */ + ATI_CHIP_RADEON, /* Radeon */ + ATI_CHIP_RADEONVE, /* Radeon VE */ + ATI_CHIP_RADEONMOBILITY6, /* Radeon M6 */ + ATI_CHIP_RS100, /* IGP320 */ + ATI_CHIP_RS200, /* IGP340 */ + ATI_CHIP_RS250, /* Radoen 7000 IGP */ + ATI_CHIP_RV200, /* RV200 */ + ATI_CHIP_RADEONMOBILITY7, /* Radeon M7 */ + ATI_CHIP_R200, /* R200 */ + ATI_CHIP_RV250, /* RV250 */ + ATI_CHIP_RADEONMOBILITY9, /* Radeon M9 */ + ATI_CHIP_RS300, /* Radoen 9100 IGP */ + ATI_CHIP_RS350, /* Radoen 9200 IGP */ + ATI_CHIP_RV280, /* RV250 */ + ATI_CHIP_RADEONMOBILITY9PLUS, /* Radeon M9+ */ + ATI_CHIP_R300, /* R300 */ + ATI_CHIP_RV350, /* RV350/M10/M11 */ + ATI_CHIP_R350, /* R350 */ + ATI_CHIP_R360, /* R360 */ + ATI_CHIP_RV370, /* RV370/M22 */ + ATI_CHIP_RV380, /* RV380/M24 */ + ATI_CHIP_R420, /* R420/M18 */ + ATI_CHIP_R423, /* R423/M28? */ + ATI_CHIP_R430, /* R430 */ + ATI_CHIP_R480, /* R480/M28? */ + ATI_CHIP_R481, /* R481 */ + ATI_CHIP_RV410, /* RV410, M26 */ + ATI_CHIP_RS400, /* RS400, RS410, RS480, RS482, ... */ + ATI_CHIP_Radeon, /* Last among Radeon's */ + ATI_CHIP_HDTV /* HDTV */ +} ATIChipType; + +extern const char *ATIChipNames[]; + +extern ATIChipType ATIChipID(const CARD16, const CARD8); + #endif /* ___ATI_H___ */ diff --git a/src/atichip.c b/src/atichip.c index 6ef423b..5f8a221 100644 --- a/src/atichip.c +++ b/src/atichip.c @@ -30,74 +30,6 @@ #include "atimach64io.h" #include "ativersion.h" -/* - * Chip-related definitions. - */ -const char *ATIChipNames[] = -{ - "Unknown", - "ATI 88800GX-C", - "ATI 88800GX-D", - "ATI 88800GX-E", - "ATI 88800GX-F", - "ATI 88800GX", - "ATI 88800CX", - "ATI 264CT", - "ATI 264ET", - "ATI 264VT", - "ATI 3D Rage", - "ATI 264VT-B", - "ATI 3D Rage II", - "ATI 264VT3", - "ATI 3D Rage II+DVD", - "ATI 3D Rage LT", - "ATI 264VT4", - "ATI 3D Rage IIc", - "ATI 3D Rage Pro", - "ATI 3D Rage LT Pro", - "ATI 3D Rage XL or XC", - "ATI 3D Rage Mobility", - "ATI unknown Mach64", - "ATI Rage 128 GL", - "ATI Rage 128 VR", - "ATI Rage 128 Pro GL", - "ATI Rage 128 Pro VR", - "ATI Rage 128 Pro ULTRA", - "ATI Rage 128 Mobility M3", - "ATI Rage 128 Mobility M4", - "ATI unknown Rage 128" - "ATI Radeon 7200", - "ATI Radeon 7000 (VE)", - "ATI Radeon Mobility M6", - "ATI Radeon IGP320", - "ATI Radeon IGP330/340/350", - "ATI Radeon 7000 IGP", - "ATI Radeon 7500", - "ATI Radeon Mobility M7", - "ATI Radeon 8500/9100", - "ATI Radeon 9000", - "ATI Radeon Mobility M9", - "ATI Radeon 9100 IGP", - "ATI Radeon 9200 IGP", - "ATI Radeon 9200", - "ATI Radeon Mobility M9+", - "ATI Radeon 9700/9500", - "ATI Radeon 9600/9550", - "ATI Radeon 9800", - "ATI Radeon 9800XT", - "ATI Radeon X300/X550/M22", - "ATI Radeon X600/X550/M24", - "ATI Radeon X800/M18 AGP", - "ATI Radeon X800/M28 PCIE", - "ATI Radeon X800XL PCIE", - "ATI Radeon X850 PCIE", - "ATI Radeon X850 AGP", - "ATI Radeon X700", - "ATI Xpress 200" - "ATI unknown Radeon", - "ATI Rage HDTV" -}; - const char *ATIFoundryNames[] = { "SGS", "NEC", "KCS", "UMC", "TSMC", "5", "6", "UMC" }; @@ -337,399 +269,3 @@ ATIMach64ChipID break; } } - -/* - * ATIChipID -- - * - * This returns the ATI_CHIP_* value (generally) associated with a particular - * ChipID/ChipRev combination. - */ -ATIChipType -ATIChipID -( - const CARD16 ChipID, - const CARD8 ChipRev -) -{ - switch (ChipID) - { - case OldChipID('G', 'X'): case NewChipID('G', 'X'): - switch (ChipRev) - { - case 0x00U: - return ATI_CHIP_88800GXC; - - case 0x01U: - return ATI_CHIP_88800GXD; - - case 0x02U: - return ATI_CHIP_88800GXE; - - case 0x03U: - return ATI_CHIP_88800GXF; - - default: - return ATI_CHIP_88800GX; - } - - case OldChipID('C', 'X'): case NewChipID('C', 'X'): - return ATI_CHIP_88800CX; - - case OldChipID('C', 'T'): case NewChipID('C', 'T'): - return ATI_CHIP_264CT; - - case OldChipID('E', 'T'): case NewChipID('E', 'T'): - return ATI_CHIP_264ET; - - case OldChipID('V', 'T'): case NewChipID('V', 'T'): - /* For simplicity, ignore ChipID discrepancy that can occur here */ - if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) - return ATI_CHIP_264VT; - return ATI_CHIP_264VTB; - - case OldChipID('G', 'T'): case NewChipID('G', 'T'): - if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV))) - return ATI_CHIP_264GT; - return ATI_CHIP_264GTB; - - case OldChipID('V', 'U'): case NewChipID('V', 'U'): - return ATI_CHIP_264VT3; - - case OldChipID('G', 'U'): case NewChipID('G', 'U'): - return ATI_CHIP_264GTDVD; - - case OldChipID('L', 'G'): case NewChipID('L', 'G'): - return ATI_CHIP_264LT; - - case OldChipID('V', 'V'): case NewChipID('V', 'V'): - return ATI_CHIP_264VT4; - - case OldChipID('G', 'V'): case NewChipID('G', 'V'): - case OldChipID('G', 'W'): case NewChipID('G', 'W'): - case OldChipID('G', 'Y'): case NewChipID('G', 'Y'): - case OldChipID('G', 'Z'): case NewChipID('G', 'Z'): - return ATI_CHIP_264GT2C; - - case OldChipID('G', 'B'): case NewChipID('G', 'B'): - case OldChipID('G', 'D'): case NewChipID('G', 'D'): - case OldChipID('G', 'I'): case NewChipID('G', 'I'): - case OldChipID('G', 'P'): case NewChipID('G', 'P'): - case OldChipID('G', 'Q'): case NewChipID('G', 'Q'): - return ATI_CHIP_264GTPRO; - - case OldChipID('L', 'B'): case NewChipID('L', 'B'): - case OldChipID('L', 'D'): case NewChipID('L', 'D'): - case OldChipID('L', 'I'): case NewChipID('L', 'I'): - case OldChipID('L', 'P'): case NewChipID('L', 'P'): - case OldChipID('L', 'Q'): case NewChipID('L', 'Q'): - return ATI_CHIP_264LTPRO; - - case OldChipID('G', 'L'): case NewChipID('G', 'L'): - case OldChipID('G', 'M'): case NewChipID('G', 'M'): - case OldChipID('G', 'N'): case NewChipID('G', 'N'): - case OldChipID('G', 'O'): case NewChipID('G', 'O'): - case OldChipID('G', 'R'): case NewChipID('G', 'R'): - case OldChipID('G', 'S'): case NewChipID('G', 'S'): - return ATI_CHIP_264XL; - - case OldChipID('L', 'M'): case NewChipID('L', 'M'): - case OldChipID('L', 'N'): case NewChipID('L', 'N'): - case OldChipID('L', 'R'): case NewChipID('L', 'R'): - case OldChipID('L', 'S'): case NewChipID('L', 'S'): - return ATI_CHIP_MOBILITY; - - case NewChipID('R', 'E'): - case NewChipID('R', 'F'): - case NewChipID('R', 'G'): - case NewChipID('S', 'K'): - case NewChipID('S', 'L'): - case NewChipID('S', 'M'): - /* "SN" is listed as ATI_CHIP_RAGE128_4X in ATI docs */ - case NewChipID('S', 'N'): - return ATI_CHIP_RAGE128GL; - - case NewChipID('R', 'K'): - case NewChipID('R', 'L'): - /* - * ATI documentation lists SE/SF/SG under both ATI_CHIP_RAGE128VR - * and ATI_CHIP_RAGE128_4X, and lists SH/SK/SL under Rage 128 4X only. - * I'm stuffing them here for now until this can be clarified as ATI - * documentation doesn't mention their details. - */ - case NewChipID('S', 'E'): - case NewChipID('S', 'F'): - case NewChipID('S', 'G'): - case NewChipID('S', 'H'): - return ATI_CHIP_RAGE128VR; - - /* case NewChipID('S', 'H'): */ - /* case NewChipID('S', 'K'): */ - /* case NewChipID('S', 'L'): */ - /* case NewChipID('S', 'N'): */ - /* return ATI_CHIP_RAGE128_4X; */ - - case NewChipID('P', 'A'): - case NewChipID('P', 'B'): - case NewChipID('P', 'C'): - case NewChipID('P', 'D'): - case NewChipID('P', 'E'): - case NewChipID('P', 'F'): - return ATI_CHIP_RAGE128PROGL; - - case NewChipID('P', 'G'): - case NewChipID('P', 'H'): - case NewChipID('P', 'I'): - case NewChipID('P', 'J'): - case NewChipID('P', 'K'): - case NewChipID('P', 'L'): - case NewChipID('P', 'M'): - case NewChipID('P', 'N'): - case NewChipID('P', 'O'): - case NewChipID('P', 'P'): - case NewChipID('P', 'Q'): - case NewChipID('P', 'R'): - case NewChipID('P', 'S'): - case NewChipID('P', 'T'): - case NewChipID('P', 'U'): - case NewChipID('P', 'V'): - case NewChipID('P', 'W'): - case NewChipID('P', 'X'): - return ATI_CHIP_RAGE128PROVR; - - case NewChipID('T', 'F'): - case NewChipID('T', 'L'): - case NewChipID('T', 'R'): - case NewChipID('T', 'S'): - case NewChipID('T', 'T'): - case NewChipID('T', 'U'): - return ATI_CHIP_RAGE128PROULTRA; - - case NewChipID('L', 'E'): - case NewChipID('L', 'F'): - /* - * "LK" and "LL" are not in any ATI documentation I can find - * - mharris - */ - case NewChipID('L', 'K'): - case NewChipID('L', 'L'): - return ATI_CHIP_RAGE128MOBILITY3; - - case NewChipID('M', 'F'): - case NewChipID('M', 'L'): - return ATI_CHIP_RAGE128MOBILITY4; - - case NewChipID('Q', 'D'): - case NewChipID('Q', 'E'): - case NewChipID('Q', 'F'): - case NewChipID('Q', 'G'): - return ATI_CHIP_RADEON; - - case NewChipID('Q', 'Y'): - case NewChipID('Q', 'Z'): - case NewChipID('Q', '^'): - return ATI_CHIP_RADEONVE; - - case NewChipID('L', 'Y'): - case NewChipID('L', 'Z'): - return ATI_CHIP_RADEONMOBILITY6; - - case NewChipID('A', '6'): - case NewChipID('C', '6'): - return ATI_CHIP_RS100; - - case NewChipID('A', '7'): - case NewChipID('C', '7'): - return ATI_CHIP_RS200; - - case NewChipID('D', '7'): - case NewChipID('B', '7'): - return ATI_CHIP_RS250; - - case NewChipID('L', 'W'): - case NewChipID('L', 'X'): - return ATI_CHIP_RADEONMOBILITY7; - - case NewChipID('Q', 'H'): - case NewChipID('Q', 'I'): - case NewChipID('Q', 'J'): - case NewChipID('Q', 'K'): - case NewChipID('Q', 'L'): - case NewChipID('Q', 'M'): - case NewChipID('Q', 'N'): - case NewChipID('Q', 'O'): - case NewChipID('Q', 'h'): - case NewChipID('Q', 'i'): - case NewChipID('Q', 'j'): - case NewChipID('Q', 'k'): - case NewChipID('Q', 'l'): - case NewChipID('B', 'B'): - return ATI_CHIP_R200; - - case NewChipID('Q', 'W'): - case NewChipID('Q', 'X'): - return ATI_CHIP_RV200; - - case NewChipID('I', 'f'): - case NewChipID('I', 'g'): - return ATI_CHIP_RV250; - - case NewChipID('L', 'd'): - case NewChipID('L', 'f'): - case NewChipID('L', 'g'): - return ATI_CHIP_RADEONMOBILITY9; - - case NewChipID('X', '4'): - case NewChipID('X', '5'): - return ATI_CHIP_RS300; - - case NewChipID('x', '4'): - case NewChipID('x', '5'): - return ATI_CHIP_RS350; - - case NewChipID('Y', '\''): - case NewChipID('Y', 'a'): - case NewChipID('Y', 'b'): - case NewChipID('Y', 'd'): - case NewChipID('Y', 'e'): - return ATI_CHIP_RV280; - - case NewChipID('\\', 'a'): - case NewChipID('\\', 'c'): - return ATI_CHIP_RADEONMOBILITY9PLUS; - - case NewChipID('A', 'D'): - case NewChipID('A', 'E'): - case NewChipID('A', 'F'): - case NewChipID('A', 'G'): - case NewChipID('N', 'D'): - case NewChipID('N', 'E'): - case NewChipID('N', 'F'): - 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('A', 'P'): - case NewChipID('A', 'Q'): - case NewChipID('A', 'R'): - case NewChipID('A', 'S'): - case NewChipID('A', 'T'): - case NewChipID('A', 'U'): - 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('[', '\''): - case NewChipID('[', 'b'): - case NewChipID('[', 'c'): - case NewChipID('[', 'd'): - case NewChipID('[', 'e'): - case NewChipID('T', '\''): - case NewChipID('T', 'b'): - case NewChipID('T', 'd'): - return ATI_CHIP_RV370; - - case NewChipID('>', 'P'): - case NewChipID('>', 'T'): - case NewChipID('1', 'P'): - case NewChipID('1', 'R'): - case NewChipID('1', 'T'): - return ATI_CHIP_RV380; - - case NewChipID('J', 'H'): - case NewChipID('J', 'I'): - case NewChipID('J', 'J'): - case NewChipID('J', 'K'): - case NewChipID('J', 'L'): - case NewChipID('J', 'M'): - case NewChipID('J', 'N'): - case NewChipID('J', 'O'): - case NewChipID('J', 'P'): - case NewChipID('J', 'T'): - return ATI_CHIP_R420; - - case NewChipID('U', 'H'): - case NewChipID('U', 'I'): - case NewChipID('U', 'J'): - case NewChipID('U', 'K'): - case NewChipID('U', 'P'): - case NewChipID('U', 'Q'): - case NewChipID('U', 'R'): - case NewChipID('U', 'T'): - case NewChipID(']', 'W'): - /* those are m28, not 100% certain they are r423 could - be r480 but not r430 as their pci id names indicate... */ - case NewChipID(']', 'H'): - case NewChipID(']', 'I'): - case NewChipID(']', 'J'): - return ATI_CHIP_R423; - - case NewChipID('U', 'L'): - case NewChipID('U', 'M'): - case NewChipID('U', 'N'): - case NewChipID('U', 'O'): - return ATI_CHIP_R430; - - case NewChipID(']', 'L'): - case NewChipID(']', 'M'): - case NewChipID(']', 'N'): - case NewChipID(']', 'O'): - case NewChipID(']', 'P'): - case NewChipID(']', 'R'): - return ATI_CHIP_R480; - - case NewChipID('K', 'I'): - case NewChipID('K', 'J'): - case NewChipID('K', 'K'): - case NewChipID('K', 'L'): - return ATI_CHIP_R481; - - case NewChipID('^', 'H'): - case NewChipID('^', 'J'): - case NewChipID('^', 'K'): - case NewChipID('^', 'L'): - case NewChipID('^', 'M'): - case NewChipID('^', 'O'): - case NewChipID('V', 'J'): - case NewChipID('V', 'K'): - case NewChipID('V', 'O'): - case NewChipID('V', 'R'): - case NewChipID('V', 'S'): - return ATI_CHIP_RV410; - - case NewChipID('Z', 'A'): - case NewChipID('Z', 'B'): - case NewChipID('Z', 'a'): - case NewChipID('Z', 'b'): - case NewChipID('Y', 'T'): - case NewChipID('Y', 'U'): - case NewChipID('Y', 't'): - case NewChipID('Y', 'u'): - return ATI_CHIP_RS400; - - case NewChipID('H', 'D'): - return ATI_CHIP_HDTV; - - default: - /* - * Treat anything else as an unknown Radeon. Please keep the above - * up-to-date however, as it serves as a central chip list. - */ - return ATI_CHIP_Radeon; - } -} diff --git a/src/atichip.h b/src/atichip.h index 733c7b1..44cd188 100644 --- a/src/atichip.h +++ b/src/atichip.h @@ -28,76 +28,6 @@ #include -/* - * Chip-related definitions. - */ -typedef enum -{ - ATI_CHIP_NONE = 0, - ATI_CHIP_88800GXC, /* Mach64 */ - ATI_CHIP_88800GXD, /* Mach64 */ - ATI_CHIP_88800GXE, /* Mach64 */ - ATI_CHIP_88800GXF, /* Mach64 */ - ATI_CHIP_88800GX, /* Mach64 */ - ATI_CHIP_88800CX, /* Mach64 */ - ATI_CHIP_264CT, /* Mach64 */ - ATI_CHIP_264ET, /* Mach64 */ - ATI_CHIP_264VT, /* Mach64 */ - ATI_CHIP_264GT, /* Mach64 */ - ATI_CHIP_264VTB, /* Mach64 */ - ATI_CHIP_264GTB, /* Mach64 */ - ATI_CHIP_264VT3, /* Mach64 */ - ATI_CHIP_264GTDVD, /* Mach64 */ - ATI_CHIP_264LT, /* Mach64 */ - ATI_CHIP_264VT4, /* Mach64 */ - ATI_CHIP_264GT2C, /* Mach64 */ - ATI_CHIP_264GTPRO, /* Mach64 */ - ATI_CHIP_264LTPRO, /* Mach64 */ - ATI_CHIP_264XL, /* Mach64 */ - ATI_CHIP_MOBILITY, /* Mach64 */ - ATI_CHIP_Mach64, /* Last among Mach64's */ - ATI_CHIP_RAGE128GL, /* Rage128 */ - ATI_CHIP_RAGE128VR, /* Rage128 */ - ATI_CHIP_RAGE128PROGL, /* Rage128 */ - ATI_CHIP_RAGE128PROVR, /* Rage128 */ - ATI_CHIP_RAGE128PROULTRA, /* Rage128 */ - ATI_CHIP_RAGE128MOBILITY3, /* Rage128 */ - ATI_CHIP_RAGE128MOBILITY4, /* Rage128 */ - ATI_CHIP_Rage128, /* Last among Rage128's */ - ATI_CHIP_RADEON, /* Radeon */ - ATI_CHIP_RADEONVE, /* Radeon VE */ - ATI_CHIP_RADEONMOBILITY6, /* Radeon M6 */ - ATI_CHIP_RS100, /* IGP320 */ - ATI_CHIP_RS200, /* IGP340 */ - ATI_CHIP_RS250, /* Radoen 7000 IGP */ - ATI_CHIP_RV200, /* RV200 */ - ATI_CHIP_RADEONMOBILITY7, /* Radeon M7 */ - ATI_CHIP_R200, /* R200 */ - ATI_CHIP_RV250, /* RV250 */ - ATI_CHIP_RADEONMOBILITY9, /* Radeon M9 */ - ATI_CHIP_RS300, /* Radoen 9100 IGP */ - ATI_CHIP_RS350, /* Radoen 9200 IGP */ - ATI_CHIP_RV280, /* RV250 */ - ATI_CHIP_RADEONMOBILITY9PLUS, /* Radeon M9+ */ - ATI_CHIP_R300, /* R300 */ - ATI_CHIP_RV350, /* RV350/M10/M11 */ - ATI_CHIP_R350, /* R350 */ - ATI_CHIP_R360, /* R360 */ - ATI_CHIP_RV370, /* RV370/M22 */ - ATI_CHIP_RV380, /* RV380/M24 */ - ATI_CHIP_R420, /* R420/M18 */ - ATI_CHIP_R423, /* R423/M28? */ - ATI_CHIP_R430, /* R430 */ - ATI_CHIP_R480, /* R480/M28? */ - ATI_CHIP_R481, /* R481 */ - ATI_CHIP_RV410, /* RV410, M26 */ - ATI_CHIP_RS400, /* RS400, RS410, RS480, RS482, ... */ - ATI_CHIP_Radeon, /* Last among Radeon's */ - ATI_CHIP_HDTV /* HDTV */ -} ATIChipType; - -extern const char *ATIChipNames[]; - /* * Foundry codes for 264xT's. */ @@ -116,7 +46,6 @@ typedef enum extern const char *ATIFoundryNames[]; extern void ATIMach64ChipID(ATIPtr, const CARD16); -extern ATIChipType ATIChipID(const CARD16, const CARD8); #define OldChipID(_1, _0) \ (SetBits(_0 - 'A', CHIP_CODE_0) | SetBits(_1 - 'A', CHIP_CODE_1)) -- cgit v1.2.3 From fca30a6b581cb6c1466ab1bc316df8fed5d82b60 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 26 Mar 2007 23:26:51 -0400 Subject: fix NULL dereference when IsSecondary is true, crtc1 is NULL Noticed by Sverre Froyen. --- src/radeon_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 28580a5..1bd6884 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -6328,7 +6328,7 @@ static Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1, { RADEONInfoPtr info = RADEONPTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - double dot_clock = crtc1->Clock/1000.0; + double dot_clock; RADEONInfoPtr info0 = NULL; ScrnInfoPtr pScrn0 = NULL; @@ -6358,7 +6358,7 @@ static Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1, ErrorF("\n"); ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", crtc1->name, - dot_clock, + crtc1->Clock/1000.0, crtc1->CrtcHDisplay, crtc1->CrtcHSyncStart, -- cgit v1.2.3 From 66b4a571a4e7960da6807d3f30955aa08e89ccc6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 27 Mar 2007 17:00:37 +1000 Subject: update number to 6.6.191 for rc release --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 16b93e1..ddfa7c8 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-ati], - 6.6.99, + 6.6.191, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-ati) -- cgit v1.2.3 From f87e57d4d773a019d1cc8a10425c57480430f6a4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 27 Mar 2007 18:08:54 +1000 Subject: radeon: fix up crtc debug dereference problem --- src/radeon_driver.c | 69 ++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 1bd6884..2cd4c7b 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -6333,9 +6333,10 @@ static Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1, ScrnInfoPtr pScrn0 = NULL; #if RADEON_DEBUG - ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", + if (crtc1 && (crtc_mask & 1)) { + ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", crtc1->name, - dot_clock, + crtc1->clock, crtc1->HDisplay, crtc1->HSyncStart, @@ -6348,40 +6349,44 @@ static Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1, crtc1->VTotal, pScrn->depth, pScrn->bitsPerPixel); - if (crtc1->Flags & V_DBLSCAN) ErrorF(" D"); - if (crtc1->Flags & V_CSYNC) ErrorF(" C"); - if (crtc1->Flags & V_INTERLACE) ErrorF(" I"); - if (crtc1->Flags & V_PHSYNC) ErrorF(" +H"); - if (crtc1->Flags & V_NHSYNC) ErrorF(" -H"); - if (crtc1->Flags & V_PVSYNC) ErrorF(" +V"); - if (crtc1->Flags & V_NVSYNC) ErrorF(" -V"); - ErrorF("\n"); - ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", - crtc1->name, - crtc1->Clock/1000.0, - - crtc1->CrtcHDisplay, - crtc1->CrtcHSyncStart, - crtc1->CrtcHSyncEnd, - crtc1->CrtcHTotal, - - crtc1->CrtcVDisplay, - crtc1->CrtcVSyncStart, - crtc1->CrtcVSyncEnd, - crtc1->CrtcVTotal, + if (crtc1->Flags & V_DBLSCAN) ErrorF(" D"); + if (crtc1->Flags & V_CSYNC) ErrorF(" C"); + if (crtc1->Flags & V_INTERLACE) ErrorF(" I"); + if (crtc1->Flags & V_PHSYNC) ErrorF(" +H"); + if (crtc1->Flags & V_NHSYNC) ErrorF(" -H"); + if (crtc1->Flags & V_PVSYNC) ErrorF(" +V"); + if (crtc1->Flags & V_NVSYNC) ErrorF(" -V"); + ErrorF("\n"); + } + if (crtc2 && (crtc_mask & 2)) { + ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", + crtc2->name, + crtc2->Clock/1000.0, + + crtc2->CrtcHDisplay, + crtc2->CrtcHSyncStart, + crtc2->CrtcHSyncEnd, + crtc2->CrtcHTotal, + + crtc2->CrtcVDisplay, + crtc2->CrtcVSyncStart, + crtc2->CrtcVSyncEnd, + crtc2->CrtcVTotal, pScrn->depth, pScrn->bitsPerPixel); - if (crtc1->Flags & V_DBLSCAN) ErrorF(" D"); - if (crtc1->Flags & V_CSYNC) ErrorF(" C"); - if (crtc1->Flags & V_INTERLACE) ErrorF(" I"); - if (crtc1->Flags & V_PHSYNC) ErrorF(" +H"); - if (crtc1->Flags & V_NHSYNC) ErrorF(" -H"); - if (crtc1->Flags & V_PVSYNC) ErrorF(" +V"); - if (crtc1->Flags & V_NVSYNC) ErrorF(" -V"); - ErrorF("\n"); + if (crtc2->Flags & V_DBLSCAN) ErrorF(" D"); + if (crtc2->Flags & V_CSYNC) ErrorF(" C"); + if (crtc2->Flags & V_INTERLACE) ErrorF(" I"); + if (crtc2->Flags & V_PHSYNC) ErrorF(" +H"); + if (crtc2->Flags & V_NHSYNC) ErrorF(" -H"); + if (crtc2->Flags & V_PVSYNC) ErrorF(" +V"); + if (crtc2->Flags & V_NVSYNC) ErrorF(" -V"); + ErrorF("\n"); + } #endif - info->Flags = crtc1->Flags; + if (crtc1 && (crtc_mask & 1)) + info->Flags = crtc1->Flags; RADEONInitMemMapRegisters(pScrn, save, info); RADEONInitCommonRegisters(save, info); -- cgit v1.2.3 From 1a71106c0e4fe5f650239dc694163fdf52d33663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 27 Mar 2007 10:13:21 +0200 Subject: radeon: Fix typo. --- src/radeon_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 2cd4c7b..57d8826 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -6336,7 +6336,7 @@ static Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1, if (crtc1 && (crtc_mask & 1)) { ErrorF("%-12.12s %7.2f %4d %4d %4d %4d %4d %4d %4d %4d (%d,%d)", crtc1->name, - crtc1->clock, + crtc1->Clock/1000.0, crtc1->HDisplay, crtc1->HSyncStart, -- cgit v1.2.3 From 1acd6d6fa42acec07fb11aeb189f492ddb021cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 30 Mar 2007 11:06:10 +0200 Subject: radeon: Guard some MergedFB specific code with info->MergedFB tests. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10442 . --- src/radeon_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 57d8826..0e68d7d 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2247,7 +2247,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) /* If we have 2 screens from the config file, we don't need * to do clone thing, let each screen handles one head. */ - if (!pRADEONEnt->HasSecondary) { + if (info->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Validating CRTC2 modes for MergedFB ------------ \n"); @@ -2273,7 +2273,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) if (pRADEONEnt->HasCRTC2) { - if(pRADEONEnt->Controller[1]->binding == 1) { + if(pRADEONEnt->Controller[1]->binding == 1 && info->MergedFB) { xf86SetCrtcForModes(info->CRT2pScrn, INTERLACE_HALVE_V); -- cgit v1.2.3 From 9c2dcd19be8fc2cc29e637d1e9748e66196e3900 Mon Sep 17 00:00:00 2001 From: Henry Zhao Date: Sat, 31 Mar 2007 20:10:03 -0800 Subject: 9337: EDID modes do not participate in validation for CRT monitor --- src/radeon_driver.c | 2 +- src/radeon_modes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 0e68d7d..7fd802a 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2125,7 +2125,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) * 'stretched' from their native mode. */ if (info->DisplayType == MT_CRT && !info->ddc_mode) { - + xf86SetDDCproperties(pScrn, pScrn->monitor->DDC); modesFound = xf86ValidateModes(pScrn, pScrn->monitor->Modes, diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 70bf184..09b8aaf 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -675,7 +675,7 @@ int RADEONValidateMergeModes(ScrnInfoPtr pScrn1) * 'stretched' from their native mode. */ if (info->MergeType == MT_CRT && !info->ddc_mode) { - + xf86SetDDCproperties(pScrn, pScrn->monitor->DDC); modesFound = xf86ValidateModes(pScrn, pScrn->monitor->Modes, -- cgit v1.2.3 From 9b1e97284ce185d358ca756a235d2cee346fa53f Mon Sep 17 00:00:00 2001 From: Henry Zhao Date: Sat, 31 Mar 2007 23:01:52 -0800 Subject: 10205: Radeon driver's own mode validation code does not work properly --- src/radeon_modes.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 09b8aaf..535d047 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -86,10 +86,16 @@ static void RADEONSortModes(DisplayModePtr *new, DisplayModePtr *first, p = *last; while (p) { - if ((((*new)->HDisplay < p->HDisplay) && + if (((*new)->HDisplay < p->HDisplay) || + (((*new)->HDisplay == p->HDisplay) && ((*new)->VDisplay < p->VDisplay)) || (((*new)->HDisplay == p->HDisplay) && ((*new)->VDisplay == p->VDisplay) && + ((*new)->type < p->type) && + !(((*new)->type == M_T_USERDEF) || (!(*new)->type))) || + (((*new)->HDisplay == p->HDisplay) && + ((*new)->VDisplay == p->VDisplay) && + ((*new)->type == p->type) && ((*new)->Clock < p->Clock))) { if (p->next) p->next->prev = *new; @@ -181,9 +187,8 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) #ifdef M_T_PREFERRED if (PREFERRED_TIMING_MODE(ddc->features.msc)) new->type = M_T_PREFERRED; - else #endif - new->type = M_T_DEFAULT; + new->type |= M_T_DRIVER; if (d_timings->sync == 3) { switch (d_timings->misc) { @@ -207,8 +212,10 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) for (j = 0; j < 8; j++) { if (ddc->timings2[j].hsize == 0 || ddc->timings2[j].vsize == 0) continue; - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { /* Ignore all double scan modes */ + if (p->Flags & V_DBLSCAN) + continue; if ((ddc->timings2[j].hsize == p->HDisplay) && (ddc->timings2[j].vsize == p->VDisplay)) { float refresh = @@ -221,7 +228,8 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) new->name = xnfalloc(strlen(p->name) + 1); strcpy(new->name, p->name); new->status = MODE_OK; - new->type = M_T_DEFAULT; + if ((new->type != M_T_USERDEF) && (new->type)) + new->type = M_T_DEFAULT; count++; @@ -240,7 +248,10 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) tmp = (ddc->timings1.t1 << 8) | ddc->timings1.t2; for (j = 0; j < 16; j++) { if (tmp & (1 << j)) { - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { + /* Ignore all double scan modes */ + if (p->Flags & V_DBLSCAN) + continue; if ((est_timings[j].hsize == p->HDisplay) && (est_timings[j].vsize == p->VDisplay)) { float refresh = @@ -253,7 +264,8 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) new->name = xnfalloc(strlen(p->name) + 1); strcpy(new->name, p->name); new->status = MODE_OK; - new->type = M_T_DEFAULT; + if ((new->type != M_T_USERDEF) && (new->type)) + new->type = M_T_DEFAULT; count++; -- cgit v1.2.3 From 3a8190ccc79969925257e7b980b78d79053d208d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 4 Apr 2007 09:47:07 +0200 Subject: radeon: Don't shrink virtual size based on secondary modes. --- src/radeon_mergedfb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c index 820ba4b..6a7745e 100644 --- a/src/radeon_mergedfb.c +++ b/src/radeon_mergedfb.c @@ -581,8 +581,10 @@ RADEONRecalcDefaultVirtualSize(ScrnInfoPtr pScrn) info->CRT1XOffs = info->CRT2XOffs = 0; maxh -= (info->CRT1XOffs + info->CRT2XOffs); } - pScrn->virtualX = maxh; - pScrn->displayWidth = maxh; + if (maxh > pScrn->virtualX) + pScrn->virtualX = maxh; + if (maxh > pScrn->displayWidth) + pScrn->displayWidth = maxh; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "width", maxh); } else { if(maxh < pScrn->display->virtualX) { @@ -592,7 +594,8 @@ RADEONRecalcDefaultVirtualSize(ScrnInfoPtr pScrn) } if(!(pScrn->display->virtualY)) { - pScrn->virtualY = maxv; + if (maxv > pScrn->virtualY) + pScrn->virtualY = maxv; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "height", maxv); } else { if(maxv < pScrn->display->virtualY) { -- cgit v1.2.3 From 3c892f163ec1fa9be6e733aab091c9b718f41efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 4 Apr 2007 09:52:37 +0200 Subject: radeon: Always sort modes when adding to list. This makes sure mode lists will always be sorted from larger to smaller. --- src/radeon_modes.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 535d047..372b2ed 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -373,15 +373,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName, if (p == ddcModes) ddcModes = p->next; /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; + RADEONSortModes(&p, &first, &last); break; } @@ -402,15 +394,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName, if (p == ddcModes) ddcModes = p->next; /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; + RADEONSortModes(&p, &first, &last); } } @@ -558,12 +542,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) new->type |= M_T_USERDEF; - new->next = NULL; - new->prev = last; - - if (last) last->next = new; - last = new; - if (!first) first = new; + RADEONSortModes(&new, &first, &last); pScrn->display->virtualX = pScrn->virtualX = MAX(pScrn->virtualX, width); @@ -609,12 +588,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) new->type |= M_T_DEFAULT; - new->next = NULL; - new->prev = last; - - if (last) last->next = new; - last = new; - if (!first) first = new; + RADEONSortModes(&new, &first, &last); } } } -- cgit v1.2.3 From 6b25a4c48796e022a093f3072574ffe9709ecaf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 4 Apr 2007 10:47:29 +0200 Subject: radeon: Link nearest modes by default for clone mode. This makes sure all modes of both CRTCs will be available by default with MergedFB. --- src/radeon_mergedfb.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c index 6a7745e..5c91cd3 100644 --- a/src/radeon_mergedfb.c +++ b/src/radeon_mergedfb.c @@ -536,12 +536,33 @@ RADEONGenerateModeList(ScrnInfoPtr pScrn, char* str, DisplayModePtr p, q, result = NULL; xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Clone mode, list all common modes\n"); - for (p = i; p->next != i; p = p->next) - for (q = j; q->next != j; q = q->next) - if ((p->HDisplay == q->HDisplay) && - (p->VDisplay == q->VDisplay)) - result = RADEONCopyModeNLink(pScrn, result, p, q, srel); + "Clone mode, linking all nearest modes\n"); + + p = i; + q = j; + + result = RADEONCopyModeNLink(pScrn, result, p, q, srel); + + while (p->next != i || q->next != j) { + DisplayModePtr next_p = p; + + if (q->next == j || (p->next != i && + (p->HDisplay > q->HDisplay || + (p->HDisplay == q->HDisplay && + p->VDisplay >= q->VDisplay)))) + next_p = p->next; + + if (p->next == i || (q->next != j && + (q->HDisplay > p->HDisplay || + (q->HDisplay == p->HDisplay && + q->VDisplay >= p->VDisplay)))) + q = q->next; + + p = next_p; + + result = RADEONCopyModeNLink(pScrn, result, p, q, srel); + } + return result; } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, -- cgit v1.2.3 From 4effa67ea75736a31b9e78a7b35acf74b067c43e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 9 Apr 2007 22:08:31 +1000 Subject: radeon: add support for enabling direct rendering on RS480 Thanks to Matthew Garrett and Ubuntu for the hw loan to get this working. Still no 3D driver support but at least you should get CP acceleration for 2D now. --- src/radeon_driver.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 7fd802a..c4bda8a 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -953,7 +953,8 @@ static Bool RADEONProbePLLParameters(ScrnInfoPtr pScrn) if (ref_div < 2) { CARD32 tmp; tmp = INPLL(pScrn, RADEON_PPLL_REF_DIV); - if (IS_R300_VARIANT || (info->ChipFamily == CHIP_FAMILY_RS300)) + if (IS_R300_VARIANT || (info->ChipFamily == CHIP_FAMILY_RS300) + || (info->ChipFamily == CHIP_FAMILY_RS400)) ref_div = (tmp & R300_PPLL_REF_DIV_ACC_MASK) >> R300_PPLL_REF_DIV_ACC_SHIFT; else @@ -1033,7 +1034,8 @@ static void RADEONGetClockInfo(ScrnInfoPtr pScrn) CARD32 tmp; tmp = INPLL(pScrn, RADEON_PPLL_REF_DIV); if (IS_R300_VARIANT || - (info->ChipFamily == CHIP_FAMILY_RS300)) { + (info->ChipFamily == CHIP_FAMILY_RS300) || + (info->ChipFamily == CHIP_FAMILY_RS400)) { pll->reference_div = (tmp & R300_PPLL_REF_DIV_ACC_MASK) >> R300_PPLL_REF_DIV_ACC_SHIFT; } else { pll->reference_div = tmp & RADEON_PPLL_REF_DIV_MASK; @@ -1903,10 +1905,15 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) } } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s card detected\n", (info->cardType==CARD_PCI) ? "PCI" : (info->cardType==CARD_PCIE) ? "PCIE" : "AGP"); + /* treat PCIE IGP cards as PCI */ + if (info->cardType == CARD_PCIE && info->IsIGP) + info->cardType = CARD_PCI; + if ((s = xf86GetOptValString(info->Options, OPTION_BUS_TYPE))) { if (strcmp(s, "AGP") == 0) { info->cardType = CARD_AGP; @@ -2526,18 +2533,6 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) } } - if (info->Chipset == PCI_CHIP_RS400_5A41 || - info->Chipset == PCI_CHIP_RS400_5A42 || - info->Chipset == PCI_CHIP_RC410_5A61 || - info->Chipset == PCI_CHIP_RC410_5A62 || - info->Chipset == PCI_CHIP_RS480_5954 || - info->Chipset == PCI_CHIP_RS480_5955 || - info->Chipset == PCI_CHIP_RS482_5974 || - info->Chipset == PCI_CHIP_RS482_5975) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Direct rendering broken on XPRESS 200 and 200M\n"); - return FALSE; - } if (!xf86ReturnOptValBool(info->Options, OPTION_DRI, TRUE)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -2564,6 +2559,24 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) info->pKernelDRMVersion->version_minor, info->pKernelDRMVersion->version_patchlevel); + if (info->Chipset == PCI_CHIP_RS400_5A41 || + info->Chipset == PCI_CHIP_RS400_5A42 || + info->Chipset == PCI_CHIP_RC410_5A61 || + info->Chipset == PCI_CHIP_RC410_5A62 || + info->Chipset == PCI_CHIP_RS480_5954 || + info->Chipset == PCI_CHIP_RS480_5955 || + info->Chipset == PCI_CHIP_RS482_5974 || + info->Chipset == PCI_CHIP_RS482_5975) { + + if (info->pKernelDRMVersion->version_minor < 27) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Direct rendering broken on XPRESS 200 and 200M with DRI less than 1.27\n"); + return FALSE; + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Direct rendering experimental on RS400/Xpress 200 enabled\n"); + } + if (xf86ReturnOptValBool(info->Options, OPTION_CP_PIO, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CP into PIO mode\n"); info->CPMode = RADEON_DEFAULT_CP_PIO_MODE; @@ -4734,7 +4747,8 @@ static void RADEONRestorePLLRegisters(ScrnInfoPtr pScrn, RADEONPllErrataAfterIndex(info); if (IS_R300_VARIANT || - (info->ChipFamily == CHIP_FAMILY_RS300)) { + (info->ChipFamily == CHIP_FAMILY_RS300) || + (info->ChipFamily == CHIP_FAMILY_RS400)) { if (restore->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) { /* When restoring console mode, use saved PPLL_REF_DIV * setting. -- cgit v1.2.3 From 07ddffb32e6293c77b32c94b87ec468caef3d6f5 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Wed, 11 Apr 2007 14:36:51 +0200 Subject: Fixed typo in mode list generation. --- src/radeon_mergedfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c index 5c91cd3..fa143cb 100644 --- a/src/radeon_mergedfb.c +++ b/src/radeon_mergedfb.c @@ -389,7 +389,7 @@ RADEONGenerateModeListFromLargestModes(ScrnInfoPtr pScrn, if(srel != radeonClone) { if(mode3 && mode4 && !info->NonRect) { mode1 = mode3; - mode2 = mode2; + mode2 = mode4; } } -- cgit v1.2.3 From aea801cf9a5ce519a53d6fffd9a3a2e526ec79ea Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Fri, 13 Apr 2007 16:16:05 +0200 Subject: Fix crash if MergedFB and secondary head not found If the secondary head isn't found (Monitor unplugged etc.) but MergedFB is configured, the driver segfaults because it tries to access the mode list private structures, which are not filled in. --- src/radeon_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index c4bda8a..0f9e2d6 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2328,7 +2328,11 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) } } + else + info->MergedFB = FALSE; } + else + info->MergedFB = FALSE; if (info->MergedFB) { /* If no virtual dimension was given by the user, -- cgit v1.2.3 From 0abce69f0d826a7ca1a41d963cd4730b6e01c145 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Wed, 18 Apr 2007 17:32:52 +0200 Subject: Fix inconsistent use of Mode lists. Some scans used to only check every second entry, some stopped at the entry before the last entry. Bugzilla #10620 (1), original patch by Lisa Wu @ATI --- src/radeon_display.c | 2 +- src/radeon_modes.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/radeon_display.c b/src/radeon_display.c index d661c17..ac05648 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -776,7 +776,7 @@ static void RADEONUpdatePanelSize(ScrnInfoPtr pScrn) for (j = 0; j < 8; j++) { if ((info->PanelXRes < ddc->timings2[j].hsize) && (info->PanelYRes < ddc->timings2[j].vsize)) { - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { if ((ddc->timings2[j].hsize == p->HDisplay) && (ddc->timings2[j].vsize == p->VDisplay)) { float refresh = diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 372b2ed..6b8577e 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -212,7 +212,7 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) for (j = 0; j < 8; j++) { if (ddc->timings2[j].hsize == 0 || ddc->timings2[j].vsize == 0) continue; - for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { /* Ignore all double scan modes */ if (p->Flags & V_DBLSCAN) continue; @@ -248,7 +248,7 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) tmp = (ddc->timings1.t1 << 8) | ddc->timings1.t2; for (j = 0; j < 16; j++) { if (tmp & (1 << j)) { - for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { /* Ignore all double scan modes */ if (p->Flags & V_DBLSCAN) continue; @@ -560,7 +560,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) } /* add in all default vesa modes smaller than panel size, used for randr*/ - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { if ((p->HDisplay <= info->PanelXRes) && (p->VDisplay <= info->PanelYRes)) { tmp = first; while (tmp) { -- cgit v1.2.3 From 16ef77df4ebaf5ea13baa82972aaf98e71ac32ee Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Wed, 18 Apr 2007 17:36:15 +0200 Subject: Set sync polarity restriction flags even for non-"digital separate" monitors. According to Lisa Wu, this is correct regarding the VESA EEDID standard. Bugzilla #10620 (2), original patch by Lisa Wu @ATI --- src/radeon_display.c | 12 +++++------- src/radeon_modes.c | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/radeon_display.c b/src/radeon_display.c index ac05648..57e752e 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -755,13 +755,11 @@ static void RADEONUpdatePanelSize(ScrnInfoPtr pScrn) info->VSyncWidth = d_timings->v_sync_width; info->VBlank = d_timings->v_blanking; info->Flags = (d_timings->interlaced ? V_INTERLACE : 0); - if (d_timings->sync == 3) { - switch (d_timings->misc) { - case 0: info->Flags |= V_NHSYNC | V_NVSYNC; break; - case 1: info->Flags |= V_PHSYNC | V_NVSYNC; break; - case 2: info->Flags |= V_NHSYNC | V_PVSYNC; break; - case 3: info->Flags |= V_PHSYNC | V_PVSYNC; break; - } + switch (d_timings->misc) { + case 0: info->Flags |= V_NHSYNC | V_NVSYNC; break; + case 1: info->Flags |= V_PHSYNC | V_NVSYNC; break; + case 2: info->Flags |= V_NHSYNC | V_PVSYNC; break; + case 3: info->Flags |= V_PHSYNC | V_PVSYNC; break; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel infos found from DDC detailed: %dx%d\n", info->PanelXRes, info->PanelYRes); diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 6b8577e..3d147e2 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -190,13 +190,11 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) #endif new->type |= M_T_DRIVER; - if (d_timings->sync == 3) { - switch (d_timings->misc) { - case 0: new->Flags |= V_NHSYNC | V_NVSYNC; break; - case 1: new->Flags |= V_PHSYNC | V_NVSYNC; break; - case 2: new->Flags |= V_NHSYNC | V_PVSYNC; break; - case 3: new->Flags |= V_PHSYNC | V_PVSYNC; break; - } + switch (d_timings->misc) { + case 0: new->Flags |= V_NHSYNC | V_NVSYNC; break; + case 1: new->Flags |= V_PHSYNC | V_NVSYNC; break; + case 2: new->Flags |= V_NHSYNC | V_PVSYNC; break; + case 3: new->Flags |= V_PHSYNC | V_PVSYNC; break; } count++; -- cgit v1.2.3 From ad119960095b4b64f4c6793f65950c9967ce4989 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Thu, 19 Apr 2007 11:54:46 +0200 Subject: Disable RMX for IBM Lewis server. Due to the hardware layout RMX ddc_mode has to be set. If ddc_mode is set, RADEONValdiateFPModes() shouldn't be called. Bugzilla #10620 (3). --- src/radeon_driver.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 0f9e2d6..bcc0882 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2029,15 +2029,19 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) xf86ReturnOptValBool(info->Options, OPTION_DDC_MODE, FALSE); /* don't use RMX if we have a dual-tmds panels */ - if ((connector = RADEONGetCrtcConnector(pScrn, 2))) if (connector->MonType == MT_DFP) info->ddc_mode = TRUE; /* don't use RMX if we are Dell Server */ if (info->IsDellServer) - { info->ddc_mode = TRUE; + /* IBM Lewis server have troubles using the on-chip RMX mode */ + if (info->ChipFamily == CHIP_FAMILY_RV100 && !info->HasCRTC2 && pRADEONEnt->PortInfo[0]->MonInfo) { + struct vendor *ven = &pRADEONEnt->PortInfo[0].MonInfo->vendor; + if (ven && ven->prod_id == 0x029a && ven->serial == 0x01010101) + info->ddc_mode = TRUE; } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Validating modes on %s head ---------\n", info->IsSecondary ? "Secondary" : "Primary"); @@ -2219,7 +2223,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) pScrn->display->virtualY, info->FbMapSize, LOOKUP_BEST_REFRESH); - else if (!info->IsSecondary) + else if (!info->IsSecondary && !info->ddc_mode) modesFound = RADEONValidateFPModes(pScrn, pScrn->display->modes); } } -- cgit v1.2.3 From 406eec71116a58d42288a7f1c809a92d5bda7350 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 21 Apr 2007 18:56:28 +1000 Subject: radeon: fix build since patches for IBM don't actually build --- src/radeon_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index bcc0882..b9cce22 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2036,8 +2036,8 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) if (info->IsDellServer) info->ddc_mode = TRUE; /* IBM Lewis server have troubles using the on-chip RMX mode */ - if (info->ChipFamily == CHIP_FAMILY_RV100 && !info->HasCRTC2 && pRADEONEnt->PortInfo[0]->MonInfo) { - struct vendor *ven = &pRADEONEnt->PortInfo[0].MonInfo->vendor; + if (info->ChipFamily == CHIP_FAMILY_RV100 && !pRADEONEnt->HasCRTC2 && pRADEONEnt->PortInfo[0]->MonInfo) { + struct vendor *ven = &pRADEONEnt->PortInfo[0]->MonInfo->vendor; if (ven && ven->prod_id == 0x029a && ven->serial == 0x01010101) info->ddc_mode = TRUE; } -- cgit v1.2.3 From c81ed9bd7b37c9d02141d10f6c7bad3d0c57032f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 21 Apr 2007 18:58:40 +1000 Subject: radeon: fix build on older server --- src/radeon_modes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 3d147e2..1a63971 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -186,9 +186,11 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) new->status = MODE_OK; #ifdef M_T_PREFERRED if (PREFERRED_TIMING_MODE(ddc->features.msc)) - new->type = M_T_PREFERRED; + new->type |= M_T_PREFERRED; #endif +#ifdef M_T_DRIVER new->type |= M_T_DRIVER; +#endif switch (d_timings->misc) { case 0: new->Flags |= V_NHSYNC | V_NVSYNC; break; -- cgit v1.2.3 From 3828237200fc16d4d32664fb8358950c213d4897 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 22 Apr 2007 11:36:00 +1000 Subject: radeon: add support for DDC on some laptop chipsets I noticed fglrx has DDC for the panel in the rs480 laptop, however radeon didn't pick it up, so I valgrinded fglrx and spotted 0x1a0/0x1a4 accesses I actually noticed this before from the BIOS but never figured it out. So now I get DDC from the LCD on this laptop. --- src/radeon_bios.c | 5 ++++- src/radeon_display.c | 44 +++++++++++++++++++++++++++++++------------- src/radeon_probe.h | 3 ++- src/radeon_reg.h | 2 ++ 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/radeon_bios.c b/src/radeon_bios.c index 1d4c9bb..dd3d0a7 100644 --- a/src/radeon_bios.c +++ b/src/radeon_bios.c @@ -181,6 +181,9 @@ Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn) case RADEON_GPIO_CRT2_DDC: pRADEONEnt->PortInfo[crtc]->DDCType = DDC_CRT2; break; + case RADEON_LCD_GPIO_MASK: + pRADEONEnt->PortInfo[crtc]->DDCType = DDC_LCD; + break; default: pRADEONEnt->PortInfo[crtc]->DDCType = DDC_NONE_DETECTED; break; @@ -290,7 +293,7 @@ Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn) if ((tmp0 = RADEON_BIOS16(tmp + 0x15))) { if ((tmp1 = RADEON_BIOS8(tmp0+2) & 0x07)) { pRADEONEnt->PortInfo[0]->DDCType = tmp1; - if (pRADEONEnt->PortInfo[0]->DDCType > DDC_CRT2) { + if (pRADEONEnt->PortInfo[0]->DDCType > DDC_LCD) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown DDCType %d found\n", pRADEONEnt->PortInfo[0]->DDCType); diff --git a/src/radeon_display.c b/src/radeon_display.c index 57e752e..f3b86e6 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -75,12 +75,13 @@ const char *TMDSTypeName[3] = { "External" }; -const char *DDCTypeName[5] = { +const char *DDCTypeName[6] = { "NONE", "MONID", "DVI_DDC", "VGA_DDC", - "CRT2_DDC" + "CRT2_DDC", + "LCD_DDC" }; const char *DACTypeName[3] = { @@ -166,10 +167,16 @@ static void RADEONI2CGetBits(I2CBusPtr b, int *Clock, int *data) unsigned char *RADEONMMIO = info->MMIO; /* Get the result */ - val = INREG(info->DDCReg); - *Clock = (val & RADEON_GPIO_Y_1) != 0; - *data = (val & RADEON_GPIO_Y_0) != 0; + if (info->DDCReg == RADEON_LCD_GPIO_MASK) { + val = INREG(info->DDCReg+4); + *Clock = (val & (1<<13)) != 0; + *data = (val & (1<<12)) != 0; + } else { + val = INREG(info->DDCReg); + *Clock = (val & RADEON_GPIO_Y_1) != 0; + *data = (val & RADEON_GPIO_Y_0) != 0; + } } static void RADEONI2CPutBits(I2CBusPtr b, int Clock, int data) @@ -179,11 +186,17 @@ static void RADEONI2CPutBits(I2CBusPtr b, int Clock, int data) unsigned long val; unsigned char *RADEONMMIO = info->MMIO; - val = INREG(info->DDCReg) & (CARD32)~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1); - val |= (Clock ? 0:RADEON_GPIO_EN_1); - val |= (data ? 0:RADEON_GPIO_EN_0); - OUTREG(info->DDCReg, val); - + if (info->DDCReg == RADEON_LCD_GPIO_MASK) { + val = INREG(info->DDCReg) & (CARD32)~((1<<12) | (1<<13)); + val |= (Clock ? 0:(1<<13)); + val |= (data ? 0:(1<<12)); + OUTREG(info->DDCReg, val); + } else { + val = INREG(info->DDCReg) & (CARD32)~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1); + val |= (Clock ? 0:RADEON_GPIO_EN_1); + val |= (data ? 0:RADEON_GPIO_EN_0); + OUTREG(info->DDCReg, val); + } /* read back to improve reliability on some cards. */ val = INREG(info->DDCReg); } @@ -562,13 +575,16 @@ static RADEONMonitorType RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, RADEONDDCT case DDC_CRT2: info->DDCReg = RADEON_GPIO_CRT2_DDC; break; + case DDC_LCD: + info->DDCReg = RADEON_LCD_GPIO_MASK; + break; default: info->DDCReg = DDCReg; return MT_NONE; } /* Read and output monitor info using DDC2 over I2C bus */ - if (info->pI2CBus && info->ddc2) { + if (info->pI2CBus && info->ddc2 && (info->DDCReg != RADEON_LCD_GPIO_MASK)) { OUTREG(info->DDCReg, INREG(info->DDCReg) & (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); @@ -620,15 +636,17 @@ static RADEONMonitorType RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, RADEONDDCT OUTREG(info->DDCReg, INREG(info->DDCReg) | RADEON_GPIO_EN_1); OUTREG(info->DDCReg, INREG(info->DDCReg) | RADEON_GPIO_EN_0); usleep(15000); - if(*MonInfo) break; + if(*MonInfo) break; } + } else if (info->pI2CBus && info->ddc2 && info->DDCReg == RADEON_LCD_GPIO_MASK) { + *MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, info->pI2CBus); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DDC2/I2C is not properly initialized\n"); MonType = MT_NONE; } OUTREG(info->DDCReg, INREG(info->DDCReg) & - ~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1)); + ~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1)); if (*MonInfo) { if ((*MonInfo)->rawData[0x14] & 0x80) { diff --git a/src/radeon_probe.h b/src/radeon_probe.h index f446516..dc30e2e 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -48,7 +48,8 @@ typedef enum DDC_MONID, DDC_DVI, DDC_VGA, - DDC_CRT2 + DDC_CRT2, + DDC_LCD, } RADEONDDCType; typedef enum diff --git a/src/radeon_reg.h b/src/radeon_reg.h index b50fcf0..0d5e586 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -907,6 +907,8 @@ # define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1<<13) # define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) # define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) +#define RADEON_LCD_GPIO_MASK 0x01a0 +#define RADEON_LCD_GPIO_Y_REG 0x01a4 #define RADEON_MDGPIO_A_REG 0x01ac #define RADEON_MDGPIO_EN_REG 0x01b0 #define RADEON_MDGPIO_MASK 0x0198 -- cgit v1.2.3 From a3ee42207aab77d93655a82fdcb32be38268b85f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 25 Apr 2007 09:52:22 +1000 Subject: radeon: another attempt at fixing the mergedfb refresh rate This attempts to keep it inside the 32-bit limit when multiplying things out later in the randr tree. Let me know if I screwed this up.. --- src/radeon_mergedfb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c index fa143cb..abbc160 100644 --- a/src/radeon_mergedfb.c +++ b/src/radeon_mergedfb.c @@ -215,8 +215,13 @@ RADEONCopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest, * extension to allow selecting among a number of modes whose merged result * looks identical but consists of different modes for CRT1 and CRT2 */ - mode->VRefresh = (float)((i->Clock * 1000.0 / i->HTotal / i->VTotal) * 100 + - (j->Clock * 1000.0 / j->HTotal / j->VTotal)); + { + float ref1, ref2; + ref1 = ((float)i->Clock * 100.0 / i->HTotal / i->VTotal) * 50.0; + ref2 = ((float)j->Clock * 100.0 / j->HTotal / j->VTotal) / 2.0; + + mode->VRefresh = (float) ref1 + ref2; + } mode->Clock = (int)(mode->VRefresh * 0.001 * mode->HTotal * mode->VTotal); -- cgit v1.2.3