diff options
author | Maarten Lankhorst <m.b.lankhorst@gmail.com> | 2013-06-27 07:48:20 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-06-27 22:04:04 -0400 |
commit | 4094dc2a3b6c33ab88bffa6b37c0f91201fd04ab (patch) | |
tree | 579beb820fa9919ea2976264126c40de116b12e6 /drivers/gpu/drm/ast | |
parent | 5e338405119a80aa59e811626739122d1c15045d (diff) |
drm/ast: inline reservations
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r-- | drivers/gpu/drm/ast/ast_drv.h | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/ast/ast_ttm.c | 18 |
2 files changed, 18 insertions, 20 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 02e52d543e4b..622d4ae7eb9e 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h | |||
@@ -348,8 +348,24 @@ int ast_gem_create(struct drm_device *dev, | |||
348 | int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr); | 348 | int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr); |
349 | int ast_bo_unpin(struct ast_bo *bo); | 349 | int ast_bo_unpin(struct ast_bo *bo); |
350 | 350 | ||
351 | int ast_bo_reserve(struct ast_bo *bo, bool no_wait); | 351 | static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) |
352 | void ast_bo_unreserve(struct ast_bo *bo); | 352 | { |
353 | int ret; | ||
354 | |||
355 | ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); | ||
356 | if (ret) { | ||
357 | if (ret != -ERESTARTSYS && ret != -EBUSY) | ||
358 | DRM_ERROR("reserve failed %p\n", bo); | ||
359 | return ret; | ||
360 | } | ||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | static inline void ast_bo_unreserve(struct ast_bo *bo) | ||
365 | { | ||
366 | ttm_bo_unreserve(&bo->bo); | ||
367 | } | ||
368 | |||
353 | void ast_ttm_placement(struct ast_bo *bo, int domain); | 369 | void ast_ttm_placement(struct ast_bo *bo, int domain); |
354 | int ast_bo_push_sysram(struct ast_bo *bo); | 370 | int ast_bo_push_sysram(struct ast_bo *bo); |
355 | int ast_mmap(struct file *filp, struct vm_area_struct *vma); | 371 | int ast_mmap(struct file *filp, struct vm_area_struct *vma); |
diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c index a5a1a034033d..98d670825a1a 100644 --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c | |||
@@ -303,24 +303,6 @@ void ast_ttm_placement(struct ast_bo *bo, int domain) | |||
303 | bo->placement.num_busy_placement = c; | 303 | bo->placement.num_busy_placement = c; |
304 | } | 304 | } |
305 | 305 | ||
306 | int ast_bo_reserve(struct ast_bo *bo, bool no_wait) | ||
307 | { | ||
308 | int ret; | ||
309 | |||
310 | ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); | ||
311 | if (ret) { | ||
312 | if (ret != -ERESTARTSYS && ret != -EBUSY) | ||
313 | DRM_ERROR("reserve failed %p\n", bo); | ||
314 | return ret; | ||
315 | } | ||
316 | return 0; | ||
317 | } | ||
318 | |||
319 | void ast_bo_unreserve(struct ast_bo *bo) | ||
320 | { | ||
321 | ttm_bo_unreserve(&bo->bo); | ||
322 | } | ||
323 | |||
324 | int ast_bo_create(struct drm_device *dev, int size, int align, | 306 | int ast_bo_create(struct drm_device *dev, int size, int align, |
325 | uint32_t flags, struct ast_bo **pastbo) | 307 | uint32_t flags, struct ast_bo **pastbo) |
326 | { | 308 | { |