summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_screen.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-01-08 12:35:47 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-01-08 12:40:58 -0500
commit7c50d29f7ced3d60e52ee0146d982b49ea421de2 (patch)
treeb867c8735db9b8f6b16a629e3b530e1505547e2e /src/mesa/drivers/dri/intel/intel_screen.c
parentc642f3941ba2ab68135037e1fcb1c29dcb820de7 (diff)
intel/DRI2: add DRI2flushExtension support with invalidate hook
Needed to support the SwapBuffers code properly. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index a3d676741a..8251e91ace 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -236,6 +236,31 @@ static const __DRItexBufferExtension intelTexBufferExtension = {
intelSetTexBuffer2,
};
+static void
+intelDRI2Flush(__DRIdrawable *drawable)
+{
+ struct intel_context *intel = drawable->driContextPriv->driverPrivate;
+
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
+
+ if (intel->batch->map != intel->batch->ptr)
+ intel_batchbuffer_flush(intel->batch);
+}
+
+static void
+intelDRI2FlushInvalidate(__DRIdrawable *drawable)
+{
+ intelDRI2Flush(drawable);
+ drawable->validBuffers = GL_FALSE;
+}
+
+static const struct __DRI2flushExtensionRec intelFlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ intelDRI2Flush,
+ intelDRI2FlushInvalidate,
+};
+
static const __DRIextension *intelScreenExtensions[] = {
&driReadDrawableExtension,
&driCopySubBufferExtension.base,
@@ -244,6 +269,7 @@ static const __DRIextension *intelScreenExtensions[] = {
&driMediaStreamCounterExtension.base,
&intelTexOffsetExtension.base,
&intelTexBufferExtension.base,
+ &intelFlushExtension.base,
NULL
};
@@ -524,11 +550,9 @@ intelFillInModes(__DRIscreenPrivate *psp,
unsigned back_buffer_factor;
int i;
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML,
+ GLX_SWAP_EXCHANGE_OML, GLX_SWAP_COPY_OML
};
uint8_t depth_bits_array[3];
@@ -711,11 +735,10 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
intelScreenPrivate *intelScreen;
GLenum fb_format[3];
GLenum fb_type[3];
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
+
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML,
+ GLX_SWAP_EXCHANGE_OML, GLX_SWAP_COPY_OML
};
uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
int color;