diff options
Diffstat (limited to 'x11-base/xorg-server/files/xorg-sna.patch')
-rw-r--r-- | x11-base/xorg-server/files/xorg-sna.patch | 210 |
1 files changed, 115 insertions, 95 deletions
diff --git a/x11-base/xorg-server/files/xorg-sna.patch b/x11-base/xorg-server/files/xorg-sna.patch index a32e753..7b59e64 100644 --- a/x11-base/xorg-server/files/xorg-sna.patch +++ b/x11-base/xorg-server/files/xorg-sna.patch @@ -3,31 +3,30 @@ index cd0d9a9..8fa5d6d 100644 --- a/hw/xfree86/xaa/xaaOffscreen.c +++ b/hw/xfree86/xaa/xaaOffscreen.c @@ -90,12 +90,11 @@ XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) - (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC, - 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0); + (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC, + 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0); -- free(data); -- tmpPix->devPrivate.ptr = NULL; +- free(data); +- tmpPix->devPrivate.ptr = NULL; - - FreeScratchGC(pGC); - FreeScratchPixmapHeader(tmpPix); + FreeScratchGC(pGC); + FreeScratchPixmapHeader(tmpPix); -+ free(data); ++ free(data); + - pPriv->offscreenArea = area; - pLink->area = NULL; - pLink = pLink->next; + pPriv->offscreenArea = area; + pLink->area = NULL; + pLink = pLink->next; diff --git a/dix/dispatch.c b/dix/dispatch.c index 192c8c3..3f73175 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3855,7 +3855,6 @@ AddScreen( - return -1; + return -1; } pScreen->myNum = i; -- pScreen->totalPixmapSize = 0; /* computed in -CreateScratchPixmapForScreen */ - pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ +- pScreen->totalPixmapSize = 0; /* computed in CreateScratchPixmapForScreen */ + pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ pScreen->CreateScreenResources = 0; diff --git a/dix/main.c b/dix/main.c @@ -35,27 +34,27 @@ index 955b7ea..7eadf36 100644 --- a/dix/main.c +++ b/dix/main.c @@ -206,12 +206,11 @@ int main(int argc, char *argv[], char *envp[]) - if (screenInfo.numScreens < 1) - FatalError("no screens found"); - InitExtensions(argc, argv); -+ InitPixmaps(); + if (screenInfo.numScreens < 1) + FatalError("no screens found"); + InitExtensions(argc, argv); ++ InitPixmaps(); - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; -- if (!CreateScratchPixmapsForScreen(i)) -- FatalError("failed to create scratch pixmaps"); - if (pScreen->CreateScreenResources && - !(*pScreen->CreateScreenResources)(pScreen)) - FatalError("failed to create screen resources"); + for (i = 0; i < screenInfo.numScreens; i++) + { + ScreenPtr pScreen = screenInfo.screens[i]; +- if (!CreateScratchPixmapsForScreen(i)) +- FatalError("failed to create scratch pixmaps"); + if (pScreen->CreateScreenResources && + !(*pScreen->CreateScreenResources)(pScreen)) + FatalError("failed to create screen resources"); @@ -321,7 +320,6 @@ int main(int argc, char *argv[], char *envp[]) - for (i = screenInfo.numScreens - 1; i >= 0; i--) - { -- FreeScratchPixmapsForScreen(i); - FreeGCperDepth(i); - FreeDefaultStipple(i); - (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]); + for (i = screenInfo.numScreens - 1; i >= 0; i--) + { +- FreeScratchPixmapsForScreen(i); + FreeGCperDepth(i); + FreeDefaultStipple(i); + (* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]); diff --git a/dix/pixmap.c b/dix/pixmap.c index cbb5e7f..0b43592 100644 --- a/dix/pixmap.c @@ -68,26 +67,26 @@ index cbb5e7f..0b43592 100644 + PixmapPtr pPixmap; - if (pPixmap) -- pScreen->pScratchPixmap = NULL; +- pScreen->pScratchPixmap = NULL; - else -- /* width and height of 0 means don't allocate any pixmap data */ -- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); +- /* width and height of 0 means don't allocate any pixmap data */ +- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0); - - if (pPixmap) { -- if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, -- bitsPerPixel, devKind, pPixData)) -- return pPixmap; -- (*pScreen->DestroyPixmap)(pPixmap); +- if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, +- bitsPerPixel, devKind, pPixData)) +- return pPixmap; +- (*pScreen->DestroyPixmap)(pPixmap); - } + /* width and height of 0 means don't allocate any pixmap data */ + pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, -+ CREATE_PIXMAP_USAGE_SCRATCH_HEADER); ++ CREATE_PIXMAP_USAGE_SCRATCH_HEADER); + if (pPixmap == NullPixmap) -+ return NullPixmap; ++ return NullPixmap; + + if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, -+ bitsPerPixel, devKind, pPixData)) -+ return pPixmap; ++ bitsPerPixel, devKind, pPixData)) ++ return pPixmap; + + (*pScreen->DestroyPixmap)(pPixmap); return NullPixmap; @@ -95,19 +94,18 @@ index cbb5e7f..0b43592 100644 @@ -79,33 +78,22 @@ FreeScratchPixmapHeader(PixmapPtr pPixmap) { - ScreenPtr pScreen = pPixmap->drawable.pScreen; + ScreenPtr pScreen = pPixmap->drawable.pScreen; -- pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */ -- if (pScreen->pScratchPixmap) -- (*pScreen->DestroyPixmap)(pPixmap); -- else -- pScreen->pScratchPixmap = pPixmap; -+ if (pPixmap->refcnt != 1) -+ FatalError("Scratch pixmap still in use when finalized, -refcnt=%d\n", -+ pPixmap->refcnt); +- pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */ +- if (pScreen->pScratchPixmap) +- (*pScreen->DestroyPixmap)(pPixmap); +- else +- pScreen->pScratchPixmap = pPixmap; ++ if (pPixmap->refcnt != 1) ++ FatalError("Scratch pixmap still in use when finalized, refcnt=%d\n", ++ pPixmap->refcnt); + -+ (*pScreen->DestroyPixmap)(pPixmap); ++ (*pScreen->DestroyPixmap)(pPixmap); } } @@ -117,11 +115,10 @@ refcnt=%d\n", +void +InitPixmaps(void) { - unsigned int pixmap_size; + unsigned int pixmap_size; pixmap_size = sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP); -- screenInfo.screens[scrnum]->totalPixmapSize = BitmapBytePad(pixmap_size * -8); +- screenInfo.screens[scrnum]->totalPixmapSize = BitmapBytePad(pixmap_size * 8); - - /* let it be created on first use */ - screenInfo.screens[scrnum]->pScratchPixmap = NULL; @@ -146,27 +143,26 @@ refcnt=%d\n", - if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize) + if (screenInfo.totalPixmapSize > ((size_t)-1) - pixDataSize) - return NullPixmap; + return NullPixmap; - pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); + pPixmap = malloc(screenInfo.totalPixmapSize + pixDataSize); if (!pPixmap) - return NullPixmap; + return NullPixmap; diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index a356c67..aebdff0 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c -@@ -42,7 +42,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, -int depth, int bpp, +@@ -42,7 +42,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp, if (paddedWidth / 4 > 32767 || height > 32767) - return NullPixmap; + return NullPixmap; datasize = height * paddedWidth; - base = pScreen->totalPixmapSize; + base = screenInfo.totalPixmapSize; adjust = 0; if (base & 7) - adjust = 8 - (base & 7); + adjust = 8 - (base & 7); diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 2a5c805..cf7557e 100644 --- a/hw/xfree86/common/xf86Module.h @@ -174,12 +170,12 @@ index 2a5c805..cf7557e 100644 @@ -82,7 +82,7 @@ typedef enum { * mask is 0xFFFF0000. */ - #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) --#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0) -+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0) - #define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0) - #define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0) - #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) + #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) +-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0) ++#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0) + #define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0) + #define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0) + #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) diff --git a/include/pixmap.h b/include/pixmap.h index 014a111..daab76c 100644 --- a/include/pixmap.h @@ -210,51 +206,75 @@ index a9357e8..617eadb 100644 +#define CREATE_PIXMAP_USAGE_SCRATCH_HEADER 4 typedef PixmapPtr (* CreatePixmapProcPtr)( - ScreenPtr /*pScreen*/, + ScreenPtr /*pScreen*/, @@ -518,10 +520,6 @@ typedef struct _Screen { - GetScreenPixmapProcPtr GetScreenPixmap; - SetScreenPixmapProcPtr SetScreenPixmap; + GetScreenPixmapProcPtr GetScreenPixmap; + SetScreenPixmapProcPtr SetScreenPixmap; -- PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ +- PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ - -- unsigned int totalPixmapSize; +- unsigned int totalPixmapSize; - - MarkWindowProcPtr MarkWindow; + MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; - ConfigNotifyProcPtr ConfigNotify; + ConfigNotifyProcPtr ConfigNotify; @@ -556,6 +554,8 @@ typedef struct _ScreenInfo { - int bitmapScanlineUnit; - int bitmapScanlinePad; - int bitmapBitOrder; + int bitmapScanlineUnit; + int bitmapScanlinePad; + int bitmapBitOrder; + unsigned int totalPixmapSize; + - int numPixmapFormats; + int numPixmapFormats; PixmapFormatRec - formats[MAXFORMATS]; + formats[MAXFORMATS]; +From patchwork Mon Jun 6 05:36:08 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [3/4] shm: Replace open-coded version of GetScratchPixmapHeader +Date: Mon, 06 Jun 2011 13:36:08 -0000 +From: Chris Wilson <chris@chris-wilson.co.uk> +X-Patchwork-Id: 5802 +Message-Id: <1307338569-31221-4-git-send-email-chris@chris-wilson.co.uk> +To: xorg-devel@lists.x.org + +fbShmCreatePixmap() was just another variant of wrapping an arbitrary +data pointer within a pixmap, ala GetScratchPixmapHeader(). + +By using the common version, the fbShmCreatePixmap() is also updated to +pass the information that the pixmap contents are not part of the ddx +address space. + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> + +--- +Xext/shm.c | 16 ++++------------ + 1 files changed, 4 insertions(+), 12 deletions(-) + diff --git a/Xext/shm.c b/Xext/shm.c index b08af82..c6a3aee 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -1018,18 +1018,10 @@ static PixmapPtr fbShmCreatePixmap (ScreenPtr pScreen, - int width, int height, int depth, char *addr) + int width, int height, int depth, char *addr) { - PixmapPtr pPixmap; - - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0); - if (!pPixmap) -- return NullPixmap; +- return NullPixmap; - - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, -- BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) { -- (*pScreen->DestroyPixmap)(pPixmap); -- return NullPixmap; +- BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) { +- (*pScreen->DestroyPixmap)(pPixmap); +- return NullPixmap; - } - return pPixmap; + return GetScratchPixmapHeader(pScreen, width, height, depth, -+ BitsPerPixel(depth), -+ PixmapBytePad(width, depth), -+ addr); ++ BitsPerPixel(depth), ++ PixmapBytePad(width, depth), ++ addr); } static int @@ -263,13 +283,13 @@ index 5cc476a..46d481b 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -63,7 +63,6 @@ typedef struct { - CloseScreenProcPtr CloseScreen; - CopyWindowProcPtr CopyWindow; - CreateGCProcPtr CreateGC; -- ModifyPixmapHeaderProcPtr ModifyPixmapHeader; + CloseScreenProcPtr CloseScreen; + CopyWindowProcPtr CopyWindow; + CreateGCProcPtr CreateGC; +- ModifyPixmapHeaderProcPtr ModifyPixmapHeader; CompositeProcPtr Composite; - Bool (*EnterVT)(int, int); - void (*LeaveVT)(int, int); + Bool (*EnterVT)(int, int); + void (*LeaveVT)(int, int); @@ -172,7 +171,6 @@ ShadowFBInit2 ( pPriv->CloseScreen = pScreen->CloseScreen; pPriv->CopyWindow = pScreen->CopyWindow; |