]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: add cmdbuf suballocator
authorLucas Stach <l.stach@pengutronix.de>
Mon, 16 Jan 2017 16:29:57 +0000 (17:29 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 2 Feb 2017 09:30:37 +0000 (10:30 +0100)
commitf0d3f056df130ed9a7962452be86534b1f7db7bc
treee87ff31d2685fae6e2a5009d426f63abe3c3af85
parent2b97c3092e913ea5eb910e43e65d372a0a6ab5f6
drm/etnaviv: add cmdbuf suballocator

There are 3 big benefits to suballocating a single big DMA buffer
for command submission:

1. Avoid hammering CMA. The old way of allocating and freeing a DMA
   buffer for each submission was hitting some of the real slow
   pathes in CMA, as this allocator was not designed for a concurrent
   small buffers load.

2. Less TLB flushes on IOMMUv2. If a new command buffer is mapped into
   the GPU address space the MMU TLBs need to be flushed. By having
   one big buffer statically mapped to the GPU, a lot of those flushes
   can be avoided.

3. No funky workarounds for GC3000. The FE TLB flush on GC3000 isn't
   reliable. To work around that we tried to lay out the cmdbufs in
   the GPU address space in a way to avoid this issue. This hasn't
   always worked if the address space is crowded. A single statically
   mapped buffer avoids the erratum completely.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.c
drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
drivers/gpu/drm/etnaviv/etnaviv_gpu.h
drivers/gpu/drm/etnaviv/etnaviv_mmu.c
drivers/gpu/drm/etnaviv/etnaviv_mmu.h