static void nv50_sp_state_delete(struct pipe_context *pipe, void *hwcso) { struct nv50_program *prog = (struct nv50_program *)hwcso; nv50_program_destroy(nv50_context(pipe), prog); FREE((void *)prog->pipe.tokens); FREE(prog); }
static void nv50_gp_state_delete(struct pipe_context *pipe, void *hwcso) { struct nv50_context *nv50 = nv50_context(pipe); struct nv50_program *p = hwcso; nv50_program_destroy(nv50, p); FREE((void *)p->pipe.tokens); FREE(p); }
static void nv50_screen_destroy(struct pipe_screen *pscreen) { struct nv50_screen *screen = nv50_screen(pscreen); if (!nouveau_drm_screen_unref(&screen->base)) return; if (screen->base.fence.current) { struct nouveau_fence *current = NULL; /* nouveau_fence_wait will create a new current fence, so wait on the * _current_ one, and remove both. */ nouveau_fence_ref(screen->base.fence.current, ¤t); nouveau_fence_wait(current, NULL); nouveau_fence_ref(NULL, ¤t); nouveau_fence_ref(NULL, &screen->base.fence.current); } if (screen->base.pushbuf) screen->base.pushbuf->user_priv = NULL; if (screen->blitter) nv50_blitter_destroy(screen); if (screen->pm.prog) { screen->pm.prog->code = NULL; /* hardcoded, don't FREE */ nv50_program_destroy(NULL, screen->pm.prog); FREE(screen->pm.prog); } nouveau_bo_ref(NULL, &screen->code); nouveau_bo_ref(NULL, &screen->tls_bo); nouveau_bo_ref(NULL, &screen->stack_bo); nouveau_bo_ref(NULL, &screen->txc); nouveau_bo_ref(NULL, &screen->uniforms); nouveau_bo_ref(NULL, &screen->fence.bo); nouveau_heap_destroy(&screen->vp_code_heap); nouveau_heap_destroy(&screen->gp_code_heap); nouveau_heap_destroy(&screen->fp_code_heap); FREE(screen->tic.entries); nouveau_object_del(&screen->tesla); nouveau_object_del(&screen->eng2d); nouveau_object_del(&screen->m2mf); nouveau_object_del(&screen->compute); nouveau_object_del(&screen->sync); nouveau_screen_fini(&screen->base); FREE(screen); }