[Mesa-dev] [PATCH 06/14] i965: Delete pre-DRI2.3 viewport hacks.

Kenneth Graunke kenneth at whitecape.org
Tue Jul 2 01:54:48 PDT 2013


The __DRI_USE_INVALIDATE extension was added in May 11th, 2010 by commit
4258e3a2e1c327.  At this point, it's unlikely that anyone's using the
right mix of new and old components to hit this path.  Deleting it
removes an untested code path and cleans up the driver a bit.

---
 src/mesa/drivers/dri/i965/intel_context.c   | 21 ---------------------
 src/mesa/drivers/dri/i965/intel_context.h   |  2 --
 src/mesa/drivers/dri/i965/intel_tex_image.c |  3 +--
 3 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 2604020..ca3123a 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -290,21 +290,6 @@ intel_prepare_render(struct intel_context *intel)
    }
 }
 
-static void
-intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
-    struct intel_context *intel = intel_context(ctx);
-    __DRIcontext *driContext = intel->driContext;
-
-    if (intel->saved_viewport)
-	intel->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},
@@ -474,12 +459,6 @@ intelInitContext(struct intel_context *intel,
                                  dri_ctx_error))
       return false;
 
-   /* Can't rely on invalidate events, fall back to glViewport hack */
-   if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
-      intel->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_context.h b/src/mesa/drivers/dri/i965/intel_context.h
index ef8251d..7813548 100644
--- a/src/mesa/drivers/dri/i965/intel_context.h
+++ b/src/mesa/drivers/dri/i965/intel_context.h
@@ -246,8 +246,6 @@ struct intel_context
 
    __DRIcontext *driContext;
    struct intel_screen *intelScreen;
-   void (*saved_viewport)(struct gl_context * ctx,
-			  GLint x, GLint y, GLsizei width, GLsizei height);
 
    /**
     * Configuration cache
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 0d0c7f1..5a10a37 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -310,8 +310,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    if (!intelObj)
       return;
 
-   if (dPriv->lastStamp != dPriv->dri2.stamp ||
-       !pDRICtx->driScreenPriv->dri2.useInvalidate)
+   if (dPriv->lastStamp != dPriv->dri2.stamp)
       intel_update_renderbuffers(pDRICtx, dPriv);
 
    rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
-- 
1.8.3.1



More information about the mesa-dev mailing list