radeon_object.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. /*
  2. * Copyright 2009 Jerome Glisse.
  3. * All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sub license, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  16. * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
  17. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  18. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  19. * USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. *
  21. * The above copyright notice and this permission notice (including the
  22. * next paragraph) shall be included in all copies or substantial portions
  23. * of the Software.
  24. *
  25. */
  26. /*
  27. * Authors:
  28. * Jerome Glisse <glisse@freedesktop.org>
  29. * Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
  30. * Dave Airlie
  31. */
  32. #include <linux/list.h>
  33. #include <drm/drmP.h>
  34. #include "radeon_drm.h"
  35. #include "radeon.h"
  36. struct radeon_object {
  37. struct ttm_buffer_object tobj;
  38. struct list_head list;
  39. struct radeon_device *rdev;
  40. struct drm_gem_object *gobj;
  41. struct ttm_bo_kmap_obj kmap;
  42. unsigned pin_count;
  43. uint64_t gpu_addr;
  44. void *kptr;
  45. bool is_iomem;
  46. uint32_t tiling_flags;
  47. uint32_t pitch;
  48. int surface_reg;
  49. };
  50. int radeon_ttm_init(struct radeon_device *rdev);
  51. void radeon_ttm_fini(struct radeon_device *rdev);
  52. /*
  53. * To exclude mutual BO access we rely on bo_reserve exclusion, as all
  54. * function are calling it.
  55. */
  56. static int radeon_object_reserve(struct radeon_object *robj, bool interruptible)
  57. {
  58. return ttm_bo_reserve(&robj->tobj, interruptible, false, false, 0);
  59. }
  60. static void radeon_object_unreserve(struct radeon_object *robj)
  61. {
  62. ttm_bo_unreserve(&robj->tobj);
  63. }
  64. static void radeon_ttm_object_object_destroy(struct ttm_buffer_object *tobj)
  65. {
  66. struct radeon_object *robj;
  67. robj = container_of(tobj, struct radeon_object, tobj);
  68. list_del_init(&robj->list);
  69. radeon_object_clear_surface_reg(robj);
  70. kfree(robj);
  71. }
  72. static inline void radeon_object_gpu_addr(struct radeon_object *robj)
  73. {
  74. /* Default gpu address */
  75. robj->gpu_addr = 0xFFFFFFFFFFFFFFFFULL;
  76. if (robj->tobj.mem.mm_node == NULL) {
  77. return;
  78. }
  79. robj->gpu_addr = ((u64)robj->tobj.mem.mm_node->start) << PAGE_SHIFT;
  80. switch (robj->tobj.mem.mem_type) {
  81. case TTM_PL_VRAM:
  82. robj->gpu_addr += (u64)robj->rdev->mc.vram_location;
  83. break;
  84. case TTM_PL_TT:
  85. robj->gpu_addr += (u64)robj->rdev->mc.gtt_location;
  86. break;
  87. default:
  88. DRM_ERROR("Unknown placement %d\n", robj->tobj.mem.mem_type);
  89. robj->gpu_addr = 0xFFFFFFFFFFFFFFFFULL;
  90. return;
  91. }
  92. }
  93. static inline uint32_t radeon_object_flags_from_domain(uint32_t domain)
  94. {
  95. uint32_t flags = 0;
  96. if (domain & RADEON_GEM_DOMAIN_VRAM) {
  97. flags |= TTM_PL_FLAG_VRAM | TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED;
  98. }
  99. if (domain & RADEON_GEM_DOMAIN_GTT) {
  100. flags |= TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING;
  101. }
  102. if (domain & RADEON_GEM_DOMAIN_CPU) {
  103. flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
  104. }
  105. if (!flags) {
  106. flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
  107. }
  108. return flags;
  109. }
  110. int radeon_object_create(struct radeon_device *rdev,
  111. struct drm_gem_object *gobj,
  112. unsigned long size,
  113. bool kernel,
  114. uint32_t domain,
  115. bool interruptible,
  116. struct radeon_object **robj_ptr)
  117. {
  118. struct radeon_object *robj;
  119. enum ttm_bo_type type;
  120. uint32_t flags;
  121. int r;
  122. if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) {
  123. rdev->mman.bdev.dev_mapping = rdev->ddev->dev_mapping;
  124. }
  125. if (kernel) {
  126. type = ttm_bo_type_kernel;
  127. } else {
  128. type = ttm_bo_type_device;
  129. }
  130. *robj_ptr = NULL;
  131. robj = kzalloc(sizeof(struct radeon_object), GFP_KERNEL);
  132. if (robj == NULL) {
  133. return -ENOMEM;
  134. }
  135. robj->rdev = rdev;
  136. robj->gobj = gobj;
  137. robj->surface_reg = -1;
  138. INIT_LIST_HEAD(&robj->list);
  139. flags = radeon_object_flags_from_domain(domain);
  140. r = ttm_buffer_object_init(&rdev->mman.bdev, &robj->tobj, size, type, flags,
  141. 0, 0, false, NULL, size,
  142. &radeon_ttm_object_object_destroy);
  143. if (unlikely(r != 0)) {
  144. /* ttm call radeon_ttm_object_object_destroy if error happen */
  145. DRM_ERROR("Failed to allocate TTM object (%ld, 0x%08X, %u)\n",
  146. size, flags, 0);
  147. return r;
  148. }
  149. *robj_ptr = robj;
  150. if (gobj) {
  151. list_add_tail(&robj->list, &rdev->gem.objects);
  152. }
  153. return 0;
  154. }
  155. int radeon_object_kmap(struct radeon_object *robj, void **ptr)
  156. {
  157. int r;
  158. spin_lock(&robj->tobj.lock);
  159. if (robj->kptr) {
  160. if (ptr) {
  161. *ptr = robj->kptr;
  162. }
  163. spin_unlock(&robj->tobj.lock);
  164. return 0;
  165. }
  166. spin_unlock(&robj->tobj.lock);
  167. r = ttm_bo_kmap(&robj->tobj, 0, robj->tobj.num_pages, &robj->kmap);
  168. if (r) {
  169. return r;
  170. }
  171. spin_lock(&robj->tobj.lock);
  172. robj->kptr = ttm_kmap_obj_virtual(&robj->kmap, &robj->is_iomem);
  173. spin_unlock(&robj->tobj.lock);
  174. if (ptr) {
  175. *ptr = robj->kptr;
  176. }
  177. return 0;
  178. }
  179. void radeon_object_kunmap(struct radeon_object *robj)
  180. {
  181. spin_lock(&robj->tobj.lock);
  182. if (robj->kptr == NULL) {
  183. spin_unlock(&robj->tobj.lock);
  184. return;
  185. }
  186. robj->kptr = NULL;
  187. spin_unlock(&robj->tobj.lock);
  188. ttm_bo_kunmap(&robj->kmap);
  189. }
  190. void radeon_object_unref(struct radeon_object **robj)
  191. {
  192. struct ttm_buffer_object *tobj;
  193. if ((*robj) == NULL) {
  194. return;
  195. }
  196. tobj = &((*robj)->tobj);
  197. ttm_bo_unref(&tobj);
  198. if (tobj == NULL) {
  199. *robj = NULL;
  200. }
  201. }
  202. int radeon_object_mmap(struct radeon_object *robj, uint64_t *offset)
  203. {
  204. *offset = robj->tobj.addr_space_offset;
  205. return 0;
  206. }
  207. int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
  208. uint64_t *gpu_addr)
  209. {
  210. uint32_t flags;
  211. uint32_t tmp;
  212. int r;
  213. flags = radeon_object_flags_from_domain(domain);
  214. spin_lock(&robj->tobj.lock);
  215. if (robj->pin_count) {
  216. robj->pin_count++;
  217. if (gpu_addr != NULL) {
  218. *gpu_addr = robj->gpu_addr;
  219. }
  220. spin_unlock(&robj->tobj.lock);
  221. return 0;
  222. }
  223. spin_unlock(&robj->tobj.lock);
  224. r = radeon_object_reserve(robj, false);
  225. if (unlikely(r != 0)) {
  226. DRM_ERROR("radeon: failed to reserve object for pinning it.\n");
  227. return r;
  228. }
  229. tmp = robj->tobj.mem.placement;
  230. ttm_flag_masked(&tmp, flags, TTM_PL_MASK_MEM);
  231. robj->tobj.proposed_placement = tmp | TTM_PL_FLAG_NO_EVICT | TTM_PL_MASK_CACHING;
  232. r = ttm_buffer_object_validate(&robj->tobj,
  233. robj->tobj.proposed_placement,
  234. false, false);
  235. radeon_object_gpu_addr(robj);
  236. if (gpu_addr != NULL) {
  237. *gpu_addr = robj->gpu_addr;
  238. }
  239. robj->pin_count = 1;
  240. if (unlikely(r != 0)) {
  241. DRM_ERROR("radeon: failed to pin object.\n");
  242. }
  243. radeon_object_unreserve(robj);
  244. return r;
  245. }
  246. void radeon_object_unpin(struct radeon_object *robj)
  247. {
  248. uint32_t flags;
  249. int r;
  250. spin_lock(&robj->tobj.lock);
  251. if (!robj->pin_count) {
  252. spin_unlock(&robj->tobj.lock);
  253. printk(KERN_WARNING "Unpin not necessary for %p !\n", robj);
  254. return;
  255. }
  256. robj->pin_count--;
  257. if (robj->pin_count) {
  258. spin_unlock(&robj->tobj.lock);
  259. return;
  260. }
  261. spin_unlock(&robj->tobj.lock);
  262. r = radeon_object_reserve(robj, false);
  263. if (unlikely(r != 0)) {
  264. DRM_ERROR("radeon: failed to reserve object for unpinning it.\n");
  265. return;
  266. }
  267. flags = robj->tobj.mem.placement;
  268. robj->tobj.proposed_placement = flags & ~TTM_PL_FLAG_NO_EVICT;
  269. r = ttm_buffer_object_validate(&robj->tobj,
  270. robj->tobj.proposed_placement,
  271. false, false);
  272. if (unlikely(r != 0)) {
  273. DRM_ERROR("radeon: failed to unpin buffer.\n");
  274. }
  275. radeon_object_unreserve(robj);
  276. }
  277. int radeon_object_wait(struct radeon_object *robj)
  278. {
  279. int r = 0;
  280. /* FIXME: should use block reservation instead */
  281. r = radeon_object_reserve(robj, true);
  282. if (unlikely(r != 0)) {
  283. DRM_ERROR("radeon: failed to reserve object for waiting.\n");
  284. return r;
  285. }
  286. spin_lock(&robj->tobj.lock);
  287. if (robj->tobj.sync_obj) {
  288. r = ttm_bo_wait(&robj->tobj, true, true, false);
  289. }
  290. spin_unlock(&robj->tobj.lock);
  291. radeon_object_unreserve(robj);
  292. return r;
  293. }
  294. int radeon_object_busy_domain(struct radeon_object *robj, uint32_t *cur_placement)
  295. {
  296. int r = 0;
  297. r = radeon_object_reserve(robj, true);
  298. if (unlikely(r != 0)) {
  299. DRM_ERROR("radeon: failed to reserve object for waiting.\n");
  300. return r;
  301. }
  302. spin_lock(&robj->tobj.lock);
  303. *cur_placement = robj->tobj.mem.mem_type;
  304. if (robj->tobj.sync_obj) {
  305. r = ttm_bo_wait(&robj->tobj, true, true, true);
  306. }
  307. spin_unlock(&robj->tobj.lock);
  308. radeon_object_unreserve(robj);
  309. return r;
  310. }
  311. int radeon_object_evict_vram(struct radeon_device *rdev)
  312. {
  313. if (rdev->flags & RADEON_IS_IGP) {
  314. /* Useless to evict on IGP chips */
  315. return 0;
  316. }
  317. return ttm_bo_evict_mm(&rdev->mman.bdev, TTM_PL_VRAM);
  318. }
  319. void radeon_object_force_delete(struct radeon_device *rdev)
  320. {
  321. struct radeon_object *robj, *n;
  322. struct drm_gem_object *gobj;
  323. if (list_empty(&rdev->gem.objects)) {
  324. return;
  325. }
  326. DRM_ERROR("Userspace still has active objects !\n");
  327. list_for_each_entry_safe(robj, n, &rdev->gem.objects, list) {
  328. mutex_lock(&rdev->ddev->struct_mutex);
  329. gobj = robj->gobj;
  330. DRM_ERROR("Force free for (%p,%p,%lu,%lu)\n",
  331. gobj, robj, (unsigned long)gobj->size,
  332. *((unsigned long *)&gobj->refcount));
  333. list_del_init(&robj->list);
  334. radeon_object_unref(&robj);
  335. gobj->driver_private = NULL;
  336. drm_gem_object_unreference(gobj);
  337. mutex_unlock(&rdev->ddev->struct_mutex);
  338. }
  339. }
  340. int radeon_object_init(struct radeon_device *rdev)
  341. {
  342. /* Add an MTRR for the VRAM */
  343. rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size,
  344. MTRR_TYPE_WRCOMB, 1);
  345. DRM_INFO("Detected VRAM RAM=%lluM, BAR=%lluM\n",
  346. rdev->mc.mc_vram_size >> 20,
  347. (unsigned long long)rdev->mc.aper_size >> 20);
  348. DRM_INFO("RAM width %dbits %cDR\n",
  349. rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
  350. return radeon_ttm_init(rdev);
  351. }
  352. void radeon_object_fini(struct radeon_device *rdev)
  353. {
  354. radeon_ttm_fini(rdev);
  355. }
  356. void radeon_object_list_add_object(struct radeon_object_list *lobj,
  357. struct list_head *head)
  358. {
  359. if (lobj->wdomain) {
  360. list_add(&lobj->list, head);
  361. } else {
  362. list_add_tail(&lobj->list, head);
  363. }
  364. }
  365. int radeon_object_list_reserve(struct list_head *head)
  366. {
  367. struct radeon_object_list *lobj;
  368. struct list_head *i;
  369. int r;
  370. list_for_each(i, head) {
  371. lobj = list_entry(i, struct radeon_object_list, list);
  372. if (!lobj->robj->pin_count) {
  373. r = radeon_object_reserve(lobj->robj, true);
  374. if (unlikely(r != 0)) {
  375. DRM_ERROR("radeon: failed to reserve object.\n");
  376. return r;
  377. }
  378. } else {
  379. }
  380. }
  381. return 0;
  382. }
  383. void radeon_object_list_unreserve(struct list_head *head)
  384. {
  385. struct radeon_object_list *lobj;
  386. struct list_head *i;
  387. list_for_each(i, head) {
  388. lobj = list_entry(i, struct radeon_object_list, list);
  389. if (!lobj->robj->pin_count) {
  390. radeon_object_unreserve(lobj->robj);
  391. } else {
  392. }
  393. }
  394. }
  395. int radeon_object_list_validate(struct list_head *head, void *fence)
  396. {
  397. struct radeon_object_list *lobj;
  398. struct radeon_object *robj;
  399. struct radeon_fence *old_fence = NULL;
  400. struct list_head *i;
  401. int r;
  402. r = radeon_object_list_reserve(head);
  403. if (unlikely(r != 0)) {
  404. radeon_object_list_unreserve(head);
  405. return r;
  406. }
  407. list_for_each(i, head) {
  408. lobj = list_entry(i, struct radeon_object_list, list);
  409. robj = lobj->robj;
  410. if (!robj->pin_count) {
  411. if (lobj->wdomain) {
  412. robj->tobj.proposed_placement =
  413. radeon_object_flags_from_domain(lobj->wdomain);
  414. } else {
  415. robj->tobj.proposed_placement =
  416. radeon_object_flags_from_domain(lobj->rdomain);
  417. }
  418. r = ttm_buffer_object_validate(&robj->tobj,
  419. robj->tobj.proposed_placement,
  420. true, false);
  421. if (unlikely(r)) {
  422. DRM_ERROR("radeon: failed to validate.\n");
  423. return r;
  424. }
  425. radeon_object_gpu_addr(robj);
  426. }
  427. lobj->gpu_offset = robj->gpu_addr;
  428. lobj->tiling_flags = robj->tiling_flags;
  429. if (fence) {
  430. old_fence = (struct radeon_fence *)robj->tobj.sync_obj;
  431. robj->tobj.sync_obj = radeon_fence_ref(fence);
  432. robj->tobj.sync_obj_arg = NULL;
  433. }
  434. if (old_fence) {
  435. radeon_fence_unref(&old_fence);
  436. }
  437. }
  438. return 0;
  439. }
  440. void radeon_object_list_unvalidate(struct list_head *head)
  441. {
  442. struct radeon_object_list *lobj;
  443. struct radeon_fence *old_fence = NULL;
  444. struct list_head *i;
  445. list_for_each(i, head) {
  446. lobj = list_entry(i, struct radeon_object_list, list);
  447. old_fence = (struct radeon_fence *)lobj->robj->tobj.sync_obj;
  448. lobj->robj->tobj.sync_obj = NULL;
  449. if (old_fence) {
  450. radeon_fence_unref(&old_fence);
  451. }
  452. }
  453. radeon_object_list_unreserve(head);
  454. }
  455. void radeon_object_list_clean(struct list_head *head)
  456. {
  457. radeon_object_list_unreserve(head);
  458. }
  459. int radeon_object_fbdev_mmap(struct radeon_object *robj,
  460. struct vm_area_struct *vma)
  461. {
  462. return ttm_fbdev_mmap(vma, &robj->tobj);
  463. }
  464. unsigned long radeon_object_size(struct radeon_object *robj)
  465. {
  466. return robj->tobj.num_pages << PAGE_SHIFT;
  467. }
  468. int radeon_object_get_surface_reg(struct radeon_object *robj)
  469. {
  470. struct radeon_device *rdev = robj->rdev;
  471. struct radeon_surface_reg *reg;
  472. struct radeon_object *old_object;
  473. int steal;
  474. int i;
  475. if (!robj->tiling_flags)
  476. return 0;
  477. if (robj->surface_reg >= 0) {
  478. reg = &rdev->surface_regs[robj->surface_reg];
  479. i = robj->surface_reg;
  480. goto out;
  481. }
  482. steal = -1;
  483. for (i = 0; i < RADEON_GEM_MAX_SURFACES; i++) {
  484. reg = &rdev->surface_regs[i];
  485. if (!reg->robj)
  486. break;
  487. old_object = reg->robj;
  488. if (old_object->pin_count == 0)
  489. steal = i;
  490. }
  491. /* if we are all out */
  492. if (i == RADEON_GEM_MAX_SURFACES) {
  493. if (steal == -1)
  494. return -ENOMEM;
  495. /* find someone with a surface reg and nuke their BO */
  496. reg = &rdev->surface_regs[steal];
  497. old_object = reg->robj;
  498. /* blow away the mapping */
  499. DRM_DEBUG("stealing surface reg %d from %p\n", steal, old_object);
  500. ttm_bo_unmap_virtual(&old_object->tobj);
  501. old_object->surface_reg = -1;
  502. i = steal;
  503. }
  504. robj->surface_reg = i;
  505. reg->robj = robj;
  506. out:
  507. radeon_set_surface_reg(rdev, i, robj->tiling_flags, robj->pitch,
  508. robj->tobj.mem.mm_node->start << PAGE_SHIFT,
  509. robj->tobj.num_pages << PAGE_SHIFT);
  510. return 0;
  511. }
  512. void radeon_object_clear_surface_reg(struct radeon_object *robj)
  513. {
  514. struct radeon_device *rdev = robj->rdev;
  515. struct radeon_surface_reg *reg;
  516. if (robj->surface_reg == -1)
  517. return;
  518. reg = &rdev->surface_regs[robj->surface_reg];
  519. radeon_clear_surface_reg(rdev, robj->surface_reg);
  520. reg->robj = NULL;
  521. robj->surface_reg = -1;
  522. }
  523. void radeon_object_set_tiling_flags(struct radeon_object *robj,
  524. uint32_t tiling_flags, uint32_t pitch)
  525. {
  526. robj->tiling_flags = tiling_flags;
  527. robj->pitch = pitch;
  528. }
  529. void radeon_object_get_tiling_flags(struct radeon_object *robj,
  530. uint32_t *tiling_flags,
  531. uint32_t *pitch)
  532. {
  533. if (tiling_flags)
  534. *tiling_flags = robj->tiling_flags;
  535. if (pitch)
  536. *pitch = robj->pitch;
  537. }
  538. int radeon_object_check_tiling(struct radeon_object *robj, bool has_moved,
  539. bool force_drop)
  540. {
  541. if (!(robj->tiling_flags & RADEON_TILING_SURFACE))
  542. return 0;
  543. if (force_drop) {
  544. radeon_object_clear_surface_reg(robj);
  545. return 0;
  546. }
  547. if (robj->tobj.mem.mem_type != TTM_PL_VRAM) {
  548. if (!has_moved)
  549. return 0;
  550. if (robj->surface_reg >= 0)
  551. radeon_object_clear_surface_reg(robj);
  552. return 0;
  553. }
  554. if ((robj->surface_reg >= 0) && !has_moved)
  555. return 0;
  556. return radeon_object_get_surface_reg(robj);
  557. }
  558. void radeon_bo_move_notify(struct ttm_buffer_object *bo,
  559. struct ttm_mem_reg *mem)
  560. {
  561. struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
  562. radeon_object_check_tiling(robj, 0, 1);
  563. }
  564. void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
  565. {
  566. struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
  567. radeon_object_check_tiling(robj, 0, 0);
  568. }