From 051a18063df075536cb1ac0dc4dfc3c1306ab74e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 10 Dec 2011 22:45:25 +0000 Subject: sna: Implement a VMA cache A VMA cache appears unavoidable thanks to compiz and an excrutiatingly slow GTT pagefault, though it does look like it will be ineffectual during everyday usage. Compiz (and presumably other compositing managers) appears to be undoing all the pagefault minimisation as demonstrated on gen5 with large XPutImage. It also appears the CPU to memory bandwidth ratio plays a crucial role in determining whether going straight to GTT or through the CPU cache is a win - so no trivial heuristic. x11perf -putimage10 -putimage500 on i5-2467m: Before: bare: 1150,000 2,410 compiz: 438,000 2,670 After: bare: 1190,000 2,730 compiz: 437,000 2,690 UXA: bare: 658,000 2,670 compiz: 389,000 2,520 On i3-330m Before: bare: 537,000 1,080 compiz: 263,000 398 After: bare: 606,000 1,360 compiz: 203,000 985 UXA: bare: 294,000 1,070 compiz: 197,000 821 On pnv: Before: bare: 179,000 213 compiz: 106,000 123 After: bare: 181,000 246 compiz: 103,000 197 UXA: bare: 114,000 312 compiz: 75,700 191 Reported-by: Michael Larabel Signed-off-by: Chris Wilson --- src/sna/kgem_debug_gen4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sna/kgem_debug_gen4.c') diff --git a/src/sna/kgem_debug_gen4.c b/src/sna/kgem_debug_gen4.c index d736cbd9..0f91d29a 100644 --- a/src/sna/kgem_debug_gen4.c +++ b/src/sna/kgem_debug_gen4.c @@ -90,7 +90,7 @@ static void gen4_update_vertex_buffer(struct kgem *kgem, const uint32_t *data) i = data[0] >> 27; if (state.vb[i].current) - munmap(state.vb[i].base, state.vb[i].current->size); + kgem_bo_unmap(kgem, state.vb[i].current); state.vb[i].current = bo; state.vb[i].base = base; @@ -420,7 +420,7 @@ static void put_reloc(struct kgem *kgem, struct reloc *r) { if (r->bo != NULL) - munmap(r->base, r->bo->size); + kgem_bo_unmap(kgem, r->bo); } #endif @@ -697,7 +697,7 @@ static void finish_vertex_buffers(struct kgem *kgem) for (i = 0; i < ARRAY_SIZE(state.vb); i++) if (state.vb[i].current) - munmap(state.vb[i].base, state.vb[i].current->size); + kgem_bo_unmap(kgem, state.vb[i].current); } void kgem_gen4_finish_state(struct kgem *kgem) @@ -705,7 +705,7 @@ void kgem_gen4_finish_state(struct kgem *kgem) finish_vertex_buffers(kgem); if (state.dynamic_state.current) - munmap(state.dynamic_state.base, state.dynamic_state.current->size); + kgem_bo_unmap(kgem, state.dynamic_state.base); memset(&state, 0, sizeof(state)); } -- cgit v1.2.3