Ejemplo n.º 1
0
Bool 
Neo2200AccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    NEOPtr nPtr = NEOPTR(pScrn);
    NEOACLPtr nAcl = NEOACLPTR(pScrn);

    nPtr->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if(!infoPtr) return FALSE;

    /*
     * Set up the main acceleration flags.
     */
    infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
    if(nAcl->cacheEnd > nAcl->cacheStart) infoPtr->Flags |= PIXMAP_CACHE;
#if 0
    infoPtr->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES;
#endif
    /* sync */
    infoPtr->Sync = Neo2200Sync;

    /* screen to screen copy */
    infoPtr->ScreenToScreenCopyFlags = (NO_TRANSPARENCY | NO_PLANEMASK);
    infoPtr->SetupForScreenToScreenCopy = 
	Neo2200SetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy
#ifdef NOT_BROKEN
	= Neo2200SubsequentScreenToScreenCopy;
#else
	= Neo2200SubsequentScreenToScreenCopyBroken;
Ejemplo n.º 2
0
/*
 * ATIInitializeAcceleration --
 *
 * This function is called to initialise both the framebuffer manager and XAA
 * on a screen.
 */
Bool
ATIInitializeAcceleration
(
    ScreenPtr   pScreen,
    ScrnInfoPtr pScreenInfo,
    ATIPtr      pATI
)
{
    int maxScanlines = 32767, maxPixelArea, PixelArea;

    if (pATI->OptionAccel)
    {
        if (!(pATI->pXAAInfo = XAACreateInfoRec()))
            return FALSE;

        switch (pATI->Adapter)
        {
            case ATI_ADAPTER_MACH64:
                maxScanlines = ATIMach64AccelInit(pATI, pATI->pXAAInfo);
                break;

            default:
                break;
        }
    }

#ifndef AVOID_CPIO

    if (!pATI->BankInfo.BankSize)

#endif /* AVOID_CPIO */

#ifdef XF86DRI_DEVEL

        /* If DRI is enabled, we've already set up the FB manager in ATIScreenInit */
        if (!pATI->directRenderingEnabled)

#endif /* XF86DRI */
    {
        /*
         * Note:  If PixelArea exceeds the engine's maximum, the excess is
         *        never used, even though it would be useful for such things
         *        as XVideo buffers.
         */
        maxPixelArea = maxScanlines * pScreenInfo->displayWidth;
        PixelArea = pScreenInfo->videoRam * 1024 * 8 / pATI->bitsPerPixel;
        if (PixelArea > maxPixelArea)
            PixelArea = maxPixelArea;
        xf86InitFBManagerArea(pScreen, PixelArea, 2);
    }

    if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
        return TRUE;

    XAADestroyInfoRec(pATI->pXAAInfo);
    pATI->pXAAInfo = NULL;
    return FALSE;
}
Ejemplo n.º 3
0
/*
 * ATIInitializeAcceleration --
 *
 * This function is called to initialise both the framebuffer manager and XAA
 * on a screen.
 */
Bool
ATIInitializeAcceleration
(
    ScreenPtr   pScreen,
    ScrnInfoPtr pScreenInfo,
    ATIPtr      pATI
)
{
    int maxScanlines = 32767, maxPixelArea, PixelArea;

    if (pATI->OptionAccel)
    {
        if (!(pATI->pXAAInfo = XAACreateInfoRec()))
            return FALSE;

        switch (pATI->Adapter)
        {
            case ATI_ADAPTER_MACH64:
                maxScanlines = ATIMach64AccelInit(pATI, pATI->pXAAInfo);
                break;

            default:
                break;
        }
    }

#ifndef AVOID_CPIO

    if (!pATI->BankInfo.BankSize)

#endif /* AVOID_CPIO */

    {
        maxPixelArea = maxScanlines * pScreenInfo->displayWidth;
        PixelArea = pScreenInfo->videoRam * 1024 * 8 / pATI->bitsPerPixel;
        if (PixelArea > maxPixelArea)
            PixelArea = maxPixelArea;
        xf86InitFBManagerArea(pScreen, PixelArea, 2);
    }

    if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
        return TRUE;

    XAADestroyInfoRec(pATI->pXAAInfo);
    pATI->pXAAInfo = NULL;
    return FALSE;
}
Ejemplo n.º 4
0
Bool
LgXAAInit(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    CirPtr pCir = CIRPTR(pScrn);
    XAAInfoRecPtr XAAPtr;

	XAAPtr = XAACreateInfoRec();
	if (!XAAPtr)
		return FALSE;

	/*
	 * Solid color fills.
	 */
	XAAPtr->SetupForSolidFill = LgSetupForSolidFill;
	XAAPtr->SubsequentSolidFillRect = LgSubsequentSolidFillRect;
	XAAPtr->SubsequentSolidFillTrap = NULL;
	XAAPtr->SolidFillFlags = 0;

	/*
	 * Screen-to-screen copies.
	 */
	XAAPtr->SetupForScreenToScreenCopy = LgSetupForScreenToScreenCopy;
	XAAPtr->SubsequentScreenToScreenCopy = LgSubsequentScreenToScreenCopy;
	/* Maybe ONLY_LEFT_TO_RIGHT_BITBLT or ONLY_TWO_BITBLT_DIRECTIONS? */
	XAAPtr->ScreenToScreenCopyFlags = ONLY_LEFT_TO_RIGHT_BITBLT;

	/*
	 * Miscellany.
	 */
	XAAPtr->Sync = LgSync;

	pCir->AccelInfoRec = XAAPtr;

	if (!XAAInit(pScreen, XAAPtr))
		return FALSE;

	return TRUE;
}
Ejemplo n.º 5
0
Bool
TridentAccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    TRIDENTPtr pTrident = TRIDENTPTR(pScrn);

    if (pTrident->NoAccel)
	return FALSE;

    pTrident->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if (!infoPtr) return FALSE;

    if (!(pTrident->Chipset == TGUI9440AGi && pScrn->bitsPerPixel > 8)) 
    	infoPtr->Flags = PIXMAP_CACHE |
		     OFFSCREEN_PIXMAPS |
		     LINEAR_FRAMEBUFFER;

    pTrident->InitializeAccelerator = TridentInitializeAccelerator;
    TridentInitializeAccelerator(pScrn);

    infoPtr->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES;
 
    infoPtr->Sync = TridentSync;

    infoPtr->SolidLineFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidLine = TridentSetupForSolidLine;
    infoPtr->SolidBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentSolidBresenhamLine = TridentSubsequentSolidBresenhamLine;
    infoPtr->SubsequentSolidHorVertLine = TridentSubsequentSolidHorVertLine;

    infoPtr->DashedLineFlags = LINE_PATTERN_MSBFIRST_LSBJUSTIFIED |
			       NO_PLANEMASK |
			       LINE_PATTERN_POWER_OF_2_ONLY;
    infoPtr->SetupForDashedLine = TridentSetupForDashedLine;
    infoPtr->DashedBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentDashedBresenhamLine = 
					TridentSubsequentDashedBresenhamLine;  
    infoPtr->DashPatternMaxLength = 16;

    infoPtr->SolidFillFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidFill = TridentSetupForFillRectSolid;
    infoPtr->SubsequentSolidFillRect = TridentSubsequentFillRectSolid;
    
    infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK;

    if (!HAS_DST_TRANS) infoPtr->ScreenToScreenCopyFlags |= NO_TRANSPARENCY;

    infoPtr->SetupForScreenToScreenCopy = 	
				TridentSetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy = 		
				TridentSubsequentScreenToScreenCopy;

    if (!((pTrident->Chipset == PROVIDIA9685 ||
	   pTrident->Chipset == CYBER9388) && pScrn->bitsPerPixel > 8)) { 
    	infoPtr->Mono8x8PatternFillFlags =  NO_PLANEMASK | 
					HARDWARE_PATTERN_SCREEN_ORIGIN | 
					BIT_ORDER_IN_BYTE_MSBFIRST;

    	infoPtr->SetupForMono8x8PatternFill =
				TridentSetupForMono8x8PatternFill;
    	infoPtr->SubsequentMono8x8PatternFillRect = 
				TridentSubsequentMono8x8PatternFillRect;
    }

#if 0 /* Not convinced this works 100% yet */
    infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK | 
					HARDWARE_PATTERN_SCREEN_ORIGIN | 
					BIT_ORDER_IN_BYTE_MSBFIRST;

    if (!HAS_DST_TRANS) infoPtr->Color8x8PatternFillFlags |= NO_TRANSPARENCY;

    infoPtr->SetupForColor8x8PatternFill =
				TridentSetupForColor8x8PatternFill;
    infoPtr->SubsequentColor8x8PatternFillRect = 
				TridentSubsequentColor8x8PatternFillRect;
#endif

#if 0 /* This is buggy, it only seems to work 95% of the time.... */
    {
    	infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
					NO_TRANSPARENCY |
					BIT_ORDER_IN_BYTE_MSBFIRST;

    	pTrident->XAAScanlineColorExpandBuffers[0] =
	    xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8));

    	infoPtr->NumScanlineColorExpandBuffers = 1;
    	infoPtr->ScanlineColorExpandBuffers = 
					pTrident->XAAScanlineColorExpandBuffers;

    	infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
			TridentSetupForScanlineCPUToScreenColorExpandFill;
    	infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = 
			TridentSubsequentScanlineCPUToScreenColorExpandFill;
    	infoPtr->SubsequentColorExpandScanline = 
			TridentSubsequentColorExpandScanline;
    }
#endif

    return(XAAInit(pScreen, infoPtr));
}
Ejemplo n.º 6
0
Bool
Neo2097AccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    NEOPtr nPtr = NEOPTR(pScrn);
    NEOACLPtr nAcl = NEOACLPTR(pScrn);

    nPtr->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if(!infoPtr) return FALSE;

    /*
     * Set up the main acceleration flags.
     */
    infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
    if(nAcl->cacheEnd > nAcl->cacheStart) infoPtr->Flags |= PIXMAP_CACHE;

    infoPtr->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES;

    /* sync */
    infoPtr->Sync = Neo2097Sync;

    /* screen to screen copy */
    infoPtr->ScreenToScreenCopyFlags = (NO_TRANSPARENCY | NO_PLANEMASK);
    infoPtr->SetupForScreenToScreenCopy =
        Neo2097SetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy =
        Neo2097SubsequentScreenToScreenCopy;

    /* solid filled rectangles */
    infoPtr->SolidFillFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidFill =
        Neo2097SetupForSolidFillRect;
    infoPtr->SubsequentSolidFillRect =
        Neo2097SubsequentSolidFillRect;

    if (!nPtr->strangeLockups) {
        /* cpu to screen color expansion */
        /*
         * We do CPUToScreenColorExpand (ab)using the Scanline functions:
         * the neo chipsets need byte padding however we can only do dword
         * padding. Fortunately the graphics engine doesn't choke if we
         * transfer up to 3 bytes more than it wants.
         */
        infoPtr->ScanlineColorExpandBuffers =
            (unsigned char **)xnfalloc(sizeof(char*));
        infoPtr->ScanlineColorExpandBuffers[0] = (unsigned char *)(nPtr->NeoMMIOBase + 0x100000);
        infoPtr->NumScanlineColorExpandBuffers = 1;
        infoPtr->ScanlineCPUToScreenColorExpandFillFlags = ( NO_PLANEMASK |
#ifdef NEO_DO_CLIPPING
                LEFT_EDGE_CLIPPING |
#endif
                CPU_TRANSFER_PAD_DWORD |
                BIT_ORDER_IN_BYTE_MSBFIRST );
        infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
            Neo2097SetupScanlineForCPUToScreenColorExpandFill;
        infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
            Neo2097SubsequentScanlineCPUToScreenColorExpandFill;
        infoPtr->SubsequentColorExpandScanline =
            Neo2097SubsequentColorExpandScanline;
    }

#if 0
    /* 8x8 pattern fills */
    infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK
                                       | HARDWARE_PATTERN_PROGRAMMED_ORIGIN
                                       | BIT_ORDER_IN_BYTE_MSBFIRST;

    infoPtr->SetupForMono8x8PatternFill =
        Neo2097SetupForMono8x8PatternFill;
    infoPtr->SubsequentMono8x8PatternFillRect =
        Neo2097SubsequentMono8x8PatternFill;
#endif

    if (!nPtr->strangeLockups) {
        /* image writes */
        infoPtr->ScanlineImageWriteFlags =  ( CPU_TRANSFER_PAD_DWORD |
                                              SCANLINE_PAD_DWORD |
                                              NO_TRANSPARENCY |
                                              NO_PLANEMASK );

        infoPtr->SetupForScanlineImageWrite =
            Neo2097SetupForScanlineImageWrite;
        infoPtr->SubsequentScanlineImageWriteRect =
            Neo2097SubsequentScanlineImageWriteRect;
        infoPtr->SubsequentImageWriteScanline =
            Neo2097SubsequentImageWriteScanline;
        infoPtr->NumScanlineImageWriteBuffers = 1;
        infoPtr->ScanlineImageWriteBuffers =
            infoPtr->ScanlineColorExpandBuffers;
    }

    /*
     * Setup some global variables
     */
    nAcl->ColorShiftAmt = 0;

    /* Initialize for 8bpp or 15/16bpp support accellerated */
    switch (pScrn->bitsPerPixel) {
    case 8:
        nAcl->BltCntlFlags = NEO_BC1_DEPTH8;
        nAcl->ColorShiftAmt = 8;
        break;
    case 15:
    case 16:
        nAcl->BltCntlFlags = NEO_BC1_DEPTH16;
        nAcl->ColorShiftAmt = 0;
        break;
    case 24:
    default:
        return FALSE;
    }

    /* Initialize for widths */
    switch (pScrn->displayWidth) {
    case 640:
        nAcl->BltCntlFlags |= NEO_BC1_X_640;
        break;
    case 800:
        nAcl->BltCntlFlags |= NEO_BC1_X_800;
        break;
    case 1024:
        nAcl->BltCntlFlags |= NEO_BC1_X_1024;
        break;
    default:
        return FALSE;
    }

    return (xaaSetupWrapper(pScreen, infoPtr, pScrn->depth, &nPtr->accelSync));
}
Ejemplo n.º 7
0
Bool 
Neo2070AccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    NEOPtr nPtr = NEOPTR(pScrn);
    NEOACLPtr nAcl = NEOACLPTR(pScrn);

    nPtr->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if(!infoPtr) return FALSE;

    /*
     * Set up the main acceleration flags.
     */
    infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
    if(nAcl->cacheEnd > nAcl->cacheStart) infoPtr->Flags |= PIXMAP_CACHE;
#if 0
    infoPtr->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES;
#endif
    /* sync */
    infoPtr->Sync = Neo2070Sync;

    /* screen to screen copy */
    infoPtr->ScreenToScreenCopyFlags = (NO_TRANSPARENCY | GXCOPY_ONLY);
    infoPtr->SetupForScreenToScreenCopy = 
	Neo2070SetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy = 
	Neo2070SubsequentScreenToScreenCopy;

    /* solid filled rectangles */
    infoPtr->SolidFillFlags = GXCOPY_ONLY;
    infoPtr->SetupForSolidFill = 
	Neo2070SetupForSolidFillRect;
    infoPtr->SubsequentSolidFillRect = 
	Neo2070SubsequentSolidFillRect;

    /*
     * Setup some global variables
     */
    
    /* Initialize for 8bpp or 15/16bpp support accellerated */
    switch (pScrn->bitsPerPixel) {
    case 8:
	nAcl->BltCntlFlags = NEO_BC1_DEPTH8;
	nAcl->ColorShiftAmt = 8;
	nAcl->PixelWidth = 1;
	nAcl->PlaneMask = 0xff;
	break;
    case 15:
    case 16:
	nAcl->BltCntlFlags = NEO_BC1_DEPTH16;
	nAcl->ColorShiftAmt = 0;
	nAcl->PixelWidth = 2;
	nAcl->PlaneMask = 0xffff;
	break;
    case 24: /* not supported, but check anyway */
    default:
	return FALSE;
    }
    
    return(XAAInit(pScreen, infoPtr));

}
Ejemplo n.º 8
0
/*
 * The following function sets up the supported acceleration. Call it
 * from the FbInit() function in the SVGA driver, or before ScreenInit
 * in a monolithic server.
 */
Bool
I740AccelInit(ScreenPtr pScreen) {
  XAAInfoRecPtr infoPtr;
  ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
  I740Ptr pI740 = I740PTR(pScrn);

  pI740->AccelInfoRec = infoPtr = XAACreateInfoRec();
  if (!infoPtr) return FALSE;

  if (pScrn->bitsPerPixel == 32) {
    infoPtr->Flags = 0; /* Disables all acceleration */
    return TRUE;;
  }

  infoPtr->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER;

  /* Sync */
  if (pI740->usePIO)
    infoPtr->Sync = I740SyncPIO;
  else
    infoPtr->Sync = I740SyncMMIO;

  infoPtr->CachePixelGranularity=8/pI740->cpp;

  /* Solid filled rectangles */
  infoPtr->SolidFillFlags = NO_PLANEMASK;
  infoPtr->SetupForSolidFill = I740SetupForSolidFill;
  infoPtr->SubsequentSolidFillRect = I740SubsequentSolidFillRect;

  /* Screen to screen copy */
  infoPtr->ScreenToScreenCopyFlags = (NO_PLANEMASK | NO_TRANSPARENCY);
  infoPtr->SetupForScreenToScreenCopy = I740SetupForScreenToScreenCopy;
  infoPtr->SubsequentScreenToScreenCopy = I740SubsequentScreenToScreenCopy;

  /* 8x8 pattern fills */
  infoPtr->SetupForMono8x8PatternFill = I740SetupForMono8x8PatternFill;
  infoPtr->SubsequentMono8x8PatternFillRect = I740SubsequentMono8x8PatternFillRect;
  infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | HARDWARE_PATTERN_SCREEN_ORIGIN |
    BIT_ORDER_IN_BYTE_MSBFIRST;

  /* CPU to screen color expansion */
  /* Currently XAA is limited to only DWORD padding.  The 3.3 driver
   * uses NO_PAD scanlines b/c of problems with using the chip in
   * DWORD mode. Once other padding modes are available in XAA this
   * Code can be turned back on. 
   */
#if 0
#ifndef ALLOW_PCI_COLOR_EXP
  if (pI740->Chipset != PCI_CHIP_I740_PCI) {
#endif
    /*
     * Currently, we are not properly able to read the bitblt engine
     * busy bit on the PCI i740 card.  When we are able to do so, we
     * can re-enable color expansion.
     */
    infoPtr->CPUToScreenColorExpandFillFlags = 
       					  NO_PLANEMASK |
#ifdef USE_DWORD_COLOR_EXP
					  SCANLINE_PAD_DWORD |
#endif
					  CPU_TRANSFER_PAD_QWORD |
					  SYNC_AFTER_COLOR_EXPAND |
					  BIT_ORDER_IN_BYTE_MSBFIRST;
    infoPtr->ColorExpandBase = (unsigned char *)(pI740->MMIOBase + BLTDATA);
    infoPtr->ColorExpandRange = 0x10000;
    infoPtr->SetupForCPUToScreenColorExpandFill = I740SetupForCPUToScreenColorExpandFill;
    infoPtr->SubsequentCPUToScreenColorExpandFill = I740SubsequentCPUToScreenColorExpandFill;
#ifndef ALLOW_PCI_COLOR_EXP
    }
#endif
#endif
  return XAAInit(pScreen, infoPtr);
}
Ejemplo n.º 9
0
Bool
XPAccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    TRIDENTPtr pTrident = TRIDENTPTR(pScrn);

    if (pTrident->NoAccel)
	return FALSE;

    pTrident->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if (!infoPtr) return FALSE;

    infoPtr->Flags = PIXMAP_CACHE |
		     OFFSCREEN_PIXMAPS |
		     LINEAR_FRAMEBUFFER;

    pTrident->InitializeAccelerator = XPInitializeAccelerator;
    XPInitializeAccelerator(pScrn);

    infoPtr->Sync = XPSync;

#if 0 /* TO DO for the XP */
    infoPtr->SolidLineFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidLine = XPSetupForSolidLine;
    infoPtr->SolidBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentSolidBresenhamLine = XPSubsequentSolidBresenhamLine;

    infoPtr->DashedLineFlags = LINE_PATTERN_MSBFIRST_LSBJUSTIFIED |
			       NO_PLANEMASK |
			       LINE_PATTERN_POWER_OF_2_ONLY;
    infoPtr->SetupForDashedLine = XPSetupForDashedLine;
    infoPtr->DashedBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentDashedBresenhamLine = 
					XPSubsequentDashedBresenhamLine;  
    infoPtr->DashPatternMaxLength = 16;
#endif

    infoPtr->SolidFillFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidFill = XPSetupForFillRectSolid;
    infoPtr->SubsequentSolidFillRect = XPSubsequentFillRectSolid;
    infoPtr->SubsequentSolidHorVertLine = XPSubsequentSolidHorVertLine;
    
    infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY;

    infoPtr->SetupForScreenToScreenCopy = 	
				XPSetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy = 		
				XPSubsequentScreenToScreenCopy;

    infoPtr->Mono8x8PatternFillFlags =  NO_PLANEMASK | 
					HARDWARE_PATTERN_PROGRAMMED_BITS |
					BIT_ORDER_IN_BYTE_MSBFIRST;

    infoPtr->SetupForMono8x8PatternFill =
				XPSetupForMono8x8PatternFill;
    infoPtr->SubsequentMono8x8PatternFillRect = 
				XPSubsequentMono8x8PatternFillRect;

#if 0 /* Needs fixing */
    infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
					BIT_ORDER_IN_BYTE_MSBFIRST;

    pTrident->XAAScanlineColorExpandBuffers[0] =
	    xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8));

    infoPtr->NumScanlineColorExpandBuffers = 1;
    infoPtr->ScanlineColorExpandBuffers = 
					pTrident->XAAScanlineColorExpandBuffers;

    infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
			XPSetupForScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = 
			XPSubsequentScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentColorExpandScanline = 
			XPSubsequentColorExpandScanline;
#endif

    return(XAAInit(pScreen, infoPtr));
}
Bool
Permedia2AccelInit(ScreenPtr pScreen)
{
#ifdef HAVE_XAA_H
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    GLINTPtr pGlint = GLINTPTR(pScrn);
    BoxRec AvailFBArea;

    pGlint->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if (!infoPtr) return FALSE;

    Permedia2InitializeEngine(pScrn);

    infoPtr->Flags = PIXMAP_CACHE |
		     OFFSCREEN_PIXMAPS |
		     LINEAR_FRAMEBUFFER;
 
    infoPtr->Sync = Permedia2Sync;

    infoPtr->SetClippingRectangle = Permedia2SetClippingRectangle;
    infoPtr->DisableClipping = Permedia2DisableClipping;
    infoPtr->ClippingFlags = HARDWARE_CLIP_MONO_8x8_FILL;

    infoPtr->SolidFillFlags = 0;
    infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY; 
    infoPtr->WriteBitmapFlags = 0;
    if (pScrn->bitsPerPixel == 24) {
    	infoPtr->SetupForSolidFill = 
				Permedia2SetupForFillRectSolid24bpp;
    	infoPtr->SubsequentSolidFillRect = 	
				Permedia2SubsequentFillRectSolid24bpp;
    } else {
        infoPtr->SolidLineFlags = 0;
        infoPtr->PolySegmentThinSolidFlags = 0;
        infoPtr->PolylinesThinSolidFlags = 0;
        infoPtr->SetupForSolidLine = Permedia2SetupForSolidLine;
        infoPtr->SubsequentSolidHorVertLine = Permedia2SubsequentHorVertLine;
        if (!(pScrn->overlayFlags & OVERLAY_8_32_PLANAR))
        {
        	infoPtr->SubsequentSolidBresenhamLine = 
				Permedia2SubsequentSolidBresenhamLine;
        }
 	infoPtr->PolySegmentThinSolid = Permedia2PolySegmentThinSolidWrapper;
	infoPtr->PolylinesThinSolid = Permedia2PolylinesThinSolidWrapper;
    	infoPtr->SetupForSolidFill = Permedia2SetupForFillRectSolid;
    	infoPtr->SubsequentSolidFillRect = Permedia2SubsequentFillRectSolid;
    }
    
    if (pScrn->bitsPerPixel >= 24) {
	infoPtr->SetupForScreenToScreenCopy = 	
				Permedia2SetupForScreenToScreenCopy2432bpp;
    	infoPtr->SubsequentScreenToScreenCopy = 		
				Permedia2SubsequentScreenToScreenCopy2432bpp;
    } else {
    	infoPtr->SetupForScreenToScreenCopy = 	
				Permedia2SetupForScreenToScreenCopy;
    	infoPtr->SubsequentScreenToScreenCopy = 		
				Permedia2SubsequentScreenToScreenCopy;
    }

    infoPtr->Mono8x8PatternFillFlags = 
    				HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
    				HARDWARE_PATTERN_PROGRAMMED_BITS |
    				HARDWARE_PATTERN_SCREEN_ORIGIN;

    if (pScrn->bitsPerPixel == 24) {
	infoPtr->SetupForMono8x8PatternFill =
				Permedia2SetupForMono8x8PatternFill24bpp;
	infoPtr->SubsequentMono8x8PatternFillRect = 
				Permedia2SubsequentMono8x8PatternFillRect24bpp;
    } else {
	infoPtr->SetupForMono8x8PatternFill =
				Permedia2SetupForMono8x8PatternFill;
	infoPtr->SubsequentMono8x8PatternFillRect = 
				Permedia2SubsequentMono8x8PatternFillRect;
    }

    infoPtr->ScanlineCPUToScreenColorExpandFillFlags = 
						BIT_ORDER_IN_BYTE_LSBFIRST;

    infoPtr->NumScanlineColorExpandBuffers = 1;
    infoPtr->ScanlineColorExpandBuffers = 
					pGlint->XAAScanlineColorExpandBuffers;
    pGlint->XAAScanlineColorExpandBuffers[0] = 
					pGlint->IOBase + OutputFIFO + 4;

    infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
			Permedia2SetupForScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = 
			Permedia2SubsequentScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentColorExpandScanline = 
			Permedia2SubsequentColorExpandScanline;

    infoPtr->WriteBitmap = Permedia2WriteBitmap;

    if (pScrn->bitsPerPixel == 8) {
  	infoPtr->WritePixmap = Permedia2WritePixmap8bpp;
	infoPtr->WritePixmapFlags = NO_GXCOPY;
    } else
    if (pScrn->bitsPerPixel == 16) {
  	infoPtr->WritePixmap = Permedia2WritePixmap16bpp;
	infoPtr->WritePixmapFlags = NO_GXCOPY;
    } else
    if (pScrn->bitsPerPixel == 32)
  	infoPtr->WritePixmap = Permedia2WritePixmap32bpp;

    /* Now fixup if we are 24bpp */
    if (pScrn->bitsPerPixel == 24) {
	infoPtr->SolidFillFlags |= NO_PLANEMASK;
	infoPtr->ScreenToScreenCopyFlags |= NO_PLANEMASK;
        infoPtr->WriteBitmapFlags |= NO_PLANEMASK;
        infoPtr->ScanlineCPUToScreenColorExpandFillFlags |= NO_PLANEMASK;
        infoPtr->Mono8x8PatternFillFlags |= NO_PLANEMASK;
    }

    AvailFBArea.x1 = 0;
    AvailFBArea.y1 = 0;
    AvailFBArea.x2 = pScrn->displayWidth;
    AvailFBArea.y2 = pGlint->FbMapSize / (pScrn->displayWidth * 
					  pScrn->bitsPerPixel / 8);

    if (AvailFBArea.y2 > 2047) AvailFBArea.y2 = 2047;

    xf86InitFBManager(pScreen, &AvailFBArea);

    return(XAAInit(pScreen, infoPtr));
#else
    return FALSE;
#endif
}
Bool
XP4XaaInit(ScreenPtr pScreen)
{
#ifdef HAVE_XAA_H
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    TRIDENTPtr pTrident = TRIDENTPTR(pScrn);

    if (pTrident->NoAccel)
	return FALSE;

    pTrident->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if (!infoPtr) return FALSE;

    infoPtr->Flags = PIXMAP_CACHE |
		     OFFSCREEN_PIXMAPS |
		     LINEAR_FRAMEBUFFER;

    pTrident->InitializeAccelerator = XP4InitializeAccelerator;
    XP4InitializeAccelerator(pScrn);

    infoPtr->Sync = XP4Sync;

#if 0 /* TO DO for the XP */
    infoPtr->SolidLineFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidLine = XP4SetupForSolidLine;
    infoPtr->SolidBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentSolidBresenhamLine = XP4SubsequentSolidBresenhamLine;

    infoPtr->DashedLineFlags = LINE_PATTERN_MSBFIRST_LSBJUSTIFIED |
			       NO_PLANEMASK |
			       LINE_PATTERN_POWER_OF_2_ONLY;
    infoPtr->SetupForDashedLine = XP4SetupForDashedLine;
    infoPtr->DashedBresenhamLineErrorTermBits = 12;
    infoPtr->SubsequentDashedBresenhamLine = 
					XP4SubsequentDashedBresenhamLine;  
    infoPtr->DashPatternMaxLength = 16;
#endif


    infoPtr->SolidFillFlags = NO_PLANEMASK;
    infoPtr->SetupForSolidFill = XP4SetupForFillRectSolid;
    infoPtr->SubsequentSolidFillRect = XP4SubsequentFillRectSolid;
#if 0
    infoPtr->SubsequentSolidHorVertLine = XP4SubsequentSolidHorVertLine;
#endif
    
    infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY;

    infoPtr->SetupForScreenToScreenCopy = 	
				XP4SetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy = 		
				XP4SubsequentScreenToScreenCopy;

    infoPtr->Mono8x8PatternFillFlags =  NO_PLANEMASK | 
					HARDWARE_PATTERN_PROGRAMMED_BITS |
					HARDWARE_PATTERN_SCREEN_ORIGIN |
					BIT_ORDER_IN_BYTE_MSBFIRST;

    infoPtr->SetupForMono8x8PatternFill =
				XP4SetupForMono8x8PatternFill;
    infoPtr->SubsequentMono8x8PatternFillRect = 
				XP4SubsequentMono8x8PatternFillRect;

#if 0
    infoPtr->CPUToScreenColorExpandFillFlags = NO_PLANEMASK |
					BIT_ORDER_IN_BYTE_MSBFIRST;
    infoPtr->ColorExpandBase = pTrident->D3Base;
    infoPtr->ColorExpandRange = pScrn->displayWidth;

    infoPtr->SetupForCPUToScreenColorExpandFill =
			XP4SetupForCPUToScreenColorExpandFill;
    infoPtr->SubsequentCPUToScreenColorExpandFill = 
			XP4SubsequentCPUToScreenColorExpandFill;
#endif

    return(XAAInit(pScreen, infoPtr));
#else
    return FALSE;
#endif
}
Ejemplo n.º 12
0
Bool
SiSAccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr  infoPtr;
    ScrnInfoPtr    pScrn = xf86Screens[pScreen->myNum];
    SISPtr         pSiS = SISPTR(pScrn);
    BoxRec         AvailFBArea;
    int            topFB, i;
    int            reservedFbSize;
    int            UsableFbSize;
    unsigned char  *AvailBufBase;

    pSiS->AccelInfoPtr = infoPtr = XAACreateInfoRec();
    if (!infoPtr)  return FALSE;

    infoPtr->Flags = LINEAR_FRAMEBUFFER |
  		     OFFSCREEN_PIXMAPS |
  		     PIXMAP_CACHE;

    /* Sync */
    infoPtr->Sync = SiSSync;

    /* Screen To Screen copy */
    infoPtr->SetupForScreenToScreenCopy =  SiSSetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy = SiSSubsequentScreenToScreenCopy;
    infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK;

    /* Solid fill */
    infoPtr->SetupForSolidFill = SiSSetupForFillRectSolid;
    infoPtr->SubsequentSolidFillRect = SiSSubsequentFillRectSolid;
    infoPtr->SolidFillFlags = NO_PLANEMASK;

    /* On 5597/5598 and 6326, clipping and lines only work
       for 1024, 2048, 4096 logical width */
    if(pSiS->ValidWidth) {
        /* Clipping */
        infoPtr->SetClippingRectangle = SiSSetClippingRectangle;
        infoPtr->DisableClipping = SiSDisableClipping;
        infoPtr->ClippingFlags =  
                    HARDWARE_CLIP_SOLID_LINE | 
                    HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY |
                    HARDWARE_CLIP_MONO_8x8_FILL |
                    HARDWARE_CLIP_SOLID_FILL  ;

    	/* Solid Lines */
    	infoPtr->SetupForSolidLine = SiSSetupForSolidLine;
    	infoPtr->SubsequentSolidTwoPointLine = SiSSubsequentSolidTwoPointLine;
    	infoPtr->SubsequentSolidHorVertLine = SiSSubsequentSolidHorVertLine;
	infoPtr->SolidLineFlags = NO_PLANEMASK;
    }

    if(pScrn->bitsPerPixel != 24) {
        /* 8x8 mono pattern */
        infoPtr->SetupForMono8x8PatternFill = SiSSetupForMono8x8PatternFill;
        infoPtr->SubsequentMono8x8PatternFillRect = SiSSubsequentMono8x8PatternFillRect;
	infoPtr->Mono8x8PatternFillFlags =
                    NO_PLANEMASK |
                    HARDWARE_PATTERN_PROGRAMMED_BITS |
                    HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
                    BIT_ORDER_IN_BYTE_MSBFIRST;
    }

#ifdef CTSCE
    if(pScrn->bitsPerPixel != 24) {
       /* TW: per-scanline color expansion (using indirect method) */
       pSiS->ColorExpandBufferNumber = 4;
       pSiS->ColorExpandBufferCountMask = 0x03;
       pSiS->PerColorExpandBufferSize = ((pScrn->virtualX + 31) / 32) * 4;

       infoPtr->NumScanlineColorExpandBuffers = pSiS->ColorExpandBufferNumber;
       infoPtr->ScanlineColorExpandBuffers = (unsigned char **)&pSiS->ColorExpandBufferAddr[0];

       infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
	                            SiSSetupForScanlineCPUToScreenColorExpandFill;
       infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
	                            SiSSubsequentScanlineCPUToScreenColorExpandFill;
       infoPtr->SubsequentColorExpandScanline =
	                            SiSSubsequentColorExpandScanline;
       infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
	    NO_PLANEMASK |
	    CPU_TRANSFER_PAD_DWORD |
	    SCANLINE_PAD_DWORD |
	    BIT_ORDER_IN_BYTE_MSBFIRST |
	    LEFT_EDGE_CLIPPING;
    } else {
       pSiS->ColorExpandBufferNumber = 0;
    }
#else
    pSiS->ColorExpandBufferNumber = 0;
#endif

    topFB = pSiS->maxxfbmem;

    reservedFbSize = pSiS->ColorExpandBufferNumber * pSiS->PerColorExpandBufferSize;

    UsableFbSize = topFB - reservedFbSize;

    /* Layout: (Sizes do not reflect correct proportions)
     * |--------------++++++++++++++++++++|  ====================~~~~~~~~~~~~|
     *   UsableFbSize  ColorExpandBuffers |        TurboQueue     HWCursor
     *                                  topFB
     */

    if(pSiS->ColorExpandBufferNumber) {
      AvailBufBase = pSiS->FbBase + UsableFbSize;
      for (i = 0; i < pSiS->ColorExpandBufferNumber; i++) {
	  pSiS->ColorExpandBufferAddr[i] = AvailBufBase +
		    i * pSiS->PerColorExpandBufferSize;
	  pSiS->ColorExpandBufferScreenOffset[i] = UsableFbSize +
		    i * pSiS->PerColorExpandBufferSize;
      }
    }
    AvailFBArea.x1 = 0;
    AvailFBArea.y1 = 0;
    AvailFBArea.x2 = pScrn->displayWidth;
    AvailFBArea.y2 = UsableFbSize / (pScrn->displayWidth * pScrn->bitsPerPixel / 8) - 1;

    if (AvailFBArea.y2 < 0)
	AvailFBArea.y2 = 32767;

    if(AvailFBArea.y2 < pScrn->currentMode->VDisplay) {
	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
	 	"Not enough video RAM for accelerator. At least "
		"%dKB needed, %dKB available\n",
		((((pScrn->displayWidth * pScrn->bitsPerPixel/8)   /* TW: +8 for make it sure */
		     * pScrn->currentMode->VDisplay) + reservedFbSize) / 1024) + 8,
		pSiS->maxxfbmem/1024);
	pSiS->NoAccel = TRUE;
	pSiS->NoXvideo = TRUE;
	XAADestroyInfoRec(pSiS->AccelInfoPtr);
	pSiS->AccelInfoPtr = NULL;
	return FALSE;
    }

    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
	   "Frame Buffer From (%d,%d) To (%d,%d)\n",
	   AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);

    xf86InitFBManager(pScreen, &AvailFBArea);

    return(XAAInit(pScreen, infoPtr));
}
Ejemplo n.º 13
0
/* The following function sets up the supported acceleration. Call it
 * from the FbInit() function in the SVGA driver, or before ScreenInit
 * in a monolithic server.
 */
Bool
I810AccelInit(ScreenPtr pScreen)
{
   XAAInfoRecPtr infoPtr;
   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
   I810Ptr pI810 = I810PTR(pScrn);

   if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
      ErrorF("I810AccelInit\n");

   pI810->AccelInfoRec = infoPtr = XAACreateInfoRec();
   if (!infoPtr)
      return FALSE;

   pI810->bufferOffset = 0;
   infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
   /* There is a bit blt bug in 24 bpp.  This is a problem, but
    * at least without the pixmap cache we can pass the test suite */
   if (pScrn->depth != 24)
      infoPtr->Flags |= PIXMAP_CACHE;

   /* Sync
    */
   infoPtr->Sync = I810Sync;

   /* Solid filled rectangles 
    */
   {
      infoPtr->SolidFillFlags = NO_PLANEMASK;
      infoPtr->SetupForSolidFill = I810SetupForSolidFill;
      infoPtr->SubsequentSolidFillRect = I810SubsequentSolidFillRect;
   }

   /* Screen to screen copy 
    *   - the transparency op hangs the blit engine, disable for now.
    */
   {
      infoPtr->ScreenToScreenCopyFlags = (0
					  | NO_PLANEMASK
					  | NO_TRANSPARENCY | 0);

      infoPtr->SetupForScreenToScreenCopy = I810SetupForScreenToScreenCopy;
      infoPtr->SubsequentScreenToScreenCopy =
	    I810SubsequentScreenToScreenCopy;
   }

   /* 8x8 pattern fills 
    */
   {
      infoPtr->SetupForMono8x8PatternFill = I810SetupForMono8x8PatternFill;
      infoPtr->SubsequentMono8x8PatternFillRect =
	    I810SubsequentMono8x8PatternFillRect;

      infoPtr->Mono8x8PatternFillFlags = (HARDWARE_PATTERN_PROGRAMMED_BITS |
					  HARDWARE_PATTERN_SCREEN_ORIGIN |
					  BIT_ORDER_IN_BYTE_MSBFIRST |
					  NO_PLANEMASK | 0);
   }

   /* 8x8 color fills - not considered useful for XAA.
    */

   /* Scanline color expansion - Use the same scheme as the 3.3 driver.  
    *
    */
   if (pI810->Scratch.Size != 0) {
      int i;
      int width = ((pScrn->displayWidth + 31) & ~31) / 8;
      int nr_buffers = pI810->Scratch.Size / width;
      unsigned char *ptr = pI810->FbBase + pI810->Scratch.Start;

      pI810->NumScanlineColorExpandBuffers = nr_buffers;
      pI810->ScanlineColorExpandBuffers = (unsigned char **)
	    xnfcalloc(nr_buffers, sizeof(unsigned char *));

      for (i = 0; i < nr_buffers; i++, ptr += width)
	 pI810->ScanlineColorExpandBuffers[i] = ptr;

      infoPtr->ScanlineCPUToScreenColorExpandFillFlags = (NO_PLANEMASK |
							  ROP_NEEDS_SOURCE |
							  BIT_ORDER_IN_BYTE_MSBFIRST
							  | 0);

      infoPtr->ScanlineColorExpandBuffers = (unsigned char **)
	    xnfcalloc(1, sizeof(unsigned char *));
      infoPtr->NumScanlineColorExpandBuffers = 1;

      infoPtr->ScanlineColorExpandBuffers[0] =
	    pI810->ScanlineColorExpandBuffers[0];
      pI810->nextColorExpandBuf = 0;

      infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
	    I810SetupForScanlineCPUToScreenColorExpandFill;

      infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
	    I810SubsequentScanlineCPUToScreenColorExpandFill;

      infoPtr->SubsequentColorExpandScanline =
	    I810SubsequentColorExpandScanline;
   }

   /* Possible todo: Image writes w/ non-GXCOPY rop.
    */

   I810SelectBuffer(pScrn, I810_SELECT_FRONT);

   return XAAInit(pScreen, infoPtr);
}
Ejemplo n.º 14
0
Bool
SMI_AccelInit(ScreenPtr pScreen)
{
	XAAInfoRecPtr infoPtr;
	ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
	SMIPtr pSmi = SMIPTR(pScrn);
    /*BoxRec AvailFBArea;*/
	Bool ret;
    /*int numLines, maxLines;*/

	ENTER_PROC("SMI_AccelInit");

	pSmi->AccelInfoRec = infoPtr = XAACreateInfoRec();
	if (infoPtr == NULL)
	{
		LEAVE_PROC("SMI_AccelInit");
		return FALSE;
	}

	infoPtr->Flags = PIXMAP_CACHE
				   | LINEAR_FRAMEBUFFER
				   | OFFSCREEN_PIXMAPS;

	infoPtr->Sync = SMI_AccelSync;

	/* Screen to screen copies */
	infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK
									 | ONLY_TWO_BITBLT_DIRECTIONS;
	infoPtr->SetupForScreenToScreenCopy = SMI_SetupForScreenToScreenCopy;
	infoPtr->SubsequentScreenToScreenCopy = SMI_SubsequentScreenToScreenCopy;
	if (pScrn->bitsPerPixel == 24)
	{
		infoPtr->ScreenToScreenCopyFlags |= NO_TRANSPARENCY;
	}
	if ((pSmi->Chipset == SMI_LYNX3D) && (pScrn->bitsPerPixel == 8))
	{
		infoPtr->ScreenToScreenCopyFlags |= GXCOPY_ONLY;
	}

	/* Solid Fills */
	infoPtr->SolidFillFlags = NO_PLANEMASK;
	infoPtr->SetupForSolidFill = SMI_SetupForSolidFill;
	infoPtr->SubsequentSolidFillRect = SMI_SubsequentSolidFillRect;

	/* Solid Lines */
	infoPtr->SolidLineFlags = NO_PLANEMASK;
	infoPtr->SetupForSolidLine = SMI_SetupForSolidFill;
	infoPtr->SubsequentSolidHorVertLine = SMI_SubsequentSolidHorVertLine;

	/* Color Expansion Fills */
	infoPtr->CPUToScreenColorExpandFillFlags = ROP_NEEDS_SOURCE
											 | NO_PLANEMASK
											 | BIT_ORDER_IN_BYTE_MSBFIRST
											 | LEFT_EDGE_CLIPPING
											 | CPU_TRANSFER_PAD_DWORD
											 | SCANLINE_PAD_DWORD;
	infoPtr->ColorExpandBase = pSmi->DataPortBase;
	infoPtr->ColorExpandRange = pSmi->DataPortSize;
	infoPtr->SetupForCPUToScreenColorExpandFill =
			SMI_SetupForCPUToScreenColorExpandFill;
	infoPtr->SubsequentCPUToScreenColorExpandFill =
			SMI_SubsequentCPUToScreenColorExpandFill;

	/* 8x8 Mono Pattern Fills */
	infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK
									 | HARDWARE_PATTERN_PROGRAMMED_BITS
									 | HARDWARE_PATTERN_SCREEN_ORIGIN
									 | BIT_ORDER_IN_BYTE_MSBFIRST;
	infoPtr->SetupForMono8x8PatternFill = SMI_SetupForMono8x8PatternFill;
	infoPtr->SubsequentMono8x8PatternFillRect =
			SMI_SubsequentMono8x8PatternFillRect;

	/* 8x8 Color Pattern Fills */
	if (!SMI_LYNX3D_SERIES(pSmi->Chipset) || (pScrn->bitsPerPixel != 24))
	{
		infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK
										  | HARDWARE_PATTERN_SCREEN_ORIGIN;
		infoPtr->SetupForColor8x8PatternFill =
				SMI_SetupForColor8x8PatternFill;
		infoPtr->SubsequentColor8x8PatternFillRect =
				SMI_SubsequentColor8x8PatternFillRect;
	}

#if SMI_USE_IMAGE_WRITES
	/* Image Writes */
	infoPtr->ImageWriteFlags = ROP_NEEDS_SOURCE
							 | NO_PLANEMASK
							 | CPU_TRANSFER_PAD_DWORD
							 | SCANLINE_PAD_DWORD;
	infoPtr->ImageWriteBase = pSmi->DataPortBase;
	infoPtr->ImageWriteRange = pSmi->DataPortSize;
	infoPtr->SetupForImageWrite = SMI_SetupForImageWrite;
	infoPtr->SubsequentImageWriteRect = SMI_SubsequentImageWriteRect;
#endif

	/* Clipping */
	infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
						   | HARDWARE_CLIP_MONO_8x8_FILL
						   | HARDWARE_CLIP_COLOR_8x8_FILL
						   | HARDWARE_CLIP_SOLID_FILL
						   | HARDWARE_CLIP_SOLID_LINE
						   | HARDWARE_CLIP_DASHED_LINE;
	infoPtr->SetClippingRectangle = SMI_SetClippingRectangle;
	infoPtr->DisableClipping = SMI_DisableClipping;

	/* Pixmap Cache */
	if (pScrn->bitsPerPixel == 24)
	{
		infoPtr->CachePixelGranularity = 16;
	}
	else
	{
		infoPtr->CachePixelGranularity = 128 / pScrn->bitsPerPixel;
	}

	/* Offscreen Pixmaps */
	infoPtr->maxOffPixWidth  = 4096;
	infoPtr->maxOffPixHeight = 4096;
	if (pScrn->bitsPerPixel == 24)
	{
		infoPtr->maxOffPixWidth = 4096 / 3;

		if (pSmi->Chipset == SMI_LYNX)
		{
			infoPtr->maxOffPixHeight = 4096 / 3;
		}
	}

	SMI_EngineReset(pScrn);


    /* CZ 18.06.2001: moved to smi_driver.c before the NoAccel question
       to have offscreen framebuffer in NoAccel mode */
#if 0
	maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp);
	if (pSmi->rotate)
	{
		numLines = maxLines;
	}
	else
	{
#if defined(XvExtension) && SMI_USE_VIDEO
		numLines = ((pSmi->FBReserved - pSmi->width * pSmi->Bpp * pSmi->height)
				 * 25 / 100 + pSmi->width * pSmi->Bpp - 1)
				 / (pSmi->width * pSmi->Bpp);
		numLines += pSmi->height;
#else
		numLines = maxLines;
#endif
	}

	AvailFBArea.x1 = 0;
	AvailFBArea.y1 = 0;
	AvailFBArea.x2 = pSmi->width;
	AvailFBArea.y2 = numLines;
	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FrameBuffer Box: %d,%d - %d,%d\n",
			AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);
	xf86InitFBManager(pScreen, &AvailFBArea);
#endif

	ret = XAAInit(pScreen, infoPtr);
	if (ret && pSmi->shadowFB)										/* #671 */
	{
		pSmi->ValidatePolylines = infoPtr->ValidatePolylines;
		infoPtr->ValidatePolylines = SMI_ValidatePolylines;
	}

	LEAVE_PROC("SMI_AccelInit");
	return(ret);
}
Ejemplo n.º 15
0
Bool
Permedia3AccelInit(ScreenPtr pScreen)
{
    XAAInfoRecPtr infoPtr;
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    GLINTPtr pGlint = GLINTPTR(pScrn);

    pGlint->AccelInfoRec = infoPtr = XAACreateInfoRec();
    if (!infoPtr) return FALSE;

    /* Generic accel engine flags */
    infoPtr->Flags = PIXMAP_CACHE |
		     OFFSCREEN_PIXMAPS |
		     LINEAR_FRAMEBUFFER;

    /* Synchronization of the accel engine */
    if (pGlint->MultiAperture)
    	infoPtr->Sync = DualPermedia3Sync;
    else
    	infoPtr->Sync = Permedia3Sync;

    Permedia3InitializeEngine(pScrn);

    /* Clipping Setup */
    infoPtr->ClippingFlags = 0;
    infoPtr->SetClippingRectangle = Permedia3SetClippingRectangle;
    infoPtr->DisableClipping = Permedia3DisableClipping;

    /* ScreenToScreenCopy */
    infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
    infoPtr->SetupForScreenToScreenCopy =
					Permedia3SetupForScreenToScreenCopy;
    infoPtr->SubsequentScreenToScreenCopy =
					Permedia3SubsequentScreenToScreenCopy;

    /* SolidFill */
    infoPtr->SolidFillFlags = 0;
    infoPtr->SetupForSolidFill = Permedia3SetupForFillRectSolid;
    infoPtr->SubsequentSolidFillRect = Permedia3SubsequentFillRectSolid;

    /* 8x8 Mono Pattern Fills */
    infoPtr->Mono8x8PatternFillFlags =  HARDWARE_PATTERN_PROGRAMMED_BITS |
    					HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
    					HARDWARE_PATTERN_SCREEN_ORIGIN |
					BIT_ORDER_IN_BYTE_LSBFIRST;
    infoPtr->SetupForMono8x8PatternFill =
				Permedia3SetupForMono8x8PatternFill;
    infoPtr->SubsequentMono8x8PatternFillRect = 
				Permedia3SubsequentMono8x8PatternFillRect;

    infoPtr->ScanlineCPUToScreenColorExpandFillFlags = 
						LEFT_EDGE_CLIPPING |
						LEFT_EDGE_CLIPPING_NEGATIVE_X |
					       	BIT_ORDER_IN_BYTE_LSBFIRST |
						CPU_TRANSFER_PAD_DWORD;

    infoPtr->NumScanlineColorExpandBuffers = 1;
    pGlint->ScratchBuffer                 = xalloc(((pScrn->virtualX+62)/32*4)
					    + (pScrn->virtualX
					    * pScrn->bitsPerPixel / 8));
    infoPtr->ScanlineColorExpandBuffers = 
					pGlint->XAAScanlineColorExpandBuffers;
    pGlint->XAAScanlineColorExpandBuffers[0] = 
					pGlint->IOBase + OutputFIFO + 4;

    infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
			Permedia3SetupForScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = 
			Permedia3SubsequentScanlineCPUToScreenColorExpandFill;
    infoPtr->SubsequentColorExpandScanline = 
			Permedia3SubsequentColorExpandScanline;

    infoPtr->ScanlineImageWriteFlags = 	NO_GXCOPY |
					LEFT_EDGE_CLIPPING |
					LEFT_EDGE_CLIPPING_NEGATIVE_X |
					BIT_ORDER_IN_BYTE_LSBFIRST |
					CPU_TRANSFER_PAD_DWORD;
    infoPtr->NumScanlineImageWriteBuffers = 1;
    infoPtr->ScanlineImageWriteBuffers = 
					pGlint->XAAScanlineColorExpandBuffers;
    infoPtr->SetupForScanlineImageWrite =
	    Permedia3SetupForScanlineImageWrite;
    infoPtr->SubsequentScanlineImageWriteRect =
	    Permedia3SubsequentScanlineImageWriteRect;
    infoPtr->SubsequentImageWriteScanline = 
			Permedia3SubsequentImageWriteScanline;

    infoPtr->WriteBitmap = Permedia3WriteBitmap;
    infoPtr->WriteBitmapFlags = 0;

    infoPtr->WritePixmap = Permedia3WritePixmap;
    infoPtr->WritePixmapFlags = 0;

    {
	Bool shared_accel = FALSE;
	int i;

	for(i = 0; i < pScrn->numEntities; i++) {
	    if(xf86IsEntityShared(pScrn->entityList[i]))
		shared_accel = TRUE;
	}
	if(shared_accel == TRUE)
	    infoPtr->RestoreAccelState = Permedia3RestoreAccelState;
    }

    Permedia3EnableOffscreen(pScreen);

    return(XAAInit(pScreen, infoPtr));
}