From: Maarten Lankhorst Date: Thu, 27 Jun 2013 11:48:22 +0000 (+0200) Subject: drm/mgag200: inline reservations X-Git-Tag: Ubuntu-5.0.0-8.9~13364^2~44 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=06597ce8b4d300f82dae785f0c89a6eab785fd06;p=mirror_ubuntu-disco-kernel.git drm/mgag200: inline reservations Signed-off-by: Maarten Lankhorst Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index d9737ef2d9a2..12e2499d9352 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h @@ -280,8 +280,24 @@ void mgag200_i2c_destroy(struct mga_i2c_chan *i2c); #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) void mgag200_ttm_placement(struct mgag200_bo *bo, int domain); -int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait); -void mgag200_bo_unreserve(struct mgag200_bo *bo); +static inline 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\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, uint32_t flags, struct mgag200_bo **pastbo); int mgag200_mm_init(struct mga_device *mdev); diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c index 0004f7740b8e..3acb2b044c7b 100644 --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c @@ -303,24 +303,6 @@ void mgag200_ttm_placement(struct mgag200_bo *bo, int domain) 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, uint32_t flags, struct mgag200_bo **pmgabo) {