diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-01-08 15:42:57 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-01-08 15:42:57 +0000 |
commit | 080c40ab32b2abd6d8381b4a0cc143d36a1652b2 (patch) | |
tree | e173767ebc5a82d81b9fc086449d915e29348976 /src/glx/x11 | |
parent | 9cdf6f025b2ed55cfb13dd09f870f01d0c7947d3 (diff) | |
parent | a1de400e8de06a80ab140bb0fa950e990607572d (diff) |
Merge remote branch 'origin/master' into lp-binning
Conflicts:
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/llvmpipe/SConscript
src/gallium/drivers/llvmpipe/lp_bld_arit.c
src/gallium/drivers/llvmpipe/lp_bld_flow.c
src/gallium/drivers/llvmpipe/lp_bld_interp.c
src/gallium/drivers/llvmpipe/lp_clear.c
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_draw_arrays.c
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_jit.h
src/gallium/drivers/llvmpipe/lp_prim_vbuf.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_state.h
src/gallium/drivers/llvmpipe/lp_state_blend.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_sampler.c
src/gallium/drivers/llvmpipe/lp_state_surface.c
src/gallium/drivers/llvmpipe/lp_tex_cache.c
src/gallium/drivers/llvmpipe/lp_tex_cache.h
src/gallium/drivers/llvmpipe/lp_tex_sample.h
src/gallium/drivers/llvmpipe/lp_tile_cache.c
Diffstat (limited to 'src/glx/x11')
-rw-r--r-- | src/glx/x11/dri2.c | 4 | ||||
-rw-r--r-- | src/glx/x11/dri_glx.c | 19 | ||||
-rw-r--r-- | src/glx/x11/drisw_glx.c | 4 | ||||
-rw-r--r-- | src/glx/x11/glxcmds.c | 16 | ||||
-rw-r--r-- | src/glx/x11/glxcurrent.c | 7 | ||||
-rw-r--r-- | src/glx/x11/glxext.c | 5 | ||||
-rw-r--r-- | src/glx/x11/glxextensions.c | 5 | ||||
-rw-r--r-- | src/glx/x11/glxextensions.h | 5 | ||||
-rw-r--r-- | src/glx/x11/indirect.c | 66 | ||||
-rw-r--r-- | src/glx/x11/indirect.h | 3 | ||||
-rw-r--r-- | src/glx/x11/indirect_init.c | 12 | ||||
-rw-r--r-- | src/glx/x11/xf86dri.h | 4 |
12 files changed, 122 insertions, 28 deletions
diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index e144ed3e1f..dad04470a0 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -31,6 +31,8 @@ */ +#ifdef GLX_DIRECT_RENDERING + #define NEED_REPLIES #include <X11/Xlibint.h> #include <X11/extensions/Xext.h> @@ -377,3 +379,5 @@ DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region, UnlockDisplay(dpy); SyncHandle(); } + +#endif /* GLX_DIRECT_RENDERING */ diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index ab24bd8ffe..a890feeab2 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -280,8 +280,6 @@ static const __DRIextension *loader_extensions[] = { NULL }; -#ifndef GLX_USE_APPLEGL - /** * Perform the required libGL-side initialization and call the client-side * driver's \c __driCreateNewScreen function. @@ -292,7 +290,7 @@ static const __DRIextension *loader_extensions[] = { * \param driDpy DRI display information. * \param createNewScreen Pointer to the client-side driver's * \c __driCreateNewScreen function. - * \returns A pointer to the \c __DRIscreenPrivate structure returned by + * \returns A pointer to the \c __DRIscreen structure returned by * the client-side driver on success, or \c NULL on failure. */ static void * @@ -475,17 +473,6 @@ CallCreateNewScreen(Display * dpy, int scrn, __GLXscreenConfigs * psc, return NULL; } -#else /* !GLX_USE_APPLEGL */ - -static void * -CallCreateNewScreen(Display * dpy, int scrn, __GLXscreenConfigs * psc, - __GLXDRIdisplayPrivate * driDpy) -{ - return NULL; -} - -#endif /* !GLX_USE_APPLEGL */ - static void driDestroyContext(__GLXDRIcontext * context, __GLXscreenConfigs * psc, Display * dpy) @@ -596,8 +583,10 @@ driCreateDrawable(__GLXscreenConfigs * psc, pdraw->drawable = drawable; pdraw->psc = psc; - if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) + if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) { + Xfree(pdraw); return NULL; + } /* Create a new drawable */ pdraw->driDrawable = diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c index 15e1586658..1866b2cc87 100644 --- a/src/glx/x11/drisw_glx.c +++ b/src/glx/x11/drisw_glx.c @@ -250,12 +250,14 @@ driCreateContext(__GLXscreenConfigs * psc, { __GLXDRIcontextPrivate *pcp, *pcp_shared; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; - const __DRIcoreExtension *core = psc->core; + const __DRIcoreExtension *core; __DRIcontext *shared = NULL; if (!psc || !psc->driScreen) return NULL; + core = psc->core; + if (shareList) { pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; shared = pcp_shared->driContext; diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index cd4aede74e..d1c68dd02e 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -50,7 +50,7 @@ #include <xcb/glx.h> #endif -static const char __glXGLXClientVendorName[] = "SGI"; +static const char __glXGLXClientVendorName[] = "Mesa Project and SGI"; static const char __glXGLXClientVersion[] = "1.4"; @@ -540,6 +540,16 @@ DestroyContext(Display * dpy, GLXContext gc) imported = gc->imported; gc->xid = None; + if (gc->currentDpy) { + /* This context is bound to some thread. According to the man page, + * we should not actually delete the context until it's unbound. + * Note that we set gc->xid = None above. In MakeContextCurrent() + * we check for that and delete the context there. + */ + __glXUnlock(); + return; + } + #ifdef GLX_DIRECT_RENDERING /* Destroy the direct rendering context */ if (gc->driContext) { @@ -2565,7 +2575,7 @@ glXAllocateMemoryMESA(Display * dpy, int scrn, (void) readFreq; (void) writeFreq; (void) priority; -#endif /* GLX_DIRECT_RENDERING */ +#endif /* __DRI_ALLOCATE */ return NULL; } @@ -2584,7 +2594,7 @@ glXFreeMemoryMESA(Display * dpy, int scrn, void *pointer) (void) dpy; (void) scrn; (void) pointer; -#endif /* GLX_DIRECT_RENDERING */ +#endif /* __DRI_ALLOCATE */ } diff --git a/src/glx/x11/glxcurrent.c b/src/glx/x11/glxcurrent.c index f1e3e161be..fae1bd9fa6 100644 --- a/src/glx/x11/glxcurrent.c +++ b/src/glx/x11/glxcurrent.c @@ -475,13 +475,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, IndirectAPI = __glXNewIndirectAPI(); _glapi_set_dispatch(IndirectAPI); -#ifdef GLX_USE_APPLEGL - do { - extern void XAppleDRIUseIndirectDispatch(void); - XAppleDRIUseIndirectDispatch(); - } while (0); -#endif - state = (__GLXattribute *) (gc->client_state_private); gc->currentContextTag = reply.contextTag; diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index e5553cbf76..5633a3e4a2 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -150,8 +150,9 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv) #ifdef GLX_DIRECT_RENDERING if (psc->driver_configs) { - for (unsigned int i = 0; psc->driver_configs[i]; i++) - free((__DRIconfig *) psc->driver_configs[i]); + unsigned int j; + for (j = 0; psc->driver_configs[j]; j++) + free((__DRIconfig *) psc->driver_configs[j]); free(psc->driver_configs); psc->driver_configs = NULL; } diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index 473f46d1e5..6852128e2a 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -112,6 +112,7 @@ static const struct extension_info known_gl_extensions[] = { { GL(ARB_draw_buffers), VER(0,0), Y, N, N, N }, { GL(ARB_fragment_program), VER(0,0), Y, N, N, N }, { GL(ARB_fragment_program_shadow), VER(0,0), Y, N, N, N }, + { GL(ARB_framebuffer_object), VER(0,0), Y, N, N, N }, { GL(ARB_imaging), VER(0,0), Y, N, N, N }, { GL(ARB_multisample), VER(1,3), Y, N, N, N }, { GL(ARB_multitexture), VER(1,3), Y, N, N, N }, @@ -150,8 +151,11 @@ static const struct extension_info known_gl_extensions[] = { { GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N }, { GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N }, { GL(EXT_fog_coord), VER(1,4), Y, N, N, N }, + { GL(EXT_framebuffer_blit), VER(0,0), Y, N, N, N }, + { GL(EXT_framebuffer_multisample), VER(0,0), Y, N, N, N }, { GL(EXT_framebuffer_object), VER(0,0), Y, N, N, N }, { GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N }, + { GL(EXT_packed_depth_stencil), VER(0,0), Y, N, N, N }, { GL(EXT_packed_pixels), VER(1,2), Y, N, N, N }, { GL(EXT_paletted_texture), VER(0,0), Y, N, N, N }, { GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N }, @@ -209,6 +213,7 @@ static const struct extension_info known_gl_extensions[] = { { GL(NV_fragment_program2), VER(0,0), Y, N, N, N }, { GL(NV_light_max_exponent), VER(0,0), Y, N, N, N }, { GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N }, + { GL(NV_packed_depth_stencil), VER(0,0), Y, N, N, N }, { GL(NV_point_sprite), VER(0,0), Y, N, N, N }, { GL(NV_texgen_reflection), VER(0,0), Y, N, N, N }, { GL(NV_texture_compression_vtc), VER(0,0), Y, N, N, N }, diff --git a/src/glx/x11/glxextensions.h b/src/glx/x11/glxextensions.h index 9f1c697487..652c5db1c8 100644 --- a/src/glx/x11/glxextensions.h +++ b/src/glx/x11/glxextensions.h @@ -74,6 +74,7 @@ enum GL_ARB_draw_buffers_bit, GL_ARB_fragment_program_bit, GL_ARB_fragment_program_shadow_bit, + GL_ARB_framebuffer_object_bit, GL_ARB_imaging_bit, GL_ARB_multisample_bit, GL_ARB_multitexture_bit, @@ -112,8 +113,11 @@ enum GL_EXT_depth_bounds_test_bit, GL_EXT_draw_range_elements_bit, GL_EXT_fog_coord_bit, + GL_EXT_framebuffer_blit_bit, + GL_EXT_framebuffer_multisample_bit, GL_EXT_framebuffer_object_bit, GL_EXT_multi_draw_arrays_bit, + GL_EXT_packed_depth_stencil_bit, GL_EXT_packed_pixels_bit, GL_EXT_paletted_texture_bit, GL_EXT_pixel_buffer_object_bit, @@ -164,6 +168,7 @@ enum GL_NV_fragment_program2_bit, GL_NV_light_max_exponent_bit, GL_NV_multisample_filter_hint_bit, + GL_NV_packed_depth_stencil_bit, GL_NV_point_sprite_bit, GL_NV_texgen_reflection_bit, GL_NV_texture_compression_vtc_bit, diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index e0cafd43bc..ea90ce4463 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -8604,6 +8604,26 @@ __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs) } } +#define X_GLrop_RenderbufferStorageMultisample 4331 +void +__indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalformat, + GLsizei width, GLsizei height) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_RenderbufferStorageMultisample, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&samples), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&internalformat), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&width), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&height), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + #define X_GLrop_SampleMaskSGIS 2048 void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) @@ -10597,6 +10617,52 @@ __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, } } +#define X_GLrop_BlitFramebufferEXT 4330 +void +__indirect_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, + GLint srcY1, GLint dstX0, GLint dstY0, + GLint dstX1, GLint dstY1, GLbitfield mask, + GLenum filter) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 44; + emit_header(gc->pc, X_GLrop_BlitFramebufferEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&srcX0), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&srcY0), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&srcX1), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&srcY1), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&dstX0), 4); + (void) memcpy((void *) (gc->pc + 24), (void *) (&dstY0), 4); + (void) memcpy((void *) (gc->pc + 28), (void *) (&dstX1), 4); + (void) memcpy((void *) (gc->pc + 32), (void *) (&dstY1), 4); + (void) memcpy((void *) (gc->pc + 36), (void *) (&mask), 4); + (void) memcpy((void *) (gc->pc + 40), (void *) (&filter), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + +#define X_GLrop_FramebufferTextureLayerEXT 237 +void +__indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, + GLuint texture, GLint level, + GLint layer) +{ + __GLXcontext *const gc = __glXGetCurrentContext(); + const GLuint cmdlen = 24; + emit_header(gc->pc, X_GLrop_FramebufferTextureLayerEXT, cmdlen); + (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); + (void) memcpy((void *) (gc->pc + 8), (void *) (&attachment), 4); + (void) memcpy((void *) (gc->pc + 12), (void *) (&texture), 4); + (void) memcpy((void *) (gc->pc + 16), (void *) (&level), 4); + (void) memcpy((void *) (gc->pc + 20), (void *) (&layer), 4); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { + (void) __glXFlushRenderBuffer(gc, gc->pc); + } +} + # undef FASTCALL # undef NOINLINE diff --git a/src/glx/x11/indirect.h b/src/glx/x11/indirect.h index 0719a1b302..19a8c0d134 100644 --- a/src/glx/x11/indirect.h +++ b/src/glx/x11/indirect.h @@ -572,6 +572,7 @@ extern HIDDEN void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GL extern HIDDEN void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params); extern HIDDEN GLboolean __indirect_glIsQueryARB(GLuint id); extern HIDDEN void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs); +extern HIDDEN void __indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); extern HIDDEN void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert); extern HIDDEN void __indirect_glSamplePatternSGIS(GLenum pattern); extern HIDDEN void __indirect_glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); @@ -710,6 +711,8 @@ extern HIDDEN void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLe extern HIDDEN GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer); extern HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer); extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +extern HIDDEN void __indirect_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +extern HIDDEN void __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); # undef HIDDEN # undef FASTCALL diff --git a/src/glx/x11/indirect_init.c b/src/glx/x11/indirect_init.c index 852fe712c6..73ca993027 100644 --- a/src/glx/x11/indirect_init.c +++ b/src/glx/x11/indirect_init.c @@ -588,6 +588,10 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->DrawBuffersARB = __indirect_glDrawBuffersARB; + /* 45. GL_ARB_framebuffer_object */ + + glAPI->RenderbufferStorageMultisample = __indirect_glRenderbufferStorageMultisample; + /* 25. GL_SGIS_multisample */ glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS; @@ -768,6 +772,14 @@ __GLapi * __glXNewIndirectAPI( void ) glAPI->IsRenderbufferEXT = __indirect_glIsRenderbufferEXT; glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT; + /* 316. GL_EXT_framebuffer_blit */ + + glAPI->BlitFramebufferEXT = __indirect_glBlitFramebufferEXT; + + /* 329. GL_EXT_texture_array */ + + glAPI->FramebufferTextureLayerEXT = __indirect_glFramebufferTextureLayerEXT; + return glAPI; } diff --git a/src/glx/x11/xf86dri.h b/src/glx/x11/xf86dri.h index f2d0dd5435..ba266003f7 100644 --- a/src/glx/x11/xf86dri.h +++ b/src/glx/x11/xf86dri.h @@ -115,6 +115,10 @@ Bool XF86DRIGetDeviceInfo(Display * dpy, int screen, int *fbSize, int *fbStride, int *devPrivateSize, void **pDevPrivate); +Bool XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable); + +Bool XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable); + _XFUNCPROTOEND #endif /* _XF86DRI_SERVER_ */ #endif /* _XF86DRI_H_ */ |