summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c5
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h1
-rw-r--r--src/mesa/drivers/dri/intel/intel_extensions.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c33
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c3
5 files changed, 37 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 13a28f0419..3f6634c65a 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -70,8 +70,6 @@ int INTEL_DEBUG = (0);
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
-static void intel_flush(GLcontext *ctx, GLboolean needs_mi_flush);
-
static const GLubyte *
intelGetString(GLcontext * ctx, GLenum name)
{
@@ -378,6 +376,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
}
}
+ drawable->validBuffers = GL_TRUE;
driUpdateFramebufferSize(&intel->ctx, drawable);
}
@@ -461,7 +460,7 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state)
intel->vtbl.invalidate_state( intel, new_state );
}
-static void
+void
intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
{
struct intel_context *intel = intel_context(ctx);
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index c7b7235836..07207bfbec 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -412,6 +412,7 @@ extern GLboolean intelInitContext(struct intel_context *intel,
extern void intelFinish(GLcontext * ctx);
extern void intelFlush(GLcontext * ctx);
+extern void intel_flush(GLcontext * ctx, GLboolean needs_mi_flush);
extern void intelInitDriverFunctions(struct dd_function_table *functions);
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.h b/src/mesa/drivers/dri/intel/intel_extensions.h
index 1d1c97a4a9..e78e07356e 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions.h
+++ b/src/mesa/drivers/dri/intel/intel_extensions.h
@@ -32,5 +32,8 @@
extern void
intelInitExtensions(GLcontext *ctx);
+extern void
+intelFlushDrawable(__DRIdrawable *drawable);
+
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 5165716e09..e240957197 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -113,10 +113,36 @@ 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,
&intelTexOffsetExtension.base,
&intelTexBufferExtension.base,
+ &intelFlushExtension.base,
NULL
};
@@ -311,11 +337,10 @@ __DRIconfig **intelInitScreen2(__DRIscreen *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;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 307669f87e..6f41eafd0e 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -742,7 +742,8 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (!intelObj)
return;
- intel_update_renderbuffers(pDRICtx, dPriv);
+ if (!dPriv->validBuffers)
+ intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
/* If the region isn't set, then intel_update_renderbuffers was unable