summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-25 15:11:13 -0700
committerIan Romanick <ian.d.romanick@intel.com>2013-08-05 15:41:13 -0700
commit4f5e18cb3e062223ee874af47214f34d0d8a346a (patch)
treea793602ec8f77d74447537d2ccd9899434b971c2 /src/mesa/drivers/dri/i965
parente108bb07a085d1e60f635318641024110be4b247 (diff)
Revert "i965: Delete pre-DRI2.3 viewport hacks."
This reverts commit c9db037dc999eadbcaa8816c814e6ec1776d1a40. Eric believes that the viewport hacks are still necessary for EGL; invalidate events aren't hooked up properly. This commit caused a regression where EFL applications wouldn't show anything other than window decorations; GLBenchmark also showed issues. The revert had conflicts due to the intel_context/brw_context merge. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66606 Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit 0e9549e2bd57168086421468cbf1db0821c36730)
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h2
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c21
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_image.c3
3 files changed, 25 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 86f9f716a2b..2ab150bca1a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1239,6 +1239,8 @@ struct brw_context
__DRIcontext *driContext;
struct intel_screen *intelScreen;
+ void (*saved_viewport)(struct gl_context *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height);
};
/*======================================================================
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 742bcc35433..2e15a55fc25 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -288,6 +288,21 @@ intel_prepare_render(struct brw_context *brw)
}
}
+static void
+intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ struct brw_context *brw = brw_context(ctx);
+ __DRIcontext *driContext = brw->driContext;
+
+ if (brw->saved_viewport)
+ brw->saved_viewport(ctx, x, y, w, h);
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ dri2InvalidateDrawable(driContext->driDrawablePriv);
+ dri2InvalidateDrawable(driContext->driReadablePriv);
+ }
+}
+
static const struct dri_debug_control debug_control[] = {
{ "tex", DEBUG_TEXTURE},
{ "state", DEBUG_STATE},
@@ -454,6 +469,12 @@ intelInitContext(struct brw_context *brw,
dri_ctx_error))
return false;
+ /* Can't rely on invalidate events, fall back to glViewport hack */
+ if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
+ brw->saved_viewport = functions->Viewport;
+ functions->Viewport = intel_viewport;
+ }
+
if (mesaVis == NULL) {
memset(&visual, 0, sizeof visual);
mesaVis = &visual;
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 9c5d234b12c..4b551b7c5d0 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -307,7 +307,8 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (!intelObj)
return;
- if (dPriv->lastStamp != dPriv->dri2.stamp)
+ if (dPriv->lastStamp != dPriv->dri2.stamp ||
+ !pDRICtx->driScreenPriv->dri2.useInvalidate)
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);