summaryrefslogtreecommitdiff
path: root/hw/xfree86/xaa/xaaInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/xaa/xaaInit.c')
-rw-r--r--hw/xfree86/xaa/xaaInit.c63
1 files changed, 29 insertions, 34 deletions
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 11443a60e..d70906883 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -35,7 +35,7 @@ static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
int *pwidth, int nspans, char *pdstStart);
static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint);
-static Bool XAADestroyPixmap(PixmapPtr pPixmap);
+static void XAADestroyPixmap(PixmapPtr pPixmap);
static Bool XAAEnterVT (int index, int flags);
static void XAALeaveVT (int index, int flags);
static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
@@ -307,7 +307,7 @@ XAAPixmapBPP (ScreenPtr pScreen, int depth)
bpp = pPix->drawable.bitsPerPixel;
destroyPixmap = pScreen->DestroyPixmap;
XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
- (*pScreen->DestroyPixmap) (pPix);
+ ReleasePixmap(pPix);
XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, destroyPixmap);
return bpp;
}
@@ -426,50 +426,45 @@ BAILOUT:
return pPix;
}
-static Bool
+static void
XAADestroyPixmap(PixmapPtr pPix)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
- Bool ret;
- if(pPix->refcnt == 1) {
- if(pPriv->flags & OFFSCREEN) {
- if(pPriv->flags & DGA_PIXMAP)
- free(pPriv->offscreenArea);
- else {
- FBAreaPtr area = pPriv->offscreenArea;
- PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
- PixmapLinkPtr prev = NULL;
-
- while(pLink->pPix != pPix) {
- prev = pLink;
- pLink = pLink->next;
- }
-
- if(prev) prev->next = pLink->next;
- else infoRec->OffscreenPixmaps = pLink->next;
-
- if(!area) area = pLink->area;
-
- xf86FreeOffscreenArea(area);
- pPriv->offscreenArea = NULL;
- free(pLink);
- }
+ if(pPriv->flags & OFFSCREEN) {
+ if(pPriv->flags & DGA_PIXMAP)
+ free(pPriv->offscreenArea);
+ else {
+ FBAreaPtr area = pPriv->offscreenArea;
+ PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
+ PixmapLinkPtr prev = NULL;
+
+ while(pLink->pPix != pPix) {
+ prev = pLink;
+ pLink = pLink->next;
+ }
+
+ if(prev) prev->next = pLink->next;
+ else infoRec->OffscreenPixmaps = pLink->next;
+
+ if(!area) area = pLink->area;
+
+ xf86FreeOffscreenArea(area);
+ pPriv->offscreenArea = NULL;
+ free(pLink);
}
+ }
- if(pPriv->freeData) { /* pixmaps that were once in video ram */
- free(pPix->devPrivate.ptr);
- pPix->devPrivate.ptr = NULL;
- }
+ if(pPriv->freeData) { /* pixmaps that were once in video ram */
+ free(pPix->devPrivate.ptr);
+ pPix->devPrivate.ptr = NULL;
}
XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
- ret = (*pScreen->DestroyPixmap) (pPix);
+ (*pScreen->DestroyPixmap) (pPix);
XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, XAADestroyPixmap);
-
- return ret;
}
static Bool