From de1b633f916f4fcaaa95b226a8622d37041c86d4 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 16 Oct 2008 15:41:44 -0300 Subject: Revert/modify some RandR changes to reenable XAA. XAA was not initialized anymore in RandR patch, but it is still the default accel method. Also reenable offscreen fb manager. At least on the MSOC OEM sample (using X Server 1.4), needs some more work as EXA is crashing in a call to exaPrepareAccess() when switching to a terminal; this seems to be related to disabling exa offscreen pixmaps on the smi501. --- src/smi_driver.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/smi_driver.c b/src/smi_driver.c index 321a8ab..4c55f41 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1707,9 +1707,43 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if(!SMI_HWInit(pScrn)) RETURN(FALSE); + /* Unless using EXA, regardless or using XAA or not, needs offscreen + * management at least for video. */ + if (pSmi->NoAccel || !pSmi->useEXA) { + int numLines; + BoxRec AvailFBArea; + RegionRec AvailFBRegion; + + pSmi->width = pScrn->virtualX; + pSmi->height = pScrn->virtualY; + pSmi->Stride = (pSmi->width * pSmi->Bpp + 15) & ~15; + numLines = pSmi->FBReserved / (pScrn->displayWidth * pSmi->Bpp); + AvailFBArea.x1 = 0; + if(pSmi->randrRotation) /* The rotated mode could need more memory */ + AvailFBArea.y1= max(((pScrn->virtualX * pSmi->Bpp + 15) & ~15) * + pScrn->virtualY, + ((pScrn->virtualY * pSmi->Bpp + 15) & ~15) * + pScrn->virtualX) / (pScrn->virtualX * pSmi->Bpp); + else + AvailFBArea.y1 = pScrn->virtualY; + AvailFBArea.x2 = pScrn->virtualX; + AvailFBArea.y2 = numLines; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "FrameBuffer Box: %d,%d - %d,%d\n", + AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, + AvailFBArea.y2); + REGION_INIT(pScreen, &AvailFBRegion, &AvailFBArea, 1); + xf86InitFBManagerRegion(pScreen, &AvailFBRegion); + REGION_UNINIT(pScreen, &AvailFBRegion); + } + /* Initialize acceleration layer */ - if (!pSmi->NoAccel && pSmi->useEXA) - SMI_EXAInit(pScreen); + if (!pSmi->NoAccel) { + if (pSmi->useEXA && !SMI_EXAInit(pScreen)) + RETURN(FALSE); + else if (!pSmi->useEXA && !SMI_XAAInit(pScreen)) + RETURN(FALSE); + } /* Initialize the chosen modes */ if (!xf86SetDesiredModes(pScrn)) -- cgit v1.2.3