From a35f6bb207efe3c959bbd16a37f2049e5aceeea9 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 17 Jul 2009 03:30:29 -0400 Subject: DRI2: add SwapBuffers support Support the new DRI2 protocol request, DRI2SwapBuffers, in both direct and indirect rendering context. This request allows the display server to optimize back->front swaps (e.g. through page flipping) and allows us to more easily support other GLX features like swap interval and the OML sync extension in DRI2. Signed-off-by: Jesse Barnes --- include/GL/internal/dri_interface.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 910c9166b5..ec6238f873 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -262,10 +262,22 @@ struct __DRItexBufferExtensionRec { * Used by drivers that implement DRI2 */ #define __DRI2_FLUSH "DRI2_Flush" -#define __DRI2_FLUSH_VERSION 1 +#define __DRI2_FLUSH_VERSION 2 struct __DRI2flushExtensionRec { __DRIextension base; void (*flush)(__DRIdrawable *drawable); + + /** + * Flush all rendering queue in the driver to the drm and + * invalidate all buffers. The driver will call out to + * getBuffers/getBuffersWithFormat before it starts rendering + * again. + * + * \param drawable the drawable to flush and invalidate + * + * \since 2 + */ + void (*flushInvalidate)(__DRIdrawable *drawable); }; -- cgit v1.2.3 From 7f170573ea486f2f2dd474c2590346f1a0110773 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 12 Nov 2009 16:48:07 +0000 Subject: DRI2/GLX: add INTEL_swap_event support Add event support for the GLX swap buffers event, along with DRI2 protocol support for generating GLX swap buffers events in the direct rendered case. Signed-off-by: Jesse Barnes --- include/GL/glx.h | 19 +++++++++++++++++++ include/GL/glxext.h | 8 ++++++++ 2 files changed, 27 insertions(+) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 2884401406..82b0f22114 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -186,6 +186,16 @@ typedef XID GLXWindow; typedef XID GLXPbuffer; +/* +** Events. +** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX +** event - this helps initialization if the server supports the pbuffer +** extension and the client doesn't. +*/ +#define GLX_PbufferClobber 0 +#define GLX_BufferSwapComplete 1 + +#define __GLX_NUMBER_EVENTS 17 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, int *attribList ); @@ -507,8 +517,17 @@ typedef struct { int count; /* if nonzero, at least this many more */ } GLXPbufferClobberEvent; +typedef struct { + int event_type; + GLXDrawable drawable; + int64_t ust; + int64_t msc; + int64_t sbc; +} GLXBufferSwapComplete; + typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; + GLXBufferSwapComplete glxbufferswapcomplete; long pad[24]; } GLXEvent; diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 9ac0592e05..36ee3665df 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -696,6 +696,14 @@ extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable); typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); #endif +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event +#define GLX_BUFFER_SWAP_COMPLETE_MASK 0x10000000 +#define GLX_EXCHANGE_COMPLETE 0x8024 +#define GLX_BLIT_COMPLETE 0x8025 +#define GLX_FLIP_COMPLETE 0x8026 +#endif + #ifndef GLX_SGIX_swap_barrier #define GLX_SGIX_swap_barrier 1 #ifdef GLX_GLXEXT_PROTOTYPES -- cgit v1.2.3