Mesa (master): i965: Stop putting 8 NOPs after each prorgam.

Eric Anholt anholt at kemper.freedesktop.org
Mon Sep 17 19:33:37 UTC 2012


Module: Mesa
Branch: master
Commit: 81dff4f752af786767f74ca54f89a879f57c18a6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=81dff4f752af786767f74ca54f89a879f57c18a6

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Aug 31 11:41:22 2012 -0700

i965: Stop putting 8 NOPs after each prorgam.

As far as I can see, the intention of the requirement that we do so is to
prevent instruction prefetch from wandering out into either unmapped memory or
memory with a different caching type, and hanging the chip.  The kernel makes
sure that the page after your BO has a valid page of the same caching type,
which meets this requirement, so there's no need to waste space between our
programs (and in instruction cache) on this.

Saves another 9kb instructions in l4d2 shaders.

Acked-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_eu.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index 130d801..c60b16c 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -214,16 +214,8 @@ brw_init_compile(struct brw_context *brw, struct brw_compile *p, void *mem_ctx)
 const GLuint *brw_get_program( struct brw_compile *p,
 			       GLuint *sz )
 {
-   GLuint i;
-
    brw_compact_instructions(p);
 
-   /* We emit a cacheline (8 instructions) of NOPs at the end of the program to
-    * make sure that instruction prefetch doesn't wander off into some other BO.
-    */
-   for (i = 0; i < 8; i++)
-      brw_NOP(p);
-
    *sz = p->next_insn_offset;
    return (const GLuint *)p->store;
 }




More information about the mesa-commit mailing list