]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: Fix up io_mem_reserve / io_mem_free calling
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 11 Nov 2010 08:41:57 +0000 (09:41 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 22 Nov 2010 03:25:22 +0000 (13:25 +1000)
commit64c92b84e3b155c88c1d2f1d5e3c3e2f705bd418
tree695b9a43d558a2870b23d6813f60387d7d61c614
parent04b806c16c5e50a53f383a603056ad56f0c85430
drm/ttm: Fix up io_mem_reserve / io_mem_free calling

This patch attempts to fix up shortcomings with the current calling
sequences.

1) There's a fastpath where no locking occurs and only io_mem_reserved is
   called to obtain needed info for mapping. The fastpath is set per
   memory type manager.
2) If the fastpath is disabled, io_mem_reserve and io_mem_free will be exactly
   balanced and not called recursively for the same struct ttm_mem_reg.
3) Optionally the driver can choose to enable a per memory type manager LRU
   eviction mechanism that, when io_mem_reserve returns -EAGAIN will attempt
   to kill user-space mappings of memory in that manager to free up needed
   resources

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_bo_vm.c
include/drm/ttm/ttm_bo_api.h
include/drm/ttm/ttm_bo_driver.h