Lines Matching refs:screen
43 struct nouveau_screen *screen = nouveau_screen(pscreen); in nouveau_screen_get_name() local
44 return screen->chipset_name; in nouveau_screen_get_name()
84 nouveau_screen_fence_finish(struct pipe_screen *screen, in nouveau_screen_fence_finish() argument
155 nouveau_disk_cache_create(struct nouveau_screen *screen) in nouveau_disk_cache_create() argument
170 if (screen->prefer_nir) in nouveau_disk_cache_create()
175 screen->disk_shader_cache = in nouveau_disk_cache_create()
176 disk_cache_create(nouveau_screen_get_name(&screen->base), in nouveau_disk_cache_create()
191 nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) in nouveau_screen_init() argument
193 struct pipe_screen *pscreen = &screen->base; in nouveau_screen_init()
206 screen->prefer_nir = debug_get_bool_option("NV50_PROG_USE_NIR", false); in nouveau_screen_init()
208 screen->prefer_nir = true; in nouveau_screen_init()
210 screen->force_enable_cl = debug_get_bool_option("NOUVEAU_ENABLE_CL", false); in nouveau_screen_init()
211 if (screen->force_enable_cl) in nouveau_screen_init()
217 screen->drm = nouveau_drm(&dev->object); in nouveau_screen_init()
218 screen->device = dev; in nouveau_screen_init()
224 screen->refcount = -1; in nouveau_screen_init()
235 screen->has_svm = false; in nouveau_screen_init()
237 if (dev->chipset > 0x130 && screen->force_enable_cl && enable_svm) { in nouveau_screen_init()
250 screen->svm_cutout_size = in nouveau_screen_init()
253 size_t start = screen->svm_cutout_size; in nouveau_screen_init()
255 screen->svm_cutout = reserve_vma(start, screen->svm_cutout_size); in nouveau_screen_init()
256 if (!screen->svm_cutout) { in nouveau_screen_init()
257 start += screen->svm_cutout_size; in nouveau_screen_init()
262 .unmanaged_addr = (uintptr_t)screen->svm_cutout, in nouveau_screen_init()
263 .unmanaged_size = screen->svm_cutout_size, in nouveau_screen_init()
266 ret = drmCommandWrite(screen->drm->fd, DRM_NOUVEAU_SVM_INIT, in nouveau_screen_init()
268 screen->has_svm = !ret; in nouveau_screen_init()
269 if (!screen->has_svm) in nouveau_screen_init()
270 os_munmap(screen->svm_cutout, screen->svm_cutout_size); in nouveau_screen_init()
272 } while ((start + screen->svm_cutout_size) < BITFIELD64_MASK(limit_bit)); in nouveau_screen_init()
279 screen->tegra_sector_layout = true; in nouveau_screen_init()
283 screen->tegra_sector_layout = false; in nouveau_screen_init()
290 if (!screen->vram_domain) { in nouveau_screen_init()
292 screen->vram_domain = NOUVEAU_BO_VRAM; in nouveau_screen_init()
294 screen->vram_domain = NOUVEAU_BO_GART; in nouveau_screen_init()
298 data, size, &screen->channel); in nouveau_screen_init()
302 ret = nouveau_client_new(screen->device, &screen->client); in nouveau_screen_init()
305 ret = nouveau_pushbuf_new(screen->client, screen->channel, in nouveau_screen_init()
307 &screen->pushbuf); in nouveau_screen_init()
312 screen->cpu_gpu_time_delta = os_time_get(); in nouveau_screen_init()
316 screen->cpu_gpu_time_delta = time - screen->cpu_gpu_time_delta * 1000; in nouveau_screen_init()
318 snprintf(screen->chipset_name, sizeof(screen->chipset_name), "NV%02X", dev->chipset); in nouveau_screen_init()
329 nouveau_disk_cache_create(screen); in nouveau_screen_init()
331 screen->transfer_pushbuf_threshold = 192; in nouveau_screen_init()
332 screen->lowmem_bindings = PIPE_BIND_GLOBAL; /* gallium limit */ in nouveau_screen_init()
333 screen->vidmem_bindings = in nouveau_screen_init()
341 screen->sysmem_bindings = in nouveau_screen_init()
347 screen->mm_GART = nouveau_mm_create(dev, in nouveau_screen_init()
350 screen->mm_VRAM = nouveau_mm_create(dev, NOUVEAU_BO_VRAM, &mm_config); in nouveau_screen_init()
354 if (screen->svm_cutout) in nouveau_screen_init()
355 os_munmap(screen->svm_cutout, screen->svm_cutout_size); in nouveau_screen_init()
360 nouveau_screen_fini(struct nouveau_screen *screen) in nouveau_screen_fini() argument
362 int fd = screen->drm->fd; in nouveau_screen_fini()
364 if (screen->force_enable_cl) in nouveau_screen_fini()
366 if (screen->has_svm) in nouveau_screen_fini()
367 os_munmap(screen->svm_cutout, screen->svm_cutout_size); in nouveau_screen_fini()
369 nouveau_mm_destroy(screen->mm_GART); in nouveau_screen_fini()
370 nouveau_mm_destroy(screen->mm_VRAM); in nouveau_screen_fini()
372 nouveau_pushbuf_del(&screen->pushbuf); in nouveau_screen_fini()
374 nouveau_client_del(&screen->client); in nouveau_screen_fini()
375 nouveau_object_del(&screen->channel); in nouveau_screen_fini()
377 nouveau_device_del(&screen->device); in nouveau_screen_fini()
378 nouveau_drm_del(&screen->drm); in nouveau_screen_fini()
381 disk_cache_destroy(screen->disk_shader_cache); in nouveau_screen_fini()