From 1f957fb7e44762197b0fc5a3b7def25c7888929a Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 26 May 2004 16:24:09 +0000 Subject: Fixing setting of physical framebuffer base for several drivers. C&T driver: Fixed setting of minimal clocks for HiQV chipsets. Neomagic driver: improved support for lowres double scan modes. --- src/smi.h | 3 ++- src/smi_driver.c | 35 ++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/smi.h b/src/smi.h index 07d73e8..d8fe50f 100644 --- a/src/smi.h +++ b/src/smi.h @@ -227,7 +227,8 @@ typedef struct pixels */ CARD32 saveBufferSize; /* #670 - FB save buffer size */ void * pSaveBuffer; /* #670 - FB save buffer */ - CARD32 savedFBOffset; /* #670 - Saved FBOffset value */ + CARD32 fbMapOffset; /* offset for fb mapping */ + CARD32 savedFBOffset; /* #670 - Saved FBOffset value */ CARD32 savedFBReserved; /* #670 - Saved FBReserved value */ CARD8 * paletteBuffer; /* #920 - Palette save buffer */ diff --git a/src/smi_driver.c b/src/smi_driver.c index 608d9d9..8f94001 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1860,20 +1860,21 @@ SMI_MapMem(ScrnInfoPtr pScrn) "DataPort=%p - %p\n", pSmi->DataPortBase, pSmi->DataPortBase + pSmi->DataPortSize - 1); + pScrn->memPhysBase = pSmi->PciInfo->memBase[0]; + /* Map the frame buffer */ - if (pSmi->Chipset == SMI_LYNX3DM) - { - pScrn->memPhysBase = pSmi->PciInfo->memBase[0] + 0x200000; - } + if (pSmi->Chipset == SMI_LYNX3DM) + pSmi->fbMapOffset = 0x200000; else - { - pScrn->memPhysBase = pSmi->PciInfo->memBase[0]; - } - if (pSmi->videoRAMBytes) - { - pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pSmi->PciTag, pScrn->memPhysBase, pSmi->videoRAMBytes); - + pSmi->fbMapOffset = 0x0; + + if (pSmi->videoRAMBytes) { + pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex, + VIDMEM_FRAMEBUFFER, + pSmi->PciTag, + pScrn->memPhysBase + pSmi->fbMapOffset, + pSmi->videoRAMBytes); + if (pSmi->FBBase == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not " @@ -1882,9 +1883,12 @@ SMI_MapMem(ScrnInfoPtr pScrn) return(FALSE); } } - pSmi->FBOffset = pScrn->fbOffset = 0; + pSmi->FBOffset = 0; + pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset; + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, - "Physical frame buffer at 0x%08lX\n", pScrn->memPhysBase); + "Physical frame buffer at 0x%08lX offset: 0x%08lX\n", + pScrn->memPhysBase, pScrn->fbOffset); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "Logical frame buffer at %p - %p\n", pSmi->FBBase, pSmi->FBBase + pSmi->videoRAMBytes - 1); @@ -2384,7 +2388,7 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) { WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3); } - + pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Shadow: width=%d height=%d " "offset=0x%08lX pitch=0x%08X\n", @@ -2395,6 +2399,7 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) else { pSmi->FBOffset = 0; + pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset; } /* -- cgit v1.2.3