xserver: Branch 'master' - 4 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed May 11 15:39:24 UTC 2016
glx/createcontext.c | 8 ----
glx/glxcmds.c | 16 ---------
glx/glxcontext.h | 5 --
glx/glxdri2.c | 91 ++++++++++++++++++++++++++--------------------------
glx/glxdriswrast.c | 48 +++++++++++++--------------
glx/glxext.c | 1
glx/single2.c | 4 --
glx/single2swap.c | 4 --
glx/singlepix.c | 1
glx/singlepixswap.c | 1
10 files changed, 72 insertions(+), 107 deletions(-)
New commits:
commit 3f569435e10df515c6f86289dc986bfc59c6bc18
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Mar 31 16:56:44 2016 -0400
glx: Stop tracking hasUnflushedCommands
This is only meaningful for indirect contexts, and all it does is
(maybe) prevent a flush when switching away from an indirect context.
Indirect contexts aren't worth optimizing for, and Mesa tracks whether
a flush is needed anyway.
Careful readers will note that ReadPixels would reset the flag even
though it doesn't imply a flush!
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index b69a830..3c4209a 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -636,10 +636,9 @@ DoMakeCurrent(__GLXclientState * cl,
if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB)
need_flush = GL_FALSE;
#endif
- if (prevglxc->hasUnflushedCommands && need_flush) {
+ if (need_flush) {
if (__glXForceCurrent(cl, tag, (int *) &error)) {
glFlush();
- prevglxc->hasUnflushedCommands = GL_FALSE;
}
else {
return error;
@@ -922,7 +921,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
** in both streams are completed before the copy is executed.
*/
glFinish();
- tagcx->hasUnflushedCommands = GL_FALSE;
}
else {
return error;
@@ -1696,7 +1694,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
** in both streams are completed before the swap is executed.
*/
glFinish();
- glxc->hasUnflushedCommands = GL_FALSE;
}
else {
return error;
@@ -1893,7 +1890,6 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
** in both streams are completed before the swap is executed.
*/
glFinish();
- glxc->hasUnflushedCommands = GL_FALSE;
}
else {
return error;
@@ -2116,7 +2112,6 @@ __glXDisp_Render(__GLXclientState * cl, GLbyte * pc)
left -= cmdlen;
commandsDone++;
}
- glxc->hasUnflushedCommands = GL_TRUE;
return Success;
}
@@ -2327,7 +2322,6 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
** Skip over the header and execute the command.
*/
(*proc) (cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
- glxc->hasUnflushedCommands = GL_TRUE;
/*
** Reset for the next RenderLarge series.
diff --git a/glx/glxcontext.h b/glx/glxcontext.h
index 0733281..edbd491 100644
--- a/glx/glxcontext.h
+++ b/glx/glxcontext.h
@@ -94,11 +94,6 @@ struct __GLXcontext {
GLboolean isDirect;
/*
- ** This flag keeps track of whether there are unflushed GL commands.
- */
- GLboolean hasUnflushedCommands;
-
- /*
** Current rendering mode for this context.
*/
GLenum renderMode;
diff --git a/glx/glxext.c b/glx/glxext.c
index f3d8fdd..67ec07f 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -136,7 +136,6 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
(c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
/* flush the context */
glFlush();
- c->hasUnflushedCommands = GL_FALSE;
/* just force a re-bind the next time through */
(*c->loseCurrent) (c);
lastGLContext = NULL;
diff --git a/glx/single2.c b/glx/single2.c
index acc66ac..62dcd79 100644
--- a/glx/single2.c
+++ b/glx/single2.c
@@ -71,7 +71,6 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
- cx->hasUnflushedCommands = GL_TRUE;
return Success;
}
@@ -102,7 +101,6 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
- cx->hasUnflushedCommands = GL_TRUE;
return Success;
}
@@ -225,7 +223,6 @@ __glXDisp_Flush(__GLXclientState * cl, GLbyte * pc)
}
glFlush();
- cx->hasUnflushedCommands = GL_FALSE;
return Success;
}
@@ -245,7 +242,6 @@ __glXDisp_Finish(__GLXclientState * cl, GLbyte * pc)
/* Do a local glFinish */
glFinish();
- cx->hasUnflushedCommands = GL_FALSE;
/* Send empty reply packet to indicate finish is finished */
client = cl->client;
diff --git a/glx/single2swap.c b/glx/single2swap.c
index d5bb1c0..c1df248 100644
--- a/glx/single2swap.c
+++ b/glx/single2swap.c
@@ -72,7 +72,6 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
cx->feedbackBufSize = size;
}
glFeedbackBuffer(size, type, cx->feedbackBuf);
- cx->hasUnflushedCommands = GL_TRUE;
return Success;
}
@@ -107,7 +106,6 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
cx->selectBufSize = size;
}
glSelectBuffer(size, cx->selectBuf);
- cx->hasUnflushedCommands = GL_TRUE;
return Success;
}
@@ -245,7 +243,6 @@ __glXDispSwap_Flush(__GLXclientState * cl, GLbyte * pc)
}
glFlush();
- cx->hasUnflushedCommands = GL_FALSE;
return Success;
}
@@ -268,7 +265,6 @@ __glXDispSwap_Finish(__GLXclientState * cl, GLbyte * pc)
/* Do a local glFinish */
glFinish();
- cx->hasUnflushedCommands = GL_FALSE;
/* Send empty reply packet to indicate finish is finished */
__GLX_BEGIN_REPLY(0);
diff --git a/glx/singlepix.c b/glx/singlepix.c
index 54ed7fd..b253a59 100644
--- a/glx/singlepix.c
+++ b/glx/singlepix.c
@@ -86,7 +86,6 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
- cx->hasUnflushedCommands = GL_FALSE;
return Success;
}
diff --git a/glx/singlepixswap.c b/glx/singlepixswap.c
index 9eff592..684f4e8 100644
--- a/glx/singlepixswap.c
+++ b/glx/singlepixswap.c
@@ -98,7 +98,6 @@ __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc)
__GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize);
}
- cx->hasUnflushedCommands = GL_FALSE;
return Success;
}
commit 0ebb58f6b6f66afbc3a48bd10693fe190aed8694
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Mar 31 16:20:40 2016 -0400
glx: Remove some redundant zero-init of GLX context state
The context is already calloc'd.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/glx/createcontext.c b/glx/createcontext.c
index 9157e2f..c8b36eb 100644
--- a/glx/createcontext.c
+++ b/glx/createcontext.c
@@ -315,16 +315,8 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
ctx->id = req->context;
ctx->share_id = req->shareList;
ctx->idExists = True;
- ctx->currentClient = False;
ctx->isDirect = req->isDirect;
- ctx->hasUnflushedCommands = False;
ctx->renderMode = GL_RENDER;
- ctx->feedbackBuf = NULL;
- ctx->feedbackBufSize = 0;
- ctx->selectBuf = NULL;
- ctx->selectBufSize = 0;
- ctx->drawPriv = NULL;
- ctx->readPriv = NULL;
ctx->resetNotificationStrategy = reset;
#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
ctx->releaseBehavior = flush;
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0f0b714..b69a830 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -314,16 +314,8 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
glxc->id = gcId;
glxc->share_id = shareList;
glxc->idExists = GL_TRUE;
- glxc->currentClient = NULL;
glxc->isDirect = isDirect;
- glxc->hasUnflushedCommands = GL_FALSE;
glxc->renderMode = GL_RENDER;
- glxc->feedbackBuf = NULL;
- glxc->feedbackBufSize = 0;
- glxc->selectBuf = NULL;
- glxc->selectBufSize = 0;
- glxc->drawPriv = NULL;
- glxc->readPriv = NULL;
/* The GLX_ARB_create_context_robustness spec says:
*
commit d5ba09598210063926aeff55ac58d2b7020d9a03
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Mar 31 15:51:39 2016 -0400
glx/dri2: Implement dri2FlushFrontBuffer explicitly
No functional change.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 253d066..afaf44e 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -754,8 +754,11 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
static void
dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) loaderPrivate;
(void) driDrawable;
- __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate);
+
+ copy_box(loaderPrivate, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft,
+ 0, 0, private->width, private->height);
}
static const __DRIdri2LoaderExtension loaderExtension = {
commit 0ba4e251a1012bd5a2eab83e2c51006ec3805394
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Mar 31 15:50:34 2016 -0400
glx: Code motion
No functional change, just rearranging some code to make later commits
more obvious.
Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index d1fc3f9..253d066 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -98,21 +98,6 @@ struct __GLXDRIdrawable {
};
static void
-__glXDRIdrawableDestroy(__GLXdrawable * drawable)
-{
- __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
- const __DRIcoreExtension *core = private->screen->core;
-
- FreeResource(private->dri2_id, FALSE);
-
- (*core->destroyDrawable) (private->driDrawable);
-
- __glXDrawableRelease(drawable);
-
- free(private);
-}
-
-static void
copy_box(__GLXdrawable * drawable,
int dst, int src,
int x, int y, int w, int h)
@@ -134,6 +119,24 @@ copy_box(__GLXdrawable * drawable,
}
}
+/* white lie */
+extern glx_func_ptr glXGetProcAddressARB(const char *);
+
+static void
+__glXDRIdrawableDestroy(__GLXdrawable * drawable)
+{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
+ const __DRIcoreExtension *core = private->screen->core;
+
+ FreeResource(private->dri2_id, FALSE);
+
+ (*core->destroyDrawable) (private->driDrawable);
+
+ __glXDrawableRelease(drawable);
+
+ free(private);
+}
+
static void
__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable,
int x, int y, int w, int h)
@@ -339,32 +342,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIreleaseTexImage
};
-static void
-__glXDRIscreenDestroy(__GLXscreen * baseScreen)
-{
- int i;
-
- ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
- __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
-
- (*screen->core->destroyScreen) (screen->driScreen);
-
- dlclose(screen->driver);
-
- __glXScreenDestroy(baseScreen);
-
- if (screen->driConfigs) {
- for (i = 0; screen->driConfigs[i] != NULL; i++)
- free((__DRIconfig **) screen->driConfigs[i]);
- free(screen->driConfigs);
- }
-
- pScrn->EnterVT = screen->enterVT;
- pScrn->LeaveVT = screen->leaveVT;
-
- free(screen);
-}
-
static Bool
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
const uint32_t *attribs,
@@ -931,8 +908,31 @@ initializeExtensions(__GLXscreen * screen)
}
}
-/* white lie */
-extern glx_func_ptr glXGetProcAddressARB(const char *);
+static void
+__glXDRIscreenDestroy(__GLXscreen * baseScreen)
+{
+ int i;
+
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
+
+ (*screen->core->destroyScreen) (screen->driScreen);
+
+ dlclose(screen->driver);
+
+ __glXScreenDestroy(baseScreen);
+
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **) screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
+ pScrn->EnterVT = screen->enterVT;
+ pScrn->LeaveVT = screen->leaveVT;
+
+ free(screen);
+}
enum {
GLXOPT_VENDOR_LIBRARY,
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 1e46d97..be32527 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -89,6 +89,9 @@ struct __GLXDRIdrawable {
GCPtr swapgc; /* GC for swapping the color buffers */
};
+/* white lie */
+extern glx_func_ptr glXGetProcAddressARB(const char *);
+
static void
__glXDRIdrawableDestroy(__GLXdrawable * drawable)
{
@@ -210,28 +213,6 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIreleaseTexImage
};
-static void
-__glXDRIscreenDestroy(__GLXscreen * baseScreen)
-{
- int i;
-
- __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
-
- (*screen->core->destroyScreen) (screen->driScreen);
-
- dlclose(screen->driver);
-
- __glXScreenDestroy(baseScreen);
-
- if (screen->driConfigs) {
- for (i = 0; screen->driConfigs[i] != NULL; i++)
- free((__DRIconfig **) screen->driConfigs[i]);
- free(screen->driConfigs);
- }
-
- free(screen);
-}
-
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
__GLXconfig * glxConfig,
@@ -440,8 +421,27 @@ initializeExtensions(__GLXscreen * screen)
}
}
-/* white lie */
-extern glx_func_ptr glXGetProcAddressARB(const char *);
+static void
+__glXDRIscreenDestroy(__GLXscreen * baseScreen)
+{
+ int i;
+
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
+
+ (*screen->core->destroyScreen) (screen->driScreen);
+
+ dlclose(screen->driver);
+
+ __glXScreenDestroy(baseScreen);
+
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **) screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
+ free(screen);
+}
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
More information about the xorg-commit
mailing list