summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-08-01 17:06:10 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-08-13 00:46:55 +0100
commitb3121bfd413973f460e2cc9a9f852bdfa1265fcf (patch)
tree9f08d6c5df15cfcd3629c6a83f1a8bc952ff1b7e /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parent07f583186dd4c5a92f6382c4c232a6a96bd049a6 (diff)
downloadexternal_mesa3d-b3121bfd413973f460e2cc9a9f852bdfa1265fcf.zip
external_mesa3d-b3121bfd413973f460e2cc9a9f852bdfa1265fcf.tar.gz
external_mesa3d-b3121bfd413973f460e2cc9a9f852bdfa1265fcf.tar.bz2
mesa: guard better when building with sse4.1 optimisations
When the compiler is not capable/does not accept -msse4.1 while the target has the instruction set we'll blow up as _mesa_streaming_load_memcpy is going to be undefined. To make sure that never happens, wrap the runtime cpu check+caller in an ifdef thus do not compile that hunk of the code. Fix the android build by enabling the optimisation and adding the define where applicable. v2: autoconf conditionals end with "fi" rather than endif. v3: Wrap the definition and call to intel_miptree_{un,}map_movntdqa in if defined(USE_SSE41). Spotted by Matt. Cc: Matt Turner <mattst88@gmail.com> Cc: Adrian Negreanu <adrian.m.negreanu@intel.com> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 38396d7..84a6718 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1843,6 +1843,7 @@ intel_miptree_unmap_blit(struct brw_context *brw,
/**
* "Map" a buffer by copying it to an untiled temporary using MOVNTDQA.
*/
+#if defined(USE_SSE41)
static void
intel_miptree_map_movntdqa(struct brw_context *brw,
struct intel_mipmap_tree *mt,
@@ -1910,6 +1911,7 @@ intel_miptree_unmap_movntdqa(struct brw_context *brw,
map->buffer = NULL;
map->ptr = NULL;
}
+#endif
static void
intel_miptree_map_s8(struct brw_context *brw,
@@ -2290,8 +2292,10 @@ intel_miptree_map(struct brw_context *brw,
mt->bo->size >= brw->max_gtt_map_object_size) {
assert(can_blit_slice(mt, level, slice));
intel_miptree_map_blit(brw, mt, map, level, slice);
+#if defined(USE_SSE41)
} else if (!(mode & GL_MAP_WRITE_BIT) && !mt->compressed && cpu_has_sse4_1) {
intel_miptree_map_movntdqa(brw, mt, map, level, slice);
+#endif
} else {
intel_miptree_map_gtt(brw, mt, map, level, slice);
}
@@ -2328,8 +2332,10 @@ intel_miptree_unmap(struct brw_context *brw,
intel_miptree_unmap_depthstencil(brw, mt, map, level, slice);
} else if (map->mt) {
intel_miptree_unmap_blit(brw, mt, map, level, slice);
+#if defined(USE_SSE41)
} else if (map->buffer && cpu_has_sse4_1) {
intel_miptree_unmap_movntdqa(brw, mt, map, level, slice);
+#endif
} else {
intel_miptree_unmap_gtt(brw, mt, map, level, slice);
}