summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 5165716e09..c9ef1647a3 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -37,15 +37,11 @@
#include "intel_buffers.h"
#include "intel_bufmgr.h"
#include "intel_chipset.h"
-#include "intel_extensions.h"
#include "intel_fbo.h"
-#include "intel_regions.h"
#include "intel_screen.h"
-#include "intel_span.h"
#include "intel_tex.h"
#include "i915_drm.h"
-#include "i830_dri.h"
#define DRI_CONF_TEXTURE_TILING(def) \
DRI_CONF_OPT_BEGIN(texture_tiling, bool, def) \
@@ -113,10 +109,42 @@ 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)
+{
+ struct intel_context *intel = drawable->driContextPriv->driverPrivate;
+
+ intel->using_dri2_swapbuffers = GL_TRUE;
+
+ intelDRI2Flush(drawable);
+ drawable->validBuffers = GL_FALSE;
+
+ intel_update_renderbuffers(intel->driContext, drawable);
+}
+
+static const struct __DRI2flushExtensionRec intelFlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ intelDRI2Flush,
+ intelDRI2FlushInvalidate,
+};
+
static const __DRIextension *intelScreenExtensions[] = {
&driReadDrawableExtension,
&intelTexOffsetExtension.base,
&intelTexBufferExtension.base,
+ &intelFlushExtension.base,
NULL
};
@@ -174,7 +202,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
if (!fb)
return GL_FALSE;
- _mesa_initialize_framebuffer(fb, mesaVis);
+ _mesa_initialize_window_framebuffer(fb, mesaVis);
if (mesaVis->redBits == 5)
rgbFormat = MESA_FORMAT_RGB565;
@@ -311,11 +339,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;