summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_tcs.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-06-13 14:56:22 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-06-13 15:55:58 -0700
commitd960284e447df9b1563deef0ce950617decfba63 (patch)
tree60222b4182c52923d46d129b5f7d478ae81469ed /src/mesa/drivers/dri/i965/brw_tcs.c
parent013ae4a70aeb40dc74e53943824bff33dda109e1 (diff)
downloadexternal_mesa3d-d960284e447df9b1563deef0ce950617decfba63.zip
external_mesa3d-d960284e447df9b1563deef0ce950617decfba63.tar.gz
external_mesa3d-d960284e447df9b1563deef0ce950617decfba63.tar.bz2
i965: Keep track of the per-thread scratch allocation in brw_stage_state.
This will be used to find out what per-thread slot size a previously allocated scratch BO was used with in order to fix a hardware race condition without introducing additional stalls or memory allocations. Instead of calling brw_get_scratch_bo() manually from the various codegen functions, call a new helper function that keeps track of the per-thread scratch size and conditionally allocates a larger scratch BO. v2: Handle BO allocation manually instead of relying on brw_get_scratch_bo (Ken). Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_tcs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index 83fc157..7fc8eb4 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -294,11 +294,9 @@ brw_codegen_tcs_prog(struct brw_context *brw,
}
/* Scratch space is used for register spilling */
- if (prog_data.base.base.total_scratch) {
- brw_get_scratch_bo(brw, &stage_state->scratch_bo,
- prog_data.base.base.total_scratch *
- brw->max_hs_threads);
- }
+ brw_alloc_stage_scratch(brw, stage_state,
+ prog_data.base.base.total_scratch,
+ brw->max_hs_threads);
brw_upload_cache(&brw->cache, BRW_CACHE_TCS_PROG,
key, sizeof(*key),