aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>2012-11-28 06:25:44 -0500
committerDave Airlie <airlied@redhat.com>2012-12-10 05:21:30 -0500
commit97a875cbdf89a4638eea57c2b456c7cc4e3e8b21 (patch)
tree286ff23a3f8e389ec4fa1a6f3b58cbee4fc8e9fe /drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
parente7ab20197be3ee5fd75441e1cff0c7cdfea5bf1a (diff)
drm/ttm: remove no_wait_reserve, v3
All items on the lru list are always reservable, so this is a stupid thing to keep. Not only that, it is used in a way which would guarantee deadlocks if it were ever to be set to block on reserve. This is a lot of churn, but mostly because of the removal of the argument which can be nested arbitrarily deeply in many places. No change of code in this patch except removal of the no_wait_reserve argument, the previous patch removed the use of no_wait_reserve. v2: - Warn if -EBUSY is returned on reservation, all objects on the list should be reservable. Adjusted patch slightly due to conflicts. v3: - Focus on no_wait_reserve removal only. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
index e88b0eb1a179..5fae06ad7e25 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
@@ -66,7 +66,7 @@ int vmw_dmabuf_to_placement(struct vmw_private *dev_priv,
66 if (unlikely(ret != 0)) 66 if (unlikely(ret != 0))
67 goto err; 67 goto err;
68 68
69 ret = ttm_bo_validate(bo, placement, interruptible, false, false); 69 ret = ttm_bo_validate(bo, placement, interruptible, false);
70 70
71 ttm_bo_unreserve(bo); 71 ttm_bo_unreserve(bo);
72 72
@@ -123,7 +123,7 @@ int vmw_dmabuf_to_vram_or_gmr(struct vmw_private *dev_priv,
123 else 123 else
124 placement = &vmw_vram_gmr_placement; 124 placement = &vmw_vram_gmr_placement;
125 125
126 ret = ttm_bo_validate(bo, placement, interruptible, false, false); 126 ret = ttm_bo_validate(bo, placement, interruptible, false);
127 if (likely(ret == 0) || ret == -ERESTARTSYS) 127 if (likely(ret == 0) || ret == -ERESTARTSYS)
128 goto err_unreserve; 128 goto err_unreserve;
129 129
@@ -138,7 +138,7 @@ int vmw_dmabuf_to_vram_or_gmr(struct vmw_private *dev_priv,
138 else 138 else
139 placement = &vmw_vram_placement; 139 placement = &vmw_vram_placement;
140 140
141 ret = ttm_bo_validate(bo, placement, interruptible, false, false); 141 ret = ttm_bo_validate(bo, placement, interruptible, false);
142 142
143err_unreserve: 143err_unreserve:
144 ttm_bo_unreserve(bo); 144 ttm_bo_unreserve(bo);
@@ -223,10 +223,9 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *dev_priv,
223 if (bo->mem.mem_type == TTM_PL_VRAM && 223 if (bo->mem.mem_type == TTM_PL_VRAM &&
224 bo->mem.start < bo->num_pages && 224 bo->mem.start < bo->num_pages &&
225 bo->mem.start > 0) 225 bo->mem.start > 0)
226 (void) ttm_bo_validate(bo, &vmw_sys_placement, false, 226 (void) ttm_bo_validate(bo, &vmw_sys_placement, false, false);
227 false, false);
228 227
229 ret = ttm_bo_validate(bo, &placement, interruptible, false, false); 228 ret = ttm_bo_validate(bo, &placement, interruptible, false);
230 229
231 /* For some reason we didn't up at the start of vram */ 230 /* For some reason we didn't up at the start of vram */
232 WARN_ON(ret == 0 && bo->offset != 0); 231 WARN_ON(ret == 0 && bo->offset != 0);
@@ -315,7 +314,7 @@ void vmw_bo_pin(struct ttm_buffer_object *bo, bool pin)
315 placement.num_placement = 1; 314 placement.num_placement = 1;
316 placement.placement = &pl_flags; 315 placement.placement = &pl_flags;
317 316
318 ret = ttm_bo_validate(bo, &placement, false, true, true); 317 ret = ttm_bo_validate(bo, &placement, false, true);
319 318
320 BUG_ON(ret != 0 || bo->mem.mem_type != old_mem_type); 319 BUG_ON(ret != 0 || bo->mem.mem_type != old_mem_type);
321} 320}