Set driverPriv immediately on CreatePixmap.

If it's NULL anyway, we bail, if not, it lets
ModifyPixmapHeader know about the private.
This commit is contained in:
Alan Hourihane 2008-06-18 22:34:02 +01:00
parent 068fa63496
commit 528b4e36ad

View File

@ -314,7 +314,6 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
if (driver_alloc) { if (driver_alloc) {
size_t paddedWidth, datasize; size_t paddedWidth, datasize;
void *driver_priv;
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
if (paddedWidth / 4 > 32767 || h > 32767) if (paddedWidth / 4 > 32767 || h > 32767)
@ -327,15 +326,14 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
datasize = h * paddedWidth; datasize = h * paddedWidth;
driver_priv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0);
if (!driver_priv) { if (!pExaPixmap->driverPriv) {
fbDestroyPixmap(pPixmap); fbDestroyPixmap(pPixmap);
return NULL; return NULL;
} }
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0, (*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL); paddedWidth, NULL);
pExaPixmap->driverPriv = driver_priv;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
pExaPixmap->fb_ptr = NULL; pExaPixmap->fb_ptr = NULL;
} else { } else {