From 08a45118b53129f3b9c30004404b906c7d7690be Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sun, 19 Dec 2004 19:29:10 +0000 Subject: - Make dualhead ram allocation cleaner and related messages clearer --- src/radeon.h | 1 + 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; -- cgit v1.2.3