<div dir="ltr">Seems like a good idea.<br><div><br>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 4, 2017 at 5:09 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Using an incoherent CPU map on the active scanout buffer is really<br>
sketchy - we may need extra flushing via GEM_SW_FINISH, or using<br>
drmModeDirtyFB() and kernel commit a6a7cc4b7db6d (4.10+).<br>
<br>
Chris suggests "never ever do that", which seems like a wise plan!<br>
<br>
intel_miptree_map_raw() uses CPU maps on linear buffers.<br>
<br>
Having a linear scanout buffer should be really rare, and mapping the<br>
front buffer should be similarly rare. Together, it should basically<br>
never happen. But, in case it does somehow...make sure that mapping<br>
the scanout buffer always goes through an uncached GTT map.<br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 467ada5079b..272eb49867e 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -2460,7 +2460,7 @@ intel_miptree_map_raw(struct brw_context *brw, struct intel_mipmap_tree *mt)<br>
if (drm_intel_bo_references(brw-><a href="http://batch.bo" rel="noreferrer" target="_blank"><wbr>batch.bo</a>, bo))<br>
intel_batchbuffer_flush(brw);<br>
<br>
- if (mt->tiling != I915_TILING_NONE)<br>
+ if (mt->tiling != I915_TILING_NONE || mt->is_scanout)<br>
brw_bo_map_gtt(brw, bo, "miptree");<br>
else<br>
brw_bo_map(brw, bo, true, "miptree");<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div></div></div>