Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/cirrus: inline reservations

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Maarten Lankhorst and committed by
Dave Airlie
37c5a525 4094dc2a

+19 -20
+19 -2
drivers/gpu/drm/cirrus/cirrus_drv.h
··· 240 240 int cirrus_bo_create(struct drm_device *dev, int size, int align, 241 241 uint32_t flags, struct cirrus_bo **pcirrusbo); 242 242 int cirrus_mmap(struct file *filp, struct vm_area_struct *vma); 243 - int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait); 244 - void cirrus_bo_unreserve(struct cirrus_bo *bo); 243 + 244 + static inline int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) 245 + { 246 + int ret; 247 + 248 + ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); 249 + if (ret) { 250 + if (ret != -ERESTARTSYS && ret != -EBUSY) 251 + DRM_ERROR("reserve failed %p\n", bo); 252 + return ret; 253 + } 254 + return 0; 255 + } 256 + 257 + static inline void cirrus_bo_unreserve(struct cirrus_bo *bo) 258 + { 259 + ttm_bo_unreserve(&bo->bo); 260 + } 261 + 245 262 int cirrus_bo_push_sysram(struct cirrus_bo *bo); 246 263 int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); 247 264 #endif /* __CIRRUS_DRV_H__ */
-18
drivers/gpu/drm/cirrus/cirrus_ttm.c
··· 308 308 bo->placement.num_busy_placement = c; 309 309 } 310 310 311 - int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) 312 - { 313 - int ret; 314 - 315 - ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); 316 - if (ret) { 317 - if (ret != -ERESTARTSYS && ret != -EBUSY) 318 - DRM_ERROR("reserve failed %p\n", bo); 319 - return ret; 320 - } 321 - return 0; 322 - } 323 - 324 - void cirrus_bo_unreserve(struct cirrus_bo *bo) 325 - { 326 - ttm_bo_unreserve(&bo->bo); 327 - } 328 - 329 311 int cirrus_bo_create(struct drm_device *dev, int size, int align, 330 312 uint32_t flags, struct cirrus_bo **pcirrusbo) 331 313 {