linux/drivers/gpu/drm/ttm
Marek Olšák dfadbbdb57 drm/ttm: add a way to bo_wait for either the last read or last write
Sometimes we want to know whether a buffer is busy and wait for it (bo_wait).
However, sometimes it would be more useful to be able to query whether
a buffer is busy and being either read or written, and wait until it's stopped
being either read or written. The point of this is to be able to avoid
unnecessary waiting, e.g. if a GPU has written something to a buffer and is now
reading that buffer, and a CPU wants to map that buffer for read, it needs to
only wait for the last write. If there were no write, there wouldn't be any
waiting needed.

This, or course, requires user space drivers to send read/write flags
with each relocation (like we have read/write domains in radeon, so we can
actually use those for something useful now).

Now how this patch works:

The read/write flags should passed to ttm_validate_buffer. TTM maintains
separate sync objects of the last read and write for each buffer, in addition
to the sync object of the last use of a buffer. ttm_bo_wait then operates
with one the sync objects.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-31 19:25:35 +01:00
..
Makefile drm/ttm: restructure to allow driver to plug in alternate memory manager 2010-10-05 10:01:20 +10:00
ttm_agp_backend.c ttm: Expand (*populate) to support an array of DMA addresses. 2011-01-27 16:07:58 -05:00
ttm_bo.c drm/ttm: add a way to bo_wait for either the last read or last write 2011-08-31 19:25:35 +01:00
ttm_bo_manager.c drm/ttm: Use private locks for the default bo range manager 2010-11-09 13:33:24 +10:00
ttm_bo_util.c drm/ttm: add a way to bo_wait for either the last read or last write 2011-08-31 19:25:35 +01:00
ttm_bo_vm.c drm/ttm: add a way to bo_wait for either the last read or last write 2011-08-31 19:25:35 +01:00
ttm_execbuf_util.c drm/ttm: add a way to bo_wait for either the last read or last write 2011-08-31 19:25:35 +01:00
ttm_lock.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ttm_memory.c Merge branch 'drm-ttm-pool' into drm-core-next 2010-04-20 13:12:28 +10:00
ttm_module.c drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00
ttm_object.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ttm_page_alloc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ttm_tt.c drm/ttm: use shmem_read_mapping_page 2011-06-27 18:00:13 -07:00