summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-11-23 13:31:32 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-26 13:09:41 -0800
commitc0c3fa564bec749ef874f1b24523aa85f6cd088e (patch)
treea1802200ae053049eed8a71df754b8d55735b22f /src/mesa
parentec013f809b1502029a12b71175c2c7c0e3f8d806 (diff)
i965: Use __attribute__((flatten)) on fast tiled teximage code.
The fast tiled texture upload code does not compile with GCC 4.8's -Og optimization flag. memcpy() has the always_inline attribute set. This poses a problem, since {x,y}tile_copy_faster calls it indirectly via {x,y}tile_copy, and {x,y}tile_copy normally aren't inlined at -Og. Using __attribute__((flatten)) tells GCC to inline every function call inside the function, which I believe was the author's intent. Fix suggested by Alexander Monakov. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit ad542a10c5f2284c05036f1df8ce5b69bea66e50)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_subimage.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index 0384bcca696..75aaea3ea47 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -331,6 +331,12 @@ ytile_copy(
}
}
+#ifdef __GNUC__
+#define FLATTEN __attribute__((flatten))
+#else
+#define FLATTEN
+#endif
+
/**
* Copy texture data from linear to X tile layout, faster.
*
@@ -340,7 +346,7 @@ ytile_copy(
*
* \copydoc tile_copy_fn
*/
-static void
+static FLATTEN void
xtile_copy_faster(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
uint32_t y0, uint32_t y1,
char *dst, const char *src,
@@ -376,7 +382,7 @@ xtile_copy_faster(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
*
* \copydoc tile_copy_fn
*/
-static void
+static FLATTEN void
ytile_copy_faster(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
uint32_t y0, uint32_t y1,
char *dst, const char *src,