aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-04-07 06:21:19 -0400
committerDave Airlie <airlied@redhat.com>2010-04-07 20:21:19 -0400
commit9d87fa2138d06ff400551800d67d522625033e35 (patch)
tree284cd0f73ccb2f2fad1c71f974d4e9e4d0035e81 /include/drm
parent3a89b4a9ca7ce11e3b7d5119aea917b9fc29a302 (diff)
drm/ttm: split no_wait argument in 2 GPU or reserve wait
There is case where we want to be able to wait only for the GPU while not waiting for other buffer to be unreserved. This patch split the no_wait argument all the way down in the whole ttm path so that upper level can decide on what to wait on or not. [airlied: squashed these 4 for bisectability reasons.] drm/radeon/kms: update to TTM no_wait splitted argument drm/nouveau: update to TTM no_wait splitted argument drm/vmwgfx: update to TTM no_wait splitted argument [vmwgfx patch: Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>] Signed-off-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/ttm/ttm_bo_api.h6
-rw-r--r--include/drm/ttm/ttm_bo_driver.h29
2 files changed, 22 insertions, 13 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 81eb9f45883c..8c8005ec4eaf 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -313,7 +313,8 @@ extern int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy,
313 * @bo: The buffer object. 313 * @bo: The buffer object.
314 * @placement: Proposed placement for the buffer object. 314 * @placement: Proposed placement for the buffer object.
315 * @interruptible: Sleep interruptible if sleeping. 315 * @interruptible: Sleep interruptible if sleeping.
316 * @no_wait: Return immediately if the buffer is busy. 316 * @no_wait_reserve: Return immediately if other buffers are busy.
317 * @no_wait_gpu: Return immediately if the GPU is busy.
317 * 318 *
318 * Changes placement and caching policy of the buffer object 319 * Changes placement and caching policy of the buffer object
319 * according proposed placement. 320 * according proposed placement.
@@ -325,7 +326,8 @@ extern int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy,
325 */ 326 */
326extern int ttm_bo_validate(struct ttm_buffer_object *bo, 327extern int ttm_bo_validate(struct ttm_buffer_object *bo,
327 struct ttm_placement *placement, 328 struct ttm_placement *placement,
328 bool interruptible, bool no_wait); 329 bool interruptible, bool no_wait_reserve,
330 bool no_wait_gpu);
329 331
330/** 332/**
331 * ttm_bo_unref 333 * ttm_bo_unref
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e929c27ede22..69f70e418c2c 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -311,7 +311,8 @@ struct ttm_bo_driver {
311 */ 311 */
312 int (*move) (struct ttm_buffer_object *bo, 312 int (*move) (struct ttm_buffer_object *bo,
313 bool evict, bool interruptible, 313 bool evict, bool interruptible,
314 bool no_wait, struct ttm_mem_reg *new_mem); 314 bool no_wait_reserve, bool no_wait_gpu,
315 struct ttm_mem_reg *new_mem);
315 316
316 /** 317 /**
317 * struct ttm_bo_driver_member verify_access 318 * struct ttm_bo_driver_member verify_access
@@ -633,7 +634,8 @@ extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev,
633 * @proposed_placement: Proposed new placement for the buffer object. 634 * @proposed_placement: Proposed new placement for the buffer object.
634 * @mem: A struct ttm_mem_reg. 635 * @mem: A struct ttm_mem_reg.
635 * @interruptible: Sleep interruptible when sliping. 636 * @interruptible: Sleep interruptible when sliping.
636 * @no_wait: Don't sleep waiting for space to become available. 637 * @no_wait_reserve: Return immediately if other buffers are busy.
638 * @no_wait_gpu: Return immediately if the GPU is busy.
637 * 639 *
638 * Allocate memory space for the buffer object pointed to by @bo, using 640 * Allocate memory space for the buffer object pointed to by @bo, using
639 * the placement flags in @mem, potentially evicting other idle buffer objects. 641 * the placement flags in @mem, potentially evicting other idle buffer objects.
@@ -647,7 +649,8 @@ extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev,
647extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, 649extern int ttm_bo_mem_space(struct ttm_buffer_object *bo,
648 struct ttm_placement *placement, 650 struct ttm_placement *placement,
649 struct ttm_mem_reg *mem, 651 struct ttm_mem_reg *mem,
650 bool interruptible, bool no_wait); 652 bool interruptible,
653 bool no_wait_reserve, bool no_wait_gpu);
651/** 654/**
652 * ttm_bo_wait_for_cpu 655 * ttm_bo_wait_for_cpu
653 * 656 *
@@ -826,7 +829,8 @@ extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo);
826 * 829 *
827 * @bo: A pointer to a struct ttm_buffer_object. 830 * @bo: A pointer to a struct ttm_buffer_object.
828 * @evict: 1: This is an eviction. Don't try to pipeline. 831 * @evict: 1: This is an eviction. Don't try to pipeline.
829 * @no_wait: Never sleep, but rather return with -EBUSY. 832 * @no_wait_reserve: Return immediately if other buffers are busy.
833 * @no_wait_gpu: Return immediately if the GPU is busy.
830 * @new_mem: struct ttm_mem_reg indicating where to move. 834 * @new_mem: struct ttm_mem_reg indicating where to move.
831 * 835 *
832 * Optimized move function for a buffer object with both old and 836 * Optimized move function for a buffer object with both old and
@@ -840,15 +844,16 @@ extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo);
840 */ 844 */
841 845
842extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo, 846extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
843 bool evict, bool no_wait, 847 bool evict, bool no_wait_reserve,
844 struct ttm_mem_reg *new_mem); 848 bool no_wait_gpu, struct ttm_mem_reg *new_mem);
845 849
846/** 850/**
847 * ttm_bo_move_memcpy 851 * ttm_bo_move_memcpy
848 * 852 *
849 * @bo: A pointer to a struct ttm_buffer_object. 853 * @bo: A pointer to a struct ttm_buffer_object.
850 * @evict: 1: This is an eviction. Don't try to pipeline. 854 * @evict: 1: This is an eviction. Don't try to pipeline.
851 * @no_wait: Never sleep, but rather return with -EBUSY. 855 * @no_wait_reserve: Return immediately if other buffers are busy.
856 * @no_wait_gpu: Return immediately if the GPU is busy.
852 * @new_mem: struct ttm_mem_reg indicating where to move. 857 * @new_mem: struct ttm_mem_reg indicating where to move.
853 * 858 *
854 * Fallback move function for a mappable buffer object in mappable memory. 859 * Fallback move function for a mappable buffer object in mappable memory.
@@ -862,8 +867,8 @@ extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
862 */ 867 */
863 868
864extern int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, 869extern int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
865 bool evict, 870 bool evict, bool no_wait_reserve,
866 bool no_wait, struct ttm_mem_reg *new_mem); 871 bool no_wait_gpu, struct ttm_mem_reg *new_mem);
867 872
868/** 873/**
869 * ttm_bo_free_old_node 874 * ttm_bo_free_old_node
@@ -882,7 +887,8 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
882 * @sync_obj_arg: An argument to pass to the sync object idle / wait 887 * @sync_obj_arg: An argument to pass to the sync object idle / wait
883 * functions. 888 * functions.
884 * @evict: This is an evict move. Don't return until the buffer is idle. 889 * @evict: This is an evict move. Don't return until the buffer is idle.
885 * @no_wait: Never sleep, but rather return with -EBUSY. 890 * @no_wait_reserve: Return immediately if other buffers are busy.
891 * @no_wait_gpu: Return immediately if the GPU is busy.
886 * @new_mem: struct ttm_mem_reg indicating where to move. 892 * @new_mem: struct ttm_mem_reg indicating where to move.
887 * 893 *
888 * Accelerated move function to be called when an accelerated move 894 * Accelerated move function to be called when an accelerated move
@@ -896,7 +902,8 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
896extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, 902extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
897 void *sync_obj, 903 void *sync_obj,
898 void *sync_obj_arg, 904 void *sync_obj_arg,
899 bool evict, bool no_wait, 905 bool evict, bool no_wait_reserve,
906 bool no_wait_gpu,
900 struct ttm_mem_reg *new_mem); 907 struct ttm_mem_reg *new_mem);
901/** 908/**
902 * ttm_io_prot 909 * ttm_io_prot