From d960284e447df9b1563deef0ce950617decfba63 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 13 Jun 2016 14:56:22 -0700 Subject: 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: Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_vs.c') diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index abf03b1..d929f9b 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -208,11 +208,9 @@ brw_codegen_vs_prog(struct brw_context *brw, } /* Scratch space is used for register spilling */ - if (prog_data.base.base.total_scratch) { - brw_get_scratch_bo(brw, &brw->vs.base.scratch_bo, - prog_data.base.base.total_scratch * - brw->max_vs_threads); - } + brw_alloc_stage_scratch(brw, &brw->vs.base, + prog_data.base.base.total_scratch, + brw->max_vs_threads); brw_upload_cache(&brw->cache, BRW_CACHE_VS_PROG, key, sizeof(struct brw_vs_prog_key), -- cgit v1.1