<p>Thanks for the patch.</p>
<p>Reviewed-by: Yuanhan Liu <<a href="mailto:yuanhan.liu@linux.intel.com">yuanhan.liu@linux.intel.com</a>></p>
<div class="gmail_quote">On Jan 20, 2012 9:40 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While reading through the simulator, I found some interesting code that<br>
looks like it checks the sampler default color pointer against the bound<br>
set in STATE_BASE_ADDRESS. On failure, it appears to program it to the<br>
base address itself.<br>
<br>
So I decided to try programming a legitimate bound, and lo and behold,<br>
border color worked. Unfortunately, it's not entirely reliable: piglit<br>
tests (such as tex-border-1) will still fail if you run them in a loop.<br>
<br>
+92 piglits on Sandybridge. Also fixes Lightsmark on Ivybridge.<br>
<br>
NOTE: This is a candidate for stable release branches.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28924" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=28924</a><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=38868<br>
Signed-off-by</a>: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_misc_state.c | 8 +++++++-<br>
1 files changed, 7 insertions(+), 1 deletions(-)<br>
<br>
v2: OUT_RELOC is your friend. Thanks to ickle for pointing out my silly<br>
mistake. Now regression free and fixing lots of tests. And demos!<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c<br>
index 8e59a47..1a7d328 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c<br>
@@ -769,7 +769,13 @@ static void upload_state_base_address( struct brw_context *brw )<br>
1); /* Instruction base address: shader kernels (incl. SIP) */<br>
<br>
OUT_BATCH(1); /* General state upper bound */<br>
- OUT_BATCH(1); /* Dynamic state upper bound */<br>
+ /* Dynamic state upper bound. Although the documentation says that<br>
+ * programming it to zero will cause it to be ignored, that is a lie.<br>
+ * If this isn't programmed to a real bound, the sampler border color<br>
+ * pointer is rejected, causing border color to mysteriously fail.<br>
+ */<br>
+ OUT_RELOC(intel-><a href="http://batch.bo" target="_blank">batch.bo</a>, I915_GEM_DOMAIN_INSTRUCTION, 0,<br>
+ intel->batch.bo->size | 1);<br>
OUT_BATCH(1); /* Indirect object upper bound */<br>
OUT_BATCH(1); /* Instruction access upper bound */<br>
ADVANCE_BATCH();<br>
--<br>
1.7.7.5<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>