Commit 0e9549e2 authored by Kenneth Graunke's avatar Kenneth Graunke

Revert "i965: Delete pre-DRI2.3 viewport hacks."

This reverts commit c9db037d.

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.

parent a8c8c5f8
......@@ -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);
......@@ -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)) {
static const struct dri_debug_control debug_control[] = {
{ "tex", DEBUG_TEXTURE},
{ "state", DEBUG_STATE},
......@@ -454,6 +469,12 @@ intelInitContext(struct brw_context *brw,
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;
......@@ -307,7 +307,8 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (!intelObj)
if (dPriv->lastStamp != dPriv->dri2.stamp)
if (dPriv->lastStamp != dPriv->dri2.stamp ||
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment