Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 266087 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/savage_driver.c (-1 / +1 lines)
Lines 1700-1707 static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) Link Here
1700
                   "%s DVI port support (Savage4 only)\n",(psav->dvi?"Force":"Disable"));
1700
                   "%s DVI port support (Savage4 only)\n",(psav->dvi?"Force":"Disable"));
1701
    }
1701
    }
1702
1702
1703
    psav->AGPforXv = FALSE;
1704
#ifdef XF86DRI
1703
#ifdef XF86DRI
1704
    psav->AGPforXv = FALSE;
1705
    if (xf86GetOptValBool(psav->Options, OPTION_AGP_FOR_XV, &psav->AGPforXv)) {
1705
    if (xf86GetOptValBool(psav->Options, OPTION_AGP_FOR_XV, &psav->AGPforXv)) {
1706
        if (psav->AGPforXv) {
1706
        if (psav->AGPforXv) {
1707
            if (psav->agpSize == 0) {
1707
            if (psav->agpSize == 0) {
(-)a/src/savage_exa.c (+4 lines)
Lines 441-454 SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int Link Here
441
    int i, j, dwords, queue, Bpp;
441
    int i, j, dwords, queue, Bpp;
442
    unsigned int cmd;
442
    unsigned int cmd;
443
    CARD32 * srcp;
443
    CARD32 * srcp;
444
#ifdef XF86DRI
444
    unsigned int dst_pitch;
445
    unsigned int dst_pitch;
445
    unsigned int dst_yoffset;
446
    unsigned int dst_yoffset;
446
    int agp_possible;
447
    int agp_possible;
448
#endif
447
    
449
    
448
    exaWaitSync(pDst->drawable.pScreen);
450
    exaWaitSync(pDst->drawable.pScreen);
449
451
450
    Bpp = pDst->drawable.bitsPerPixel / 8;
452
    Bpp = pDst->drawable.bitsPerPixel / 8;
451
453
454
#ifdef XF86DRI
452
    /* Test for conditions for AGP Mastered Image Transfer (MIT). AGP memory
455
    /* Test for conditions for AGP Mastered Image Transfer (MIT). AGP memory
453
       needs to be available, the XVideo AGP needs to be enabled, the 
456
       needs to be available, the XVideo AGP needs to be enabled, the 
454
       framebuffer destination must be a multiple of 32 bytes, and the source
457
       framebuffer destination must be a multiple of 32 bytes, and the source
Lines 505-510 SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int Link Here
505
            return TRUE;
508
            return TRUE;
506
        }
509
        }
507
    }
510
    }
511
#endif /* XF86DRI */
508
512
509
    /* If we reach here, AGP transfer is not possible, or failed to drmMap() */
513
    /* If we reach here, AGP transfer is not possible, or failed to drmMap() */
510
    psav->sbd_offset = exaGetPixmapOffset(pDst);
514
    psav->sbd_offset = exaGetPixmapOffset(pDst);
(-)a/src/savage_video.c (-3 / +11 lines)
Lines 247-256 typedef struct { Link Here
247
   void         *video_planarmem;		/* opaque memory management information structure */
247
   void         *video_planarmem;		/* opaque memory management information structure */
248
   CARD32       video_planarbuf; 		/* offset in video memory of planar YV12 buffer */
248
   CARD32       video_planarbuf; 		/* offset in video memory of planar YV12 buffer */
249
   
249
   
250
#ifdef XF86DRI
250
   Bool         tried_agp;			/* TRUE if AGP allocation has been tried */
251
   Bool         tried_agp;			/* TRUE if AGP allocation has been tried */
251
   CARD32	agpBase;			/* Physical address of aperture base */
252
   CARD32	agpBase;			/* Physical address of aperture base */
252
   CARD32	agpBufferOffset;		/* Offset of buffer in AGP memory, or 0 if unavailable */
253
   CARD32	agpBufferOffset;		/* Offset of buffer in AGP memory, or 0 if unavailable */
253
   drmAddress   agpBufferMap;			/* Mapping of AGP buffer in process memory, or NULL */
254
   drmAddress   agpBufferMap;			/* Mapping of AGP buffer in process memory, or NULL */
255
#endif
254
256
255
} SavagePortPrivRec, *SavagePortPrivPtr;
257
} SavagePortPrivRec, *SavagePortPrivPtr;
256
258
Lines 1046-1051 SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) Link Here
1046
      /*SavageClipVWindow(pScrn);*/
1048
      /*SavageClipVWindow(pScrn);*/
1047
 	SavageStreamsOff( pScrn );
1049
 	SavageStreamsOff( pScrn );
1048
1050
1051
#ifdef XF86DRI
1049
	if (pPriv->agpBufferMap != NULL) {
1052
	if (pPriv->agpBufferMap != NULL) {
1050
	    SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
1053
	    SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
1051
1054
Lines 1057-1062 SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) Link Here
1057
	    pPriv->agpBufferMap = NULL;
1060
	    pPriv->agpBufferMap = NULL;
1058
	    pPriv->agpBufferOffset = 0;
1061
	    pPriv->agpBufferOffset = 0;
1059
	}
1062
	}
1063
	pPriv->tried_agp = FALSE;
1064
#endif
1060
1065
1061
        if (pPriv->video_memory != NULL) {
1066
        if (pPriv->video_memory != NULL) {
1062
	    SavageFreeMemory(pScrn, pPriv->video_memory);
1067
	    SavageFreeMemory(pScrn, pPriv->video_memory);
Lines 1067-1073 SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) Link Here
1067
	    pPriv->video_planarmem = NULL;
1072
	    pPriv->video_planarmem = NULL;
1068
        }
1073
        }
1069
	pPriv->videoStatus = 0;
1074
	pPriv->videoStatus = 0;
1070
	pPriv->tried_agp = FALSE;
1071
    } else {
1075
    } else {
1072
	if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
1076
	if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
1073
	    pPriv->videoStatus |= OFF_TIMER;
1077
	    pPriv->videoStatus |= OFF_TIMER;
Lines 1969-1974 SavagePutImage( Link Here
1969
1973
1970
    /* Check whether AGP buffers can be allocated. If not, fall back to ordinary
1974
    /* Check whether AGP buffers can be allocated. If not, fall back to ordinary
1971
       upload to framebuffer (slower) */
1975
       upload to framebuffer (slower) */
1976
#ifdef XF86DRI
1972
    if (!pPriv->tried_agp && !psav->IsPCI && psav->drmFD > 0 && psav->DRIServerInfo != NULL) {
1977
    if (!pPriv->tried_agp && !psav->IsPCI && psav->drmFD > 0 && psav->DRIServerInfo != NULL) {
1973
        int ret;
1978
        int ret;
1974
	SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
1979
	SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
Lines 2005-2010 SavagePutImage( Link Here
2005
	    pPriv->agpBufferOffset = 0;
2010
	    pPriv->agpBufferOffset = 0;
2006
	}
2011
	}
2007
    }
2012
    }
2013
#endif /* XF86DRI */
2008
2014
2009
2015
2010
    /* Buffer for final packed frame */
2016
    /* Buffer for final packed frame */
Lines 2050-2055 SavagePutImage( Link Here
2050
	offsetV += tmp;
2056
	offsetV += tmp;
2051
	nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
2057
	nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
2052
        if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0 && pPriv->video_planarbuf != 0) {
2058
        if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0 && pPriv->video_planarbuf != 0) {
2059
#ifdef XF86DRI
2053
            if (pPriv->agpBufferMap != NULL) {
2060
            if (pPriv->agpBufferMap != NULL) {
2054
		/* Using copy to AGP memory */
2061
		/* Using copy to AGP memory */
2055
		SavageCopyPlanarDataBCI(
2062
		SavageCopyPlanarDataBCI(
Lines 2061-2067 SavagePutImage( Link Here
2061
		    pPriv->agpBufferMap,
2068
		    pPriv->agpBufferMap,
2062
		    pPriv->agpBase + pPriv->agpBufferOffset,
2069
		    pPriv->agpBase + pPriv->agpBufferOffset,
2063
		    srcPitch, srcPitch2, dstPitch, nlines, npixels, TRUE);
2070
		    srcPitch, srcPitch2, dstPitch, nlines, npixels, TRUE);
2064
            } else {            
2071
            } else
2072
#endif /* XF86DRI */
2073
            {
2065
		/* Using ordinary copy to framebuffer */
2074
		/* Using ordinary copy to framebuffer */
2066
		SavageCopyPlanarDataBCI(
2075
		SavageCopyPlanarDataBCI(
2067
		    pScrn,
2076
		    pScrn,
2068
- 

Return to bug 266087