From bff0272b4fbd0e786f77a0f5a9e4ad1eb6df893e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 25 Jul 2015 11:54:04 +0100 Subject: [PATCH] sna: Put the assert(!kgem->can_fence) back to where they were Still need to improve the handling of set_gpu_tiling() to mark up the unfenceable buffers better, but we can't more the asserts here as we don't have the kgem struct available. Fixes 2f1623daed94b98d3bae3c9ee8346e8de9afc33d with asserts enabled Reported-by: Sedat Dilek Signed-off-by: Chris Wilson --- src/sna/kgem.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 16f49ba2..dc54a534 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -5113,7 +5113,6 @@ static void __kgem_bo_make_scanout(struct kgem *kgem, static void set_gpu_tiling(struct kgem_bo *bo, int tiling, int pitch) { - assert(!kgem->can_fence); bo->tiling = tiling; bo->pitch = pitch; if (tiling && bo->map__gtt) { @@ -5301,8 +5300,10 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem, continue; if (!kgem_set_tiling(kgem, bo, tiling, pitch) && - !exact) + !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); + } } kgem_bo_remove_from_active(kgem, bo); @@ -5329,9 +5330,10 @@ large_inactive: continue; if (!kgem_set_tiling(kgem, bo, tiling, pitch)) { - if (kgem->gen >= 040 && !exact) + if (kgem->gen >= 040 && !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); - else + } else continue; } @@ -5477,8 +5479,10 @@ search_active: continue; if (!kgem_set_tiling(kgem, bo, tiling, pitch) && - !exact) + !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); + } } assert(bo->tiling == tiling); assert(bo->pitch >= pitch); @@ -5538,6 +5542,7 @@ search_active: if (!kgem_set_tiling(kgem, bo, tiling, pitch)) { if (kgem->gen >= 040 && !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); } else { kgem_bo_free(kgem, bo); @@ -5629,6 +5634,7 @@ search_inactive: if (!kgem_set_tiling(kgem, bo, tiling, pitch)) { if (kgem->gen >= 040 && !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); } else { kgem_bo_free(kgem, bo); @@ -5695,6 +5701,7 @@ search_inactive: if (!kgem_set_tiling(kgem, bo, tiling, pitch)) { if (kgem->gen >= 040 && !exact) { + assert(!kgem->can_fence); set_gpu_tiling(bo, tiling, pitch); } else { kgem_bo_free(kgem, bo);