[Mesa-dev] [PATCH] r600g: Prevent SIGFPE when using r600_dma_copy_tile with large textures
Ahmed Allam
ahmabdabd at hotmail.com
Mon Feb 3 06:40:20 CET 2014
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73781
Signed-off-by: Ahmed Allam <ahmabdabd at hotmail.com>
---
src/gallium/drivers/r600/r600_state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index a0d527b..8690849 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -3095,7 +3095,8 @@ static boolean r600_dma_copy_tile(struct r600_context *rctx,
/* It's a r6xx/r7xx limitation, the blit must be on 8 boundary for number
* line in the blit. Compute max 8 line we can copy in the size limit
*/
- cheight = ((0x0000ffff << 2) / pitch) & 0xfffffff8;
+ cheight = ((0x0000ffff << 2) / pitch) > 0x00000008 ?
+ ((0x0000ffff << 2) / pitch) & 0xfffffff8 : ((0x0000ffff << 2) / pitch);
ncopy = (copy_height / cheight) + !!(copy_height % cheight);
r600_need_dma_space(rctx, ncopy * 7);
--
1.9.rc1
More information about the mesa-dev
mailing list