Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dreveman:openSUSE:11.1:cr
Mesa
mesa-chromium-server-side-resources.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mesa-chromium-server-side-resources.diff of Package Mesa
commit a8bf43f21926c868265659dfc53625ba9eb33197 Author: David Reveman <davidr@novell.com> Date: Wed Apr 15 00:23:12 2009 -0400 Server-side resource management support. diff --git a/src/glx/x11/dricr_glx.c b/src/glx/x11/dricr_glx.c index 9c0d125..53c8fad 100644 --- a/src/glx/x11/dricr_glx.c +++ b/src/glx/x11/dricr_glx.c @@ -46,6 +46,21 @@ #include "glapioffsets.h" #include "glapitable.h" +#ifndef GL_CR_replicate_config +#define GL_CR_replicate_config 1 + +#define GL_REPLICATE_BACKEND_CR 0x9A50 +#define GL_REPLICATE_URL_CR 0x9A51 +#define GL_REPLICATE_REDIRECTED_CR 0x9A52 +#define GL_REPLICATE_NATIVE_WINDOW_CR 0x9A53 +#define GL_REPLICATE_NEW_CLIENT_CR 0x9A54 +#define GL_REPLICATE_START_CR 0x9A55 +#define GL_REPLICATE_GLX_CONTEXT_CR 0x9A56 +#define GL_REPLICATE_GLX_DRAWABLE_CR 0x9A57 +#define GL_REPLICATE_SERVER_WINDOW_ID_CR 0x9A58 +#define GL_REPLICATE_SERVER_CONTEXT_ID_CR 0x9A59 +#endif + #define KEYWORD1 static #define KEYWORD1_ALT static #define KEYWORD2 GLAPIENTRY @@ -110,12 +125,14 @@ struct __GLXDRIcontextPrivateRec { __GLXDRIcontext base; __GLXscreenConfigs *psc; + XID xid; GLint spuContext; }; struct __GLXDRIdrawablePrivateRec { __GLXDRIdrawable base; + XID xid; GLint spuDrawable; }; @@ -420,7 +437,7 @@ driCreateSPUChain (Display *dpy) } else { - ErrorMessageF ("Unable to connect to CHROMIUM mothership"); + ErrorMessageF ("Unable to connect to CHROMIUM mothership\n"); } if (env) @@ -463,9 +480,23 @@ driDestroyContext (__GLXDRIcontext *context, __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; __GLXDRIscreenPrivate *psp = (__GLXDRIscreenPrivate *) pcp->psc->driScreen; + xGLXDestroyContextReq *req; + CARD8 opcode; (*psp->pdp->spu->dispatch_table.DestroyContext) (pcp->spuContext); + opcode = __glXSetupForCommand (dpy); + if (opcode) + { + LockDisplay (dpy); + GetReq (GLXDestroyContext, req); + req->reqType = opcode; + req->glxCode = X_GLXDestroyContext; + req->context = pcp->xid; + UnlockDisplay (dpy); + SyncHandle (); + } + Xfree (pcp); } @@ -503,13 +534,19 @@ driCreateContext (__GLXscreenConfigs *psc, GLXContext shareList, int renderType) { - __GLXDRIcontextPrivate *pcp, *pcp_shared; + __GLXDRIcontextPrivate *pcp, *pcp_shared = NULL; __GLXDRIscreenPrivate *psp = (__GLXDRIscreenPrivate *) psc->driScreen; GLint spuShareContext = 0; + xGLXCreateContextReq *req; + Display *dpy; + CARD8 opcode; + GLuint value[2]; if (!psc || !psp) return NULL; + dpy = psc->dpy; + if (shareList) { pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; @@ -526,7 +563,7 @@ driCreateContext (__GLXscreenConfigs *psc, pcp->psc = psc; pcp->spuContext = - (*psp->pdp->spu->dispatch_table.CreateContext) (DisplayString (psc->dpy), + (*psp->pdp->spu->dispatch_table.CreateContext) (DisplayString (dpy), visBitsFromMode (mode), spuShareContext); if (pcp->spuContext == -1) @@ -535,6 +572,37 @@ driCreateContext (__GLXscreenConfigs *psc, return NULL; } + opcode = __glXSetupForCommand (dpy); + if (!opcode) + { + (*psp->pdp->spu->dispatch_table.DestroyContext) (pcp->spuContext); + Xfree (pcp); + return NULL; + } + + LockDisplay (dpy); + GetReq (GLXCreateContext, req); + req->reqType = opcode; + req->glxCode = X_GLXCreateContext; + req->context = pcp->xid = XAllocID (dpy); + req->visual = mode->visualID; + req->screen = mode->screen; + req->shareList = shareList ? pcp_shared->xid : None; + req->isDirect = GL_FALSE; + UnlockDisplay (dpy); + SyncHandle (); + + XSync (dpy, False); + + value[0] = pcp->spuContext; + value[1] = pcp->xid; + + (*psp->pdp->spu->dispatch_table.ChromiumParametervCR) + (GL_REPLICATE_GLX_CONTEXT_CR, + GL_UNSIGNED_INT, + 2, + value); + return &pcp->base; } @@ -544,9 +612,26 @@ driDestroyDrawable (__GLXDRIdrawable *pdraw) __GLXDRIdrawablePrivate *pdp = (__GLXDRIdrawablePrivate *) pdraw; __GLXDRIscreenPrivate *psp = (__GLXDRIscreenPrivate *) pdraw->psc->driScreen; + xGLXDestroyPbufferReq *req; + Display *dpy = pdraw->psc->dpy; + CARD8 opcode; (*psp->pdp->spu->dispatch_table.WindowDestroy) (pdp->spuDrawable); + opcode = __glXSetupForCommand (dpy); + if (opcode) + { + LockDisplay (dpy); + + GetReqExtra(GLXDestroyPbuffer, 4, req); + req->reqType = opcode; + req->glxCode = X_GLXDestroyWindow; + req->pbuffer = (GLXPbuffer) pdp->xid; + + UnlockDisplay (dpy); + SyncHandle (); + } + Xfree (pdp); } @@ -558,6 +643,33 @@ driCreateDrawable (__GLXscreenConfigs *psc, { __GLXDRIdrawablePrivate *pdp; __GLXDRIscreenPrivate *psp = (__GLXDRIscreenPrivate *) psc->driScreen; + xGLXCreateWindowReq *req; + Display *dpy = psc->dpy; + CARD8 opcode; + GLuint value[2]; + + if (mode->fbconfigID == GLX_DONT_CARE) + { + __GLXdisplayPrivate *priv = __glXInitialize (dpy); + __GLcontextModes *modes; + + for (modes = priv->screenConfigs[mode->screen].configs; + modes != NULL; + modes = modes->next) + if (modes->fbconfigID != GLX_DONT_CARE && + modes->screen == mode->screen && + modes->visualID == mode->visualID) + break; + + if (!modes) + { + ErrorMessageF ("No valid fbconfig for visual 0x%x\n", + mode->visualID); + return NULL; + } + + mode = modes; + } pdp = Xmalloc (sizeof *pdp); if (!pdp) @@ -570,10 +682,8 @@ driCreateDrawable (__GLXscreenConfigs *psc, pdp->base.textureTarget = 0; pdp->base.driDrawable = NULL; - XSync (psc->dpy, False); - pdp->spuDrawable = - (*psp->pdp->spu->dispatch_table.WindowCreate) (DisplayString (psc->dpy), + (*psp->pdp->spu->dispatch_table.WindowCreate) (DisplayString (dpy), visBitsFromMode (mode)); if (pdp->spuDrawable == -1) { @@ -581,6 +691,37 @@ driCreateDrawable (__GLXscreenConfigs *psc, return NULL; } + opcode = __glXSetupForCommand (dpy); + if (!opcode) + { + (*psp->pdp->spu->dispatch_table.WindowDestroy) (pdp->spuDrawable); + Xfree (pdp); + return None; + } + + LockDisplay (dpy); + GetReq (GLXCreateWindow, req); + req->reqType = opcode; + req->glxCode = X_GLXCreateWindow; + req->screen = (CARD32) mode->screen; + req->fbconfig = mode->fbconfigID; + req->window = (CARD32) xDrawable; + req->glxwindow = pdp->xid = XAllocID (dpy); + req->numAttribs = (CARD32) 0; + UnlockDisplay (dpy); + SyncHandle (); + + XSync (dpy, False); + + value[0] = pdp->spuDrawable; + value[1] = pdp->xid; + + (*psp->pdp->spu->dispatch_table.ChromiumParametervCR) + (GL_REPLICATE_GLX_DRAWABLE_CR, + GL_UNSIGNED_INT, + 2, + value); + return &pdp->base; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor