Lines Matching refs:cirrus
50 static int cirrus_ttm_global_init(struct cirrus_device *cirrus) in cirrus_ttm_global_init() argument
55 global_ref = &cirrus->ttm.mem_global_ref; in cirrus_ttm_global_init()
67 cirrus->ttm.bo_global_ref.mem_glob = in cirrus_ttm_global_init()
68 cirrus->ttm.mem_global_ref.object; in cirrus_ttm_global_init()
69 global_ref = &cirrus->ttm.bo_global_ref.ref; in cirrus_ttm_global_init()
77 drm_global_item_unref(&cirrus->ttm.mem_global_ref); in cirrus_ttm_global_init()
84 cirrus_ttm_global_release(struct cirrus_device *cirrus) in cirrus_ttm_global_release() argument
86 if (cirrus->ttm.mem_global_ref.release == NULL) in cirrus_ttm_global_release()
89 drm_global_item_unref(&cirrus->ttm.bo_global_ref.ref); in cirrus_ttm_global_release()
90 drm_global_item_unref(&cirrus->ttm.mem_global_ref); in cirrus_ttm_global_release()
91 cirrus->ttm.mem_global_ref.release = NULL; in cirrus_ttm_global_release()
160 struct cirrus_device *cirrus = cirrus_bdev(bdev); in cirrus_ttm_io_mem_reserve() local
175 mem->bus.base = pci_resource_start(cirrus->dev->pdev, 0); in cirrus_ttm_io_mem_reserve()
250 int cirrus_mm_init(struct cirrus_device *cirrus) in cirrus_mm_init() argument
253 struct drm_device *dev = cirrus->dev; in cirrus_mm_init()
254 struct ttm_bo_device *bdev = &cirrus->ttm.bdev; in cirrus_mm_init()
256 ret = cirrus_ttm_global_init(cirrus); in cirrus_mm_init()
260 ret = ttm_bo_device_init(&cirrus->ttm.bdev, in cirrus_mm_init()
261 cirrus->ttm.bo_global_ref.ref.object, in cirrus_mm_init()
272 cirrus->mc.vram_size >> PAGE_SHIFT); in cirrus_mm_init()
281 cirrus->fb_mtrr = arch_phys_wc_add(pci_resource_start(dev->pdev, 0), in cirrus_mm_init()
284 cirrus->mm_inited = true; in cirrus_mm_init()
288 void cirrus_mm_fini(struct cirrus_device *cirrus) in cirrus_mm_fini() argument
290 struct drm_device *dev = cirrus->dev; in cirrus_mm_fini()
292 if (!cirrus->mm_inited) in cirrus_mm_fini()
295 ttm_bo_device_release(&cirrus->ttm.bdev); in cirrus_mm_fini()
297 cirrus_ttm_global_release(cirrus); in cirrus_mm_fini()
299 arch_phys_wc_del(cirrus->fb_mtrr); in cirrus_mm_fini()
300 cirrus->fb_mtrr = 0; in cirrus_mm_fini()
328 struct cirrus_device *cirrus = dev->dev_private; in cirrus_bo_create() local
343 cirrusbo->bo.bdev = &cirrus->ttm.bdev; in cirrus_bo_create()
347 acc_size = ttm_bo_dma_acc_size(&cirrus->ttm.bdev, size, in cirrus_bo_create()
350 ret = ttm_bo_init(&cirrus->ttm.bdev, &cirrusbo->bo, size, in cirrus_bo_create()
418 struct cirrus_device *cirrus; in cirrus_mmap() local
424 cirrus = file_priv->minor->dev->dev_private; in cirrus_mmap()
425 return ttm_bo_mmap(filp, vma, &cirrus->ttm.bdev); in cirrus_mmap()