From da367444d1644263e13187d36739263a95a9fe99 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Apr 30 2010 23:01:26 +0000 Subject: * Fri Apr 30 2010 Owen Taylor - 1.8.0-10 - Updated version of redirected pixmaps patch (Again from https://bugs.freedesktop.org/show_bug.cgi?id=27767) --- diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index b1e77eb..2eaea70 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -19,7 +19,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.8.0 -Release: 9%{?gitdate:.%{gitdate}}%{dist} +Release: 10%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -532,6 +532,10 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Fri Apr 30 2010 Owen Taylor - 1.8.0-10 +- Updated version of redirected pixmaps patch + (Again from https://bugs.freedesktop.org/show_bug.cgi?id=27767) + * Fri Apr 30 2010 Owen Taylor - 1.8.0-9 - Add patches cherry-picked from master for DRI2 VBlank synchronization (related to RH #577512, though not a complete fix without changes diff --git a/xserver-1.8.0-glxdri2-resource-conversion.patch b/xserver-1.8.0-glxdri2-resource-conversion.patch index 6c450ac..0a68877 100644 --- a/xserver-1.8.0-glxdri2-resource-conversion.patch +++ b/xserver-1.8.0-glxdri2-resource-conversion.patch @@ -1,7 +1,7 @@ -From b75609ab65bf2aeee553435e43072d7f859162f7 Mon Sep 17 00:00:00 2001 +From d4bc0d6eab1390b7e94280b7473291be7bcf7062 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 30 Apr 2010 13:17:18 -0400 -Subject: [PATCH 2/2] Merge fixes for DRI drawable handling from master +Subject: [PATCH] Merge fixes for DRI drawable handling from master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85,18 +85,18 @@ destroyed or the client exits. Signed-off-by: Kristian Høgsberg Signed-off-by: Keith Packard --- - glx/glxcmds.c | 62 ++++++++----- + glx/glxcmds.c | 62 +++++++++----- glx/glxdri.c | 8 +- glx/glxdri2.c | 17 ++-- glx/glxdriswrast.c | 8 +- glx/glxext.c | 11 +++ - glx/glxscreens.c | 40 +-------- + glx/glxscreens.c | 28 ------ glx/glxscreens.h | 7 +- - hw/xfree86/dri2/dri2.c | 221 +++++++++++++++++++++++++-------------------- + hw/xfree86/dri2/dri2.c | 214 +++++++++++++++++++++++++++------------------ hw/xfree86/dri2/dri2.h | 3 +- hw/xfree86/dri2/dri2ext.c | 24 +----- include/list.h | 6 ++ - 11 files changed, 204 insertions(+), 203 deletions(-) + 11 files changed, 209 insertions(+), 179 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 77afbf4..31a7d32 100644 @@ -255,7 +255,7 @@ index 77afbf4..31a7d32 100644 int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc) diff --git a/glx/glxdri.c b/glx/glxdri.c -index 21e44d1..e4870c3 100644 +index 30b820c..51b602d 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -682,10 +682,12 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, @@ -283,7 +283,7 @@ index 21e44d1..e4870c3 100644 return NULL; } diff --git a/glx/glxdri2.c b/glx/glxdri2.c -index e791bf6..38b52bd 100644 +index bc37285..5bdeedb 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -105,11 +105,6 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable) @@ -331,7 +331,7 @@ index e791bf6..38b52bd 100644 xfree(private); return NULL; } -@@ -722,7 +719,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) +@@ -725,7 +722,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->core = (const __DRIcoreExtension *) extensions[i]; } if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 && @@ -391,7 +391,7 @@ index 59bcfbe..89e58b0 100644 if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { int i; diff --git a/glx/glxscreens.c b/glx/glxscreens.c -index 58d8ee0..da11834 100644 +index 58d8ee0..b75aea6 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -215,7 +215,6 @@ glxCloseScreen (int index, ScreenPtr pScreen) @@ -443,40 +443,6 @@ index 58d8ee0..da11834 100644 i = 0; for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) { -@@ -427,31 +399,23 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) - * an existing, appropriate visual. - */ - for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) { -- int depth; -- - VisualPtr visual; - - if (config->visualID != 0) - continue; - -- /* Only count RGB bits and not alpha, as we're not trying to create -- * visuals for compositing (that's what the 32-bit composite visual -- * set up above is for. -- */ -- depth = config->redBits + config->greenBits + config->blueBits; -- - /* Make sure that our FBconfig's depth can actually be displayed - * (corresponds to an existing visual). - */ - for (i = 0; i < pScreen->numVisuals; i++) { -- if (depth == pScreen->visuals[i].nplanes) -+ if (config->rgbBits == pScreen->visuals[i].nplanes) - break; - } - if (i == pScreen->numVisuals) - continue; - - /* Create a new X visual for our FBconfig. */ -- visual = AddScreenVisuals(pScreen, 1, depth); -+ visual = AddScreenVisuals(pScreen, 1, config->rgbBits); - if (visual == NULL) - continue; - diff --git a/glx/glxscreens.h b/glx/glxscreens.h index bff4363..861e03c 100644 --- a/glx/glxscreens.h @@ -505,7 +471,7 @@ index bff4363..861e03c 100644 diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c -index 2bdb733..178116a 100644 +index 2bdb733..3fd2326 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -37,6 +37,7 @@ @@ -516,17 +482,17 @@ index 2bdb733..178116a 100644 #include "scrnintstr.h" #include "windowstr.h" #include "dixstruct.h" -@@ -48,15 +49,16 @@ +@@ -48,15 +49,20 @@ CARD8 dri2_major; /* version of DRI2 supported by DDX */ CARD8 dri2_minor; -static int dri2ScreenPrivateKeyIndex; +static int dri2ScreenPrivateKeyIndex; static DevPrivateKey dri2ScreenPrivateKey = &dri2ScreenPrivateKeyIndex; --static int dri2WindowPrivateKeyIndex; --static DevPrivateKey dri2WindowPrivateKey = &dri2WindowPrivateKeyIndex; --static int dri2PixmapPrivateKeyIndex; --static DevPrivateKey dri2PixmapPrivateKey = &dri2PixmapPrivateKeyIndex; + static int dri2WindowPrivateKeyIndex; + static DevPrivateKey dri2WindowPrivateKey = &dri2WindowPrivateKeyIndex; + static int dri2PixmapPrivateKeyIndex; + static DevPrivateKey dri2PixmapPrivateKey = &dri2PixmapPrivateKeyIndex; +static RESTYPE dri2DrawableRes; + +typedef struct _DRI2Screen *DRI2ScreenPtr; @@ -539,7 +505,7 @@ index 2bdb733..178116a 100644 int width; int height; DRI2BufferPtr *buffers; -@@ -73,9 +75,9 @@ typedef struct _DRI2Drawable { +@@ -73,9 +79,9 @@ typedef struct _DRI2Drawable { int swap_limit; /* for N-buffering */ } DRI2DrawableRec, *DRI2DrawablePtr; @@ -551,32 +517,30 @@ index 2bdb733..178116a 100644 unsigned int numDrivers; const char **driverNames; const char *deviceName; -@@ -101,45 +103,30 @@ DRI2GetScreen(ScreenPtr pScreen) +@@ -101,45 +107,33 @@ DRI2GetScreen(ScreenPtr pScreen) static DRI2DrawablePtr DRI2GetDrawable(DrawablePtr pDraw) { - WindowPtr pWin; - PixmapPtr pPixmap; -+ DRI2DrawablePtr pPriv; -+ int rc; ++ WindowPtr pWin; ++ PixmapPtr pPixmap; - if (!pDraw) -+ rc = dixLookupResourceByType((pointer *) &pPriv, pDraw->id, -+ dri2DrawableRes, NULL, DixReadAccess); -+ if (rc != Success) - return NULL; - +- return NULL; +- - if (pDraw->type == DRAWABLE_WINDOW) - { -- pWin = (WindowPtr) pDraw; -- return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); ++ if (pDraw->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr) pDraw; + return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); - } - else - { -- pPixmap = (PixmapPtr) pDraw; -- return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey); -- } -+ return pPriv; ++ } else { + pPixmap = (PixmapPtr) pDraw; + return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey); + } } -int @@ -589,14 +553,16 @@ index 2bdb733..178116a 100644 - PixmapPtr pPixmap; DRI2DrawablePtr pPriv; CARD64 ust; - +- - pPriv = DRI2GetDrawable(pDraw); - if (pPriv != NULL) - { - pPriv->refCount++; - return Success; - } -- ++ WindowPtr pWin; ++ PixmapPtr pPixmap; + pPriv = xalloc(sizeof *pPriv); if (pPriv == NULL) - return BadAlloc; @@ -608,7 +574,7 @@ index 2bdb733..178116a 100644 pPriv->width = pDraw->width; pPriv->height = pDraw->height; pPriv->buffers = NULL; -@@ -157,44 +144,116 @@ DRI2CreateDrawable(DrawablePtr pDraw) +@@ -157,44 +151,130 @@ DRI2CreateDrawable(DrawablePtr pDraw) pPriv->swap_limit = 1; /* default to double buffering */ pPriv->last_swap_msc = 0; pPriv->last_swap_ust = 0; @@ -616,13 +582,17 @@ index 2bdb733..178116a 100644 - if (pDraw->type == DRAWABLE_WINDOW) - { -- pWin = (WindowPtr) pDraw; -- dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); ++ if (pDraw->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr) pDraw; + dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); - } - else - { -- pPixmap = (PixmapPtr) pDraw; -- dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); ++ } else { + pPixmap = (PixmapPtr) pDraw; + dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); + } + + return pPriv; +} + @@ -633,16 +603,14 @@ index 2bdb733..178116a 100644 +} DRI2DrawableRefRec, *DRI2DrawableRefPtr; + +static DRI2DrawableRefPtr -+DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id) ++DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id) +{ + DRI2DrawableRefPtr ref; + + list_for_each_entry(ref, &pPriv->reference_list, link) { -+ if (id != None && ref->id == id) ++ if (ref->id == id) + return ref; -+ if (dri2_id != None && ref->dri2_id == dri2_id) -+ return ref; - } ++ } + + return NULL; +} @@ -658,14 +626,14 @@ index 2bdb733..178116a 100644 + + if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) + return BadAlloc; -+ if (!DRI2LookupDrawableRef(pPriv, id, None)) ++ if (!DRI2LookupDrawableRef(pPriv, id)) + if (!AddResource(id, dri2DrawableRes, pPriv)) + return BadAlloc; + + ref->id = id; + ref->dri2_id = dri2_id; + list_add(&ref->link, &pPriv->reference_list); - ++ return Success; } @@ -698,14 +666,14 @@ index 2bdb733..178116a 100644 - if (pDraw->type == DRAWABLE_WINDOW) - { -- pWin = (WindowPtr) pDraw; -- dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL); +static int DRI2DrawableGone(pointer p, XID id) +{ + DRI2DrawablePtr pPriv = p; + DRI2ScreenPtr ds = pPriv->dri2_screen; + DRI2DrawableRefPtr ref, next; -+ DrawablePtr root; ++ WindowPtr pWin; ++ PixmapPtr pPixmap; ++ DrawablePtr pDraw; + int i; + + list_for_each_entry_safe(ref, next, &pPriv->reference_list, link) { @@ -713,7 +681,7 @@ index 2bdb733..178116a 100644 + list_del(&ref->link); + /* If this was the last ref under this X drawable XID, + * unregister the X drawable resource. */ -+ if (!DRI2LookupDrawableRef(pPriv, ref->id, None)) ++ if (!DRI2LookupDrawableRef(pPriv, ref->id)) + FreeResourceByType(ref->id, dri2DrawableRes, TRUE); + break; + } @@ -723,24 +691,29 @@ index 2bdb733..178116a 100644 + FreeResourceByType(ref->dri2_id, dri2DrawableRes, TRUE); + free(ref); + } - } -- else -- { -- pPixmap = (PixmapPtr) pDraw; -- dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL); ++ } + + if (!list_is_empty(&pPriv->reference_list)) + return Success; + -+ ErrorF("freeing dri2 drawable\n"); ++ pDraw = pPriv->drawable; ++ if (pDraw->type == DRAWABLE_WINDOW) { + pWin = (WindowPtr) pDraw; + dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL); +- } +- else +- { ++ } else { + pPixmap = (PixmapPtr) pDraw; + dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL); + } + -+ root = &WindowTable[ds->screen->myNum]->drawable; + if (pPriv->buffers != NULL) { + for (i = 0; i < pPriv->bufferCount; i++) -+ (*ds->DestroyBuffer)(root, pPriv->buffers[i]); ++ (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]); + + xfree(pPriv->buffers); - } ++ } + + xfree(pPriv); + @@ -748,7 +721,7 @@ index 2bdb733..178116a 100644 } static int -@@ -505,10 +564,6 @@ DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, +@@ -505,10 +585,6 @@ DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, pPriv->blockedClient = NULL; pPriv->blockedOnMsc = FALSE; @@ -759,7 +732,7 @@ index 2bdb733..178116a 100644 } static void -@@ -576,13 +631,6 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, +@@ -576,13 +652,6 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, pPriv->last_swap_ust = ust; DRI2WakeClient(client, pDraw, frame, tv_sec, tv_usec); @@ -773,7 +746,7 @@ index 2bdb733..178116a 100644 } Bool -@@ -750,7 +798,7 @@ DRI2WaitMSC(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, +@@ -750,7 +819,7 @@ DRI2WaitMSC(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, Bool ret; pPriv = DRI2GetDrawable(pDraw); @@ -782,7 +755,7 @@ index 2bdb733..178116a 100644 return BadDrawable; /* Old DDX just completes immediately */ -@@ -774,7 +822,7 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, +@@ -774,7 +843,7 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); @@ -791,7 +764,7 @@ index 2bdb733..178116a 100644 return BadDrawable; /* target_sbc == 0 means to block until all pending swaps are -@@ -800,36 +848,6 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, +@@ -800,36 +869,6 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, return Success; } @@ -828,7 +801,7 @@ index 2bdb733..178116a 100644 Bool DRI2HasSwapControl(ScreenPtr pScreen) { -@@ -890,6 +908,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) +@@ -890,6 +929,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) if (!ds) return FALSE; @@ -836,7 +809,7 @@ index 2bdb733..178116a 100644 ds->fd = info->fd; ds->deviceName = info->deviceName; dri2_major = 1; -@@ -961,6 +980,8 @@ DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin) +@@ -961,6 +1001,8 @@ DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE;