summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2004-05-26 16:24:09 +0000
committerEgbert Eich <eich@suse.de>2004-05-26 16:24:09 +0000
commit1f957fb7e44762197b0fc5a3b7def25c7888929a (patch)
tree994e920fd37ace5a75f72be815c2fbc9af4bc400
parent445708ff1249e96628dd6b11e20f83e568fb4ad1 (diff)
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.
-rw-r--r--src/smi.h3
-rw-r--r--src/smi_driver.c35
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;
}
/*