--- xserver-xorg-video-psb-0.36.0-ref/src/psb_video.c 2010-10-02 12:39:28.000000000 +0200 +++ src/psb_video.c 2011-02-14 09:04:00.000000000 +0100 @@ -610,6 +612,32 @@ float tc0[6], tc1[6], tc2[6]; int num_texture = 0; float *conversion_data = NULL; + Bool directFB = FALSE; + short drw_x = pPixmap->screen_x; + short drw_y = pPixmap->screen_y; + + if( drw_x < 0 ){ + dstRegion->extents.x2 += drw_x; + drw_x = 0; + } + if( drw_y < 0 ){ + dstRegion->extents.y2 += drw_y; + drw_y = 0; + } + if( drw_x + drw_w >= pScrn->virtualX ){ + short excess = drw_w - (pScrn->virtualX - drw_x) + 1; + dstRegion->extents.x2 -= excess; + } + if( dstRegion->extents.x2 >= pScrn->virtualX ){ + dstRegion->extents.x2 = pScrn->virtualX-1; + } + if( drw_y + drw_h >= pScrn->virtualY ){ + short excess = drw_h - (pScrn->virtualY - drw_y) + 1; + dstRegion->extents.y2 -= excess; + } + if( dstRegion->extents.y2 >= pScrn->virtualY ){ + dstRegion->extents.y2 = pScrn->virtualY-1; + } hdtv = ((src_w >= PSB_HDTV_LIMIT_X) && (src_h >= PSB_HDTV_LIMIT_Y)); @@ -684,12 +712,26 @@ * coordinates) to the backing pixmap. */ - while (!psbExaGetSuperOffset(pPixmap, &pre_add, &dstBuf)) + if(!psbExaGetSuperOffset(pPixmap, &pre_add, &dstBuf)){ exaMoveInPixmap(pPixmap); + if(!psbExaGetSuperOffset(pPixmap, &pre_add, &dstBuf)){ + PsbBufListPtr b; + PsbPtr pPsb = psbPTR(pScrn); + pre_add = (drw_x + (drw_y*pScrn->displayWidth))*(pScrn->bitsPerPixel/8); //exaGetPixmapOffset(pPixmap); + b = mmListBuf(&pPsb->buffers); + dstBuf = b->buf; + directFB = TRUE; + } + } + dst.buffer = mmKernelBuf(dstBuf); dst.offset = pre_add; - dst.stride = pPixmap->devKind; + if( directFB ){ + dst.stride = pScrn->displayWidth * (pScrn->bitsPerPixel/8); + }else{ + dst.stride = pPixmap->devKind; + } switch (pPixmap->drawable.depth) { case 15: @@ -771,7 +813,9 @@ } } - DamageDamageRegion(&pPixmap->drawable, dstRegion); + if( ! directFB ){ + DamageDamageRegion(&pPixmap->drawable, dstRegion); + } return TRUE; }