diff options
author | Francisco Jerez <currojerez@gmail.com> | 2008-10-27 22:39:52 +0100 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-10-28 15:09:19 -0200 |
commit | c0447d33c82829248e642b3156fd9a3c0d0eb709 (patch) | |
tree | 6e5680c1c9c9880c22e88c43005b3a96e4de5756 /src/smi_driver.c | |
parent | f2c83671cccc42345bfc9b506365936bbb6b9ef0 (diff) |
Some corrections in the CRTC code.
* Make screen resizing behave better with XAA.
* Move some local variable declarations to the top of
the function definition to conform ANSI C.
* Make the Lynx panel modesetting code to actually
program the panel sync pulse width in dualhead mode.
* Also, fix a crash when using libpciaccess
(the memory wasn't being unmapped).
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r-- | src/smi_driver.c | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c index 9b4d07a..3906555 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -877,6 +877,25 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Dual head %sabled\n", pSmi->Dualhead ? "en" : "dis"); + if (!pSmi->NoAccel) { + char *strptr; + + from = X_DEFAULT; + if ((strptr = (char *)xf86GetOptValString(pSmi->Options, + OPTION_ACCELMETHOD))) { + if (!xf86NameCmp(strptr,"XAA")) { + from = X_CONFIG; + pSmi->useEXA = FALSE; + } else if(!xf86NameCmp(strptr,"EXA")) { + from = X_CONFIG; + pSmi->useEXA = TRUE; + } + } + + xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration architecture\n", + pSmi->useEXA ? "EXA" : "XAA"); + } + SMI_MapMmio(pScrn); SMI_DetectMem(pScrn); SMI_MapMem(pScrn); @@ -938,7 +957,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if(!SMI_OutputPreInit(pScrn)) RETURN(FALSE); - if (!xf86InitialConfiguration (pScrn, TRUE)){ + /* Only allow growing the screen dimensions if EXA is being used */ + if (!xf86InitialConfiguration (pScrn, !pSmi->NoAccel && pSmi->useEXA)){ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); RETURN(FALSE); } @@ -962,25 +982,6 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) RETURN(FALSE); } - if (!pSmi->NoAccel) { - char *strptr; - - from = X_DEFAULT; - if ((strptr = (char *)xf86GetOptValString(pSmi->Options, - OPTION_ACCELMETHOD))) { - if (!xf86NameCmp(strptr,"XAA")) { - from = X_CONFIG; - pSmi->useEXA = FALSE; - } else if(!xf86NameCmp(strptr,"EXA")) { - from = X_CONFIG; - pSmi->useEXA = TRUE; - } - } - - xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration architecture\n", - pSmi->useEXA ? "EXA" : "XAA"); - } - xf86LoaderReqSymLists(fbSymbols, NULL); /* Load XAA or EXA if needed */ @@ -1499,7 +1500,7 @@ SMI_MapMem(ScrnInfoPtr pScrn) void **result = (void**)&pSmi->FBBase; int err = pci_device_map_range(pSmi->PciInfo, pScrn->memPhysBase + - pSmi->fbMapOffset, + pSmi->fbMapOffset, pSmi->videoRAMBytes, PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE, @@ -1590,14 +1591,24 @@ SMI_UnmapMem(ScrnInfoPtr pScrn) SMI_DisableMmio(pScrn); if (pSmi->MapBase) { +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSmi->MapBase, pSmi->MapSize); +#else + pci_device_unmap_range(pSmi->PciInfo, (pointer)pSmi->MapBase, + pSmi->MapSize); +#endif pSmi->MapBase = NULL; } if (pSmi->FBBase) { +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pSmi->FBBase, pSmi->videoRAMBytes); +#else + pci_device_unmap_range(pSmi->PciInfo, (pointer)pSmi->FBBase, + pSmi->videoRAMBytes); +#endif pSmi->FBBase = NULL; } |