Commit 06597ce8 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Dave Airlie

drm/mgag200: inline reservations

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 37c5a525
...@@ -280,8 +280,24 @@ void mgag200_i2c_destroy(struct mga_i2c_chan *i2c); ...@@ -280,8 +280,24 @@ void mgag200_i2c_destroy(struct mga_i2c_chan *i2c);
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
void mgag200_ttm_placement(struct mgag200_bo *bo, int domain); void mgag200_ttm_placement(struct mgag200_bo *bo, int domain);
int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait); static inline int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait)
void mgag200_bo_unreserve(struct mgag200_bo *bo); {
int ret;
ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
if (ret) {
if (ret != -ERESTARTSYS && ret != -EBUSY)
DRM_ERROR("reserve failed %p\n", bo);
return ret;
}
return 0;
}
static inline void mgag200_bo_unreserve(struct mgag200_bo *bo)
{
ttm_bo_unreserve(&bo->bo);
}
int mgag200_bo_create(struct drm_device *dev, int size, int align, int mgag200_bo_create(struct drm_device *dev, int size, int align,
uint32_t flags, struct mgag200_bo **pastbo); uint32_t flags, struct mgag200_bo **pastbo);
int mgag200_mm_init(struct mga_device *mdev); int mgag200_mm_init(struct mga_device *mdev);
......
...@@ -303,24 +303,6 @@ void mgag200_ttm_placement(struct mgag200_bo *bo, int domain) ...@@ -303,24 +303,6 @@ void mgag200_ttm_placement(struct mgag200_bo *bo, int domain)
bo->placement.num_busy_placement = c; bo->placement.num_busy_placement = c;
} }
int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait)
{
int ret;
ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
if (ret) {
if (ret != -ERESTARTSYS && ret != -EBUSY)
DRM_ERROR("reserve failed %p %d\n", bo, ret);
return ret;
}
return 0;
}
void mgag200_bo_unreserve(struct mgag200_bo *bo)
{
ttm_bo_unreserve(&bo->bo);
}
int mgag200_bo_create(struct drm_device *dev, int size, int align, int mgag200_bo_create(struct drm_device *dev, int size, int align,
uint32_t flags, struct mgag200_bo **pmgabo) uint32_t flags, struct mgag200_bo **pmgabo)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment