diff options
author | Alex Deucher <agd5f@yahoo.com> | 2004-12-19 19:29:10 +0000 |
---|---|---|
committer | Alex Deucher <agd5f@yahoo.com> | 2004-12-19 19:29:10 +0000 |
commit | 08a45118b53129f3b9c30004404b906c7d7690be (patch) | |
tree | 6da02d6db005eda8c6342381a990dd636b31e028 | |
parent | 97cfd7b1489a9510cd233d6dc7154c210f32b9f5 (diff) |
- Make dualhead ram allocation cleaner and related messages clearer
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_driver.c | 42 |
2 files changed, 26 insertions, 17 deletions
diff --git a/src/radeon.h b/src/radeon.h index 4c3c720f..48be2122 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -315,6 +315,7 @@ typedef struct { Bool IsIGP; /* IGP chips */ Bool HasSingleDAC; /* only TVDAC on chip */ Bool IsSecondary; /* Second Screen */ + Bool IsPrimary; /* Primary Screen */ Bool IsSwitching; /* Flag for switching mode */ Bool OverlayOnCRTC2; Bool PanelOff; /* Force panel (LCD/DFP) off */ diff --git a/src/radeon_driver.c b/src/radeon_driver.c index f7b8ddcb..fffcfa8e 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -2545,21 +2545,6 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) /* Some production boards of m6 will return 0 if it's 8 MB */ if (pScrn->videoRam == 0) pScrn->videoRam = 8192; - if (info->IsSecondary) { - /* FIXME: For now, split FB into two equal sections. This should - * be able to be adjusted by user with a config option. */ - RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - RADEONInfoPtr info1; - - pScrn->videoRam /= 2; - pRADEONEnt->pPrimaryScrn->videoRam = pScrn->videoRam; - - info1 = RADEONPTR(pRADEONEnt->pPrimaryScrn); - info1->FbMapSize = pScrn->videoRam * 1024; - info->LinearAddr += pScrn->videoRam * 1024; - info1->MergedFB = FALSE; - } - info->R300CGWorkaround = (info->ChipFamily == CHIP_FAMILY_R300 && (INREG(RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) @@ -2578,11 +2563,31 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) from = X_CONFIG; pScrn->videoRam = dev->videoRam; } - pScrn->videoRam &= ~1023; - info->FbMapSize = pScrn->videoRam * 1024; + xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kByte (%d bit %s SDRAM)\n", pScrn->videoRam, info->RamWidth, info->IsDDR?"DDR":"SDR"); + /* FIXME: For now, split FB into two equal sections. This should + * be able to be adjusted by user with a config option. */ + if (info->IsPrimary) { + pScrn->videoRam /= 2; + info->MergedFB = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Using %dk of videoram for primary head\n", + pScrn->videoRam); + } + + if (info->IsSecondary) { + pScrn->videoRam /= 2; + info->LinearAddr += pScrn->videoRam * 1024; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Using %dk of videoram for secondary head\n", + pScrn->videoRam); + } + + pScrn->videoRam &= ~1023; + info->FbMapSize = pScrn->videoRam * 1024; + #ifdef XF86DRI /* AGP/PCI */ /* Proper autodetection of an AGP capable device requires examining @@ -4321,6 +4326,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) info = RADEONPTR(pScrn); info->IsSecondary = FALSE; + info->IsPrimary = FALSE; info->MergedFB = FALSE; info->IsSwitching = FALSE; info->MMIO = NULL; @@ -4381,6 +4387,8 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) } else { RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + info->IsPrimary = TRUE; + xf86SetPrimInitDone(info->pEnt->index); pRADEONEnt->pPrimaryScrn = pScrn; |