[Mesa-dev] [PATCH] i965: Use tex_mocs instead of rb_mocs for GL images.

Kenneth Graunke kenneth at whitecape.org
Tue Jul 19 02:08:46 UTC 2016

Fixes a 10-20% performance regression in OglCSDof caused by commit
5a8c89038abab0184ea72664ab390ec6ca58b4d6, which made images (in the
image load/store sense) use BDW_MOCS_PTE instead of BDW_MOCS_WB.

This seems sketchy, as the default PTE value is supposed to be
WB LLC eLLC, which is the same as our MOCS WB setting.  It's only
supposed to change when using a surface for display, which won't
ever happen for images.  Something may be wrong in the kernel...

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index d896789..87f8601 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1516,7 +1516,7 @@ update_image_surface(struct brw_context *brw,
             const int surf_index = surf_offset - &brw->wm.base.surf_offset[0];
             brw_emit_surface_state(brw, mt, &view,
-                                   surface_state_infos[brw->gen].rb_mocs, false,
+                                   surface_state_infos[brw->gen].tex_mocs, false,
                                    surf_offset, surf_index,
                                    access == GL_READ_ONLY ? 0 :

More information about the mesa-dev mailing list