EXA: Update pixmaps' accel_blocked field in ModifyPixmapHeader.
This commit is contained in:
parent
bb8868540f
commit
f133d85778
53
exa/exa.c
53
exa/exa.c
|
@ -224,6 +224,30 @@ exaLog2(int val)
|
||||||
return bits - 1;
|
return bits - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
|
||||||
|
int w, int h, int bpp)
|
||||||
|
{
|
||||||
|
pExaPixmap->accel_blocked = 0;
|
||||||
|
|
||||||
|
if (pExaScr->info->maxPitchPixels) {
|
||||||
|
int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
|
||||||
|
|
||||||
|
if (pExaPixmap->fb_pitch > max_pitch)
|
||||||
|
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pExaScr->info->maxPitchBytes &&
|
||||||
|
pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
|
||||||
|
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
||||||
|
|
||||||
|
if (w > pExaScr->info->maxX)
|
||||||
|
pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
|
||||||
|
|
||||||
|
if (h > pExaScr->info->maxY)
|
||||||
|
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exaCreatePixmap() creates a new pixmap.
|
* exaCreatePixmap() creates a new pixmap.
|
||||||
*
|
*
|
||||||
|
@ -339,25 +363,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
REGION_NULL(pScreen, &pExaPixmap->validSys);
|
REGION_NULL(pScreen, &pExaPixmap->validSys);
|
||||||
REGION_NULL(pScreen, &pExaPixmap->validFB);
|
REGION_NULL(pScreen, &pExaPixmap->validFB);
|
||||||
|
|
||||||
/* Check whether this pixmap can be used for acceleration. */
|
exaSetAccelBlock(pExaScr, pExaPixmap,
|
||||||
pExaPixmap->accel_blocked = 0;
|
w, h, bpp);
|
||||||
|
|
||||||
if (pExaScr->info->maxPitchPixels) {
|
|
||||||
int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
|
|
||||||
|
|
||||||
if (pExaPixmap->fb_pitch > max_pitch)
|
|
||||||
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pExaScr->info->maxPitchBytes &&
|
|
||||||
pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
|
|
||||||
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
|
||||||
|
|
||||||
if (w > pExaScr->info->maxX)
|
|
||||||
pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
|
|
||||||
|
|
||||||
if (h > pExaScr->info->maxY)
|
|
||||||
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
|
|
||||||
|
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
}
|
}
|
||||||
|
@ -373,12 +380,16 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
|
||||||
pExaPixmap = ExaGetPixmapPriv(pPixmap);
|
pExaPixmap = ExaGetPixmapPriv(pPixmap);
|
||||||
|
|
||||||
if (pExaPixmap)
|
if (pExaPixmap) {
|
||||||
pExaPixmap->sys_ptr = pPixData;
|
pExaPixmap->sys_ptr = pPixData;
|
||||||
|
|
||||||
pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
|
exaSetAccelBlock(pExaScr, pExaPixmap,
|
||||||
|
width, height, bitsPerPixel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pExaScr->info->ModifyPixmapHeader) {
|
if (pExaScr->info->ModifyPixmapHeader) {
|
||||||
ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
|
ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
|
||||||
|
|
Loading…
Reference in New Issue