Merge branch 'mesa_7_5_branch'

Conflicts:
	src/glx/x11/glxcmds.c
This commit is contained in:
Michel Dänzer 2009-08-30 13:06:18 +02:00 committed by Michel Dänzer
commit 9053bb0d40
2 changed files with 34 additions and 2 deletions

View file

@ -123,21 +123,25 @@ static enum pipe_error
u_upload_alloc_buffer( struct u_upload_mgr *upload,
unsigned min_size )
{
unsigned size;
/* Release old buffer, if present:
*/
u_upload_flush( upload );
/* Allocate a new one:
*/
upload->size = align(MAX2(upload->default_size, min_size), 4096);
size = align(MAX2(upload->default_size, min_size), 4096);
upload->buffer = pipe_buffer_create( upload->screen,
upload->alignment,
upload->usage | PIPE_BUFFER_USAGE_CPU_WRITE,
upload->size );
size );
if (upload->buffer == NULL)
goto fail;
upload->size = size;
upload->offset = 0;
return 0;

View file

@ -880,6 +880,34 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
req->glxpixmap = xid = XAllocID(dpy);
UnlockDisplay(dpy);
SyncHandle();
#ifdef GLX_DIRECT_RENDERING
do {
/* FIXME: Maybe delay __DRIdrawable creation until the drawable
* is actually bound to a context... */
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
__GLXDRIdrawable *pdraw;
__GLXscreenConfigs *psc;
__GLcontextModes *modes;
psc = &priv->screenConfigs[vis->screen];
if (psc->driScreen == NULL)
break;
modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid);
pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes);
if (pdraw == NULL) {
fprintf(stderr, "failed to create pixmap\n");
break;
}
if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
return None; /* FIXME: Check what we're supposed to do here... */
}
} while (0);
#endif
return xid;
}