Lines Matching refs:screen
252 struct nvc0_screen *screen = nvc0_screen(pscreen); in nvc0_screen_destroy() local
254 if (screen->base.fence.current) { in nvc0_screen_destroy()
255 nouveau_fence_wait(screen->base.fence.current); in nvc0_screen_destroy()
256 nouveau_fence_ref(NULL, &screen->base.fence.current); in nvc0_screen_destroy()
258 if (screen->base.pushbuf) in nvc0_screen_destroy()
259 screen->base.pushbuf->user_priv = NULL; in nvc0_screen_destroy()
261 if (screen->blitctx) in nvc0_screen_destroy()
262 FREE(screen->blitctx); in nvc0_screen_destroy()
264 nouveau_bo_ref(NULL, &screen->text); in nvc0_screen_destroy()
265 nouveau_bo_ref(NULL, &screen->uniform_bo); in nvc0_screen_destroy()
266 nouveau_bo_ref(NULL, &screen->tls); in nvc0_screen_destroy()
267 nouveau_bo_ref(NULL, &screen->txc); in nvc0_screen_destroy()
268 nouveau_bo_ref(NULL, &screen->fence.bo); in nvc0_screen_destroy()
269 nouveau_bo_ref(NULL, &screen->poly_cache); in nvc0_screen_destroy()
271 nouveau_heap_destroy(&screen->lib_code); in nvc0_screen_destroy()
272 nouveau_heap_destroy(&screen->text_heap); in nvc0_screen_destroy()
274 if (screen->tic.entries) in nvc0_screen_destroy()
275 FREE(screen->tic.entries); in nvc0_screen_destroy()
277 nouveau_mm_destroy(screen->mm_VRAM_fe0); in nvc0_screen_destroy()
279 nouveau_object_del(&screen->eng3d); in nvc0_screen_destroy()
280 nouveau_object_del(&screen->eng2d); in nvc0_screen_destroy()
281 nouveau_object_del(&screen->m2mf); in nvc0_screen_destroy()
283 nouveau_screen_fini(&screen->base); in nvc0_screen_destroy()
285 FREE(screen); in nvc0_screen_destroy()
289 nvc0_graph_set_macro(struct nvc0_screen *screen, uint32_t m, unsigned pos, in nvc0_graph_set_macro() argument
292 struct nouveau_pushbuf *push = screen->base.pushbuf; in nvc0_graph_set_macro()
371 struct nvc0_screen *screen = nvc0_screen(pscreen); in nvc0_screen_fence_emit() local
372 struct nouveau_pushbuf *push = screen->base.pushbuf; in nvc0_screen_fence_emit()
375 *sequence = ++screen->base.fence.sequence; in nvc0_screen_fence_emit()
378 PUSH_DATAh(push, screen->fence.bo->offset); in nvc0_screen_fence_emit()
379 PUSH_DATA (push, screen->fence.bo->offset); in nvc0_screen_fence_emit()
388 struct nvc0_screen *screen = nvc0_screen(pscreen); in nvc0_screen_fence_update() local
389 return screen->fence.map[0]; in nvc0_screen_fence_update()
402 struct nvc0_screen *screen; in nvc0_screen_create() local
420 screen = CALLOC_STRUCT(nvc0_screen); in nvc0_screen_create()
421 if (!screen) in nvc0_screen_create()
423 pscreen = &screen->base.base; in nvc0_screen_create()
425 ret = nouveau_screen_init(&screen->base, dev); in nvc0_screen_create()
430 chan = screen->base.channel; in nvc0_screen_create()
431 push = screen->base.pushbuf; in nvc0_screen_create()
432 push->user_priv = screen; in nvc0_screen_create()
434 screen->base.vidmem_bindings |= PIPE_BIND_CONSTANT_BUFFER | in nvc0_screen_create()
436 screen->base.sysmem_bindings |= in nvc0_screen_create()
448 nouveau_screen_init_vdec(&screen->base); in nvc0_screen_create()
451 &screen->fence.bo); in nvc0_screen_create()
454 nouveau_bo_map(screen->fence.bo, 0, NULL); in nvc0_screen_create()
455 screen->fence.map = screen->fence.bo->map; in nvc0_screen_create()
456 screen->base.fence.emit = nvc0_screen_fence_emit; in nvc0_screen_create()
457 screen->base.fence.update = nvc0_screen_fence_update; in nvc0_screen_create()
468 &screen->m2mf); in nvc0_screen_create()
473 PUSH_DATA (push, screen->m2mf->oclass); in nvc0_screen_create()
474 if (screen->m2mf->oclass == NVE4_P2MF_CLASS) { in nvc0_screen_create()
480 &screen->eng2d); in nvc0_screen_create()
485 PUSH_DATA (push, screen->eng2d->oclass); in nvc0_screen_create()
498 PUSH_DATAh(push, screen->fence.bo->offset + 16); in nvc0_screen_create()
499 PUSH_DATA (push, screen->fence.bo->offset + 16); in nvc0_screen_create()
523 &screen->eng3d); in nvc0_screen_create()
526 screen->base.class_3d = obj_class; in nvc0_screen_create()
529 PUSH_DATA (push, screen->eng3d->oclass); in nvc0_screen_create()
559 if (screen->eng3d->oclass < NVE4_3D_CLASS) { in nvc0_screen_create()
570 if (screen->eng3d->oclass >= NVC1_3D_CLASS) { in nvc0_screen_create()
575 nvc0_magic_3d_init(push, screen->eng3d->oclass); in nvc0_screen_create()
578 &screen->text); in nvc0_screen_create()
585 nouveau_heap_init(&screen->text_heap, 0, (1 << 20) - 0x100); in nvc0_screen_create()
588 &screen->uniform_bo); in nvc0_screen_create()
597 PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (i << 9)); in nvc0_screen_create()
598 PUSH_DATA (push, screen->uniform_bo->offset + (5 << 16) + (i << 9)); in nvc0_screen_create()
601 if (screen->eng3d->oclass >= NVE4_3D_CLASS) { in nvc0_screen_create()
618 PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (6 << 9)); in nvc0_screen_create()
619 PUSH_DATA (push, screen->uniform_bo->offset + (5 << 16) + (6 << 9)); in nvc0_screen_create()
627 PUSH_DATAh(push, screen->uniform_bo->offset + (5 << 16) + (6 << 9)); in nvc0_screen_create()
628 PUSH_DATA (push, screen->uniform_bo->offset + (5 << 16) + (6 << 9)); in nvc0_screen_create()
631 if (screen->eng3d->oclass >= NVE4_3D_CLASS) in nvc0_screen_create()
632 screen->tls_size = 8 * 64; in nvc0_screen_create()
634 screen->tls_size = 16 * 48; in nvc0_screen_create()
635 screen->tls_size *= NVC0_CAP_MAX_PROGRAM_TEMPS * 16; in nvc0_screen_create()
636 screen->tls_size = align(screen->tls_size, 1 << 17); in nvc0_screen_create()
639 screen->tls_size, NULL, &screen->tls); in nvc0_screen_create()
644 PUSH_DATAh(push, screen->text->offset); in nvc0_screen_create()
645 PUSH_DATA (push, screen->text->offset); in nvc0_screen_create()
647 PUSH_DATAh(push, screen->tls->offset); in nvc0_screen_create()
648 PUSH_DATA (push, screen->tls->offset); in nvc0_screen_create()
649 PUSH_DATA (push, screen->tls_size >> 32); in nvc0_screen_create()
650 PUSH_DATA (push, screen->tls_size); in nvc0_screen_create()
657 &screen->poly_cache); in nvc0_screen_create()
662 PUSH_DATAh(push, screen->poly_cache->offset); in nvc0_screen_create()
663 PUSH_DATA (push, screen->poly_cache->offset); in nvc0_screen_create()
667 &screen->txc); in nvc0_screen_create()
672 PUSH_DATAh(push, screen->txc->offset); in nvc0_screen_create()
673 PUSH_DATA (push, screen->txc->offset); in nvc0_screen_create()
677 PUSH_DATAh(push, screen->txc->offset + 65536); in nvc0_screen_create()
678 PUSH_DATA (push, screen->txc->offset + 65536); in nvc0_screen_create()
719 #define MK_MACRO(m, n) i = nvc0_graph_set_macro(screen, m, i, sizeof(n), n); in nvc0_screen_create()
756 screen->tic.entries = CALLOC(4096, sizeof(void *)); in nvc0_screen_create()
757 screen->tsc.entries = screen->tic.entries + 2048; in nvc0_screen_create()
761 screen->mm_VRAM_fe0 = nouveau_mm_create(dev, NOUVEAU_BO_VRAM, &mm_config); in nvc0_screen_create()
763 if (!nvc0_blitctx_create(screen)) in nvc0_screen_create()
766 nouveau_fence_new(&screen->base, &screen->base.fence.current, FALSE); in nvc0_screen_create()
776 nvc0_screen_tic_alloc(struct nvc0_screen *screen, void *entry) in nvc0_screen_tic_alloc() argument
778 int i = screen->tic.next; in nvc0_screen_tic_alloc()
780 while (screen->tic.lock[i / 32] & (1 << (i % 32))) in nvc0_screen_tic_alloc()
783 screen->tic.next = (i + 1) & (NVC0_TIC_MAX_ENTRIES - 1); in nvc0_screen_tic_alloc()
785 if (screen->tic.entries[i]) in nvc0_screen_tic_alloc()
786 nv50_tic_entry(screen->tic.entries[i])->id = -1; in nvc0_screen_tic_alloc()
788 screen->tic.entries[i] = entry; in nvc0_screen_tic_alloc()
793 nvc0_screen_tsc_alloc(struct nvc0_screen *screen, void *entry) in nvc0_screen_tsc_alloc() argument
795 int i = screen->tsc.next; in nvc0_screen_tsc_alloc()
797 while (screen->tsc.lock[i / 32] & (1 << (i % 32))) in nvc0_screen_tsc_alloc()
800 screen->tsc.next = (i + 1) & (NVC0_TSC_MAX_ENTRIES - 1); in nvc0_screen_tsc_alloc()
802 if (screen->tsc.entries[i]) in nvc0_screen_tsc_alloc()
803 nv50_tsc_entry(screen->tsc.entries[i])->id = -1; in nvc0_screen_tsc_alloc()
805 screen->tsc.entries[i] = entry; in nvc0_screen_tsc_alloc()