Lines Matching refs:nv50

60    struct nv50_context *nv50 = nv50_context(pipe);  in nv50_memory_barrier()  local
61 struct nouveau_pushbuf *push = nv50->base.pushbuf; in nv50_memory_barrier()
65 for (i = 0; i < nv50->num_vtxbufs; ++i) { in nv50_memory_barrier()
66 if (!nv50->vtxbuf[i].buffer.resource && !nv50->vtxbuf[i].is_user_buffer) in nv50_memory_barrier()
68 if (nv50->vtxbuf[i].buffer.resource->flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT) in nv50_memory_barrier()
69 nv50->base.vbo_dirty = true; in nv50_memory_barrier()
72 for (s = 0; s < NV50_MAX_3D_SHADER_STAGES && !nv50->cb_dirty; ++s) { in nv50_memory_barrier()
73 uint32_t valid = nv50->constbuf_valid[s]; in nv50_memory_barrier()
75 while (valid && !nv50->cb_dirty) { in nv50_memory_barrier()
80 if (nv50->constbuf[s][i].user) in nv50_memory_barrier()
83 res = nv50->constbuf[s][i].u.buf; in nv50_memory_barrier()
88 nv50->cb_dirty = true; in nv50_memory_barrier()
105 nv50->cb_dirty = true; in nv50_memory_barrier()
107 nv50->base.vbo_dirty = true; in nv50_memory_barrier()
148 nv50_context_unreference_resources(struct nv50_context *nv50) in nv50_context_unreference_resources() argument
152 nouveau_bufctx_del(&nv50->bufctx_3d); in nv50_context_unreference_resources()
153 nouveau_bufctx_del(&nv50->bufctx); in nv50_context_unreference_resources()
154 nouveau_bufctx_del(&nv50->bufctx_cp); in nv50_context_unreference_resources()
156 util_unreference_framebuffer_state(&nv50->framebuffer); in nv50_context_unreference_resources()
158 assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS); in nv50_context_unreference_resources()
159 for (i = 0; i < nv50->num_vtxbufs; ++i) in nv50_context_unreference_resources()
160 pipe_vertex_buffer_unreference(&nv50->vtxbuf[i]); in nv50_context_unreference_resources()
163 assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS); in nv50_context_unreference_resources()
164 for (i = 0; i < nv50->num_textures[s]; ++i) in nv50_context_unreference_resources()
165 pipe_sampler_view_reference(&nv50->textures[s][i], NULL); in nv50_context_unreference_resources()
168 if (!nv50->constbuf[s][i].user) in nv50_context_unreference_resources()
169 pipe_resource_reference(&nv50->constbuf[s][i].u.buf, NULL); in nv50_context_unreference_resources()
172 for (i = 0; i < nv50->global_residents.size / sizeof(struct pipe_resource *); in nv50_context_unreference_resources()
175 &nv50->global_residents, struct pipe_resource *, i); in nv50_context_unreference_resources()
178 util_dynarray_fini(&nv50->global_residents); in nv50_context_unreference_resources()
184 struct nv50_context *nv50 = nv50_context(pipe); in nv50_destroy() local
186 if (nv50->screen->cur_ctx == nv50) { in nv50_destroy()
187 nv50->screen->cur_ctx = NULL; in nv50_destroy()
189 nv50->screen->save_state = nv50->state; in nv50_destroy()
192 if (nv50->base.pipe.stream_uploader) in nv50_destroy()
193 u_upload_destroy(nv50->base.pipe.stream_uploader); in nv50_destroy()
195 nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL); in nv50_destroy()
196 nouveau_pushbuf_kick(nv50->base.pushbuf, nv50->base.pushbuf->channel); in nv50_destroy()
198 nv50_context_unreference_resources(nv50); in nv50_destroy()
200 FREE(nv50->blit); in nv50_destroy()
202 nouveau_context_destroy(&nv50->base); in nv50_destroy()
210 struct nv50_context *nv50 = nv50_context(&ctx->pipe); in nv50_invalidate_resource_storage() local
215 assert(nv50->framebuffer.nr_cbufs <= PIPE_MAX_COLOR_BUFS); in nv50_invalidate_resource_storage()
216 for (i = 0; i < nv50->framebuffer.nr_cbufs; ++i) { in nv50_invalidate_resource_storage()
217 if (nv50->framebuffer.cbufs[i] && in nv50_invalidate_resource_storage()
218 nv50->framebuffer.cbufs[i]->texture == res) { in nv50_invalidate_resource_storage()
219 nv50->dirty_3d |= NV50_NEW_3D_FRAMEBUFFER; in nv50_invalidate_resource_storage()
220 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_FB); in nv50_invalidate_resource_storage()
227 if (nv50->framebuffer.zsbuf && in nv50_invalidate_resource_storage()
228 nv50->framebuffer.zsbuf->texture == res) { in nv50_invalidate_resource_storage()
229 nv50->dirty_3d |= NV50_NEW_3D_FRAMEBUFFER; in nv50_invalidate_resource_storage()
230 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_FB); in nv50_invalidate_resource_storage()
242 assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS); in nv50_invalidate_resource_storage()
243 for (i = 0; i < nv50->num_vtxbufs; ++i) { in nv50_invalidate_resource_storage()
244 if (nv50->vtxbuf[i].buffer.resource == res) { in nv50_invalidate_resource_storage()
245 nv50->dirty_3d |= NV50_NEW_3D_ARRAYS; in nv50_invalidate_resource_storage()
246 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_VERTEX); in nv50_invalidate_resource_storage()
253 assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS); in nv50_invalidate_resource_storage()
254 for (i = 0; i < nv50->num_textures[s]; ++i) { in nv50_invalidate_resource_storage()
255 if (nv50->textures[s][i] && in nv50_invalidate_resource_storage()
256 nv50->textures[s][i]->texture == res) { in nv50_invalidate_resource_storage()
258 nv50->dirty_cp |= NV50_NEW_CP_TEXTURES; in nv50_invalidate_resource_storage()
259 nouveau_bufctx_reset(nv50->bufctx_cp, NV50_BIND_CP_TEXTURES); in nv50_invalidate_resource_storage()
261 nv50->dirty_3d |= NV50_NEW_3D_TEXTURES; in nv50_invalidate_resource_storage()
262 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_TEXTURES); in nv50_invalidate_resource_storage()
272 if (!(nv50->constbuf_valid[s] & (1 << i))) in nv50_invalidate_resource_storage()
274 if (!nv50->constbuf[s][i].user && in nv50_invalidate_resource_storage()
275 nv50->constbuf[s][i].u.buf == res) { in nv50_invalidate_resource_storage()
276 nv50->constbuf_dirty[s] |= 1 << i; in nv50_invalidate_resource_storage()
278 nv50->dirty_cp |= NV50_NEW_CP_CONSTBUF; in nv50_invalidate_resource_storage()
279 nouveau_bufctx_reset(nv50->bufctx_cp, NV50_BIND_CP_CB(i)); in nv50_invalidate_resource_storage()
281 nv50->dirty_3d |= NV50_NEW_3D_CONSTBUF; in nv50_invalidate_resource_storage()
282 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_CB(s, i)); in nv50_invalidate_resource_storage()
302 struct nv50_context *nv50; in nv50_create() local
307 nv50 = CALLOC_STRUCT(nv50_context); in nv50_create()
308 if (!nv50) in nv50_create()
310 pipe = &nv50->base.pipe; in nv50_create()
312 if (!nv50_blitctx_create(nv50)) in nv50_create()
315 nv50->base.pushbuf = screen->base.pushbuf; in nv50_create()
316 nv50->base.client = screen->base.client; in nv50_create()
318 ret = nouveau_bufctx_new(screen->base.client, 2, &nv50->bufctx); in nv50_create()
321 &nv50->bufctx_3d); in nv50_create()
324 &nv50->bufctx_cp); in nv50_create()
328 nv50->base.screen = &screen->base; in nv50_create()
329 nv50->base.copy_data = nv50_m2mf_copy_linear; in nv50_create()
330 nv50->base.push_data = nv50_sifc_linear_u8; in nv50_create()
331 nv50->base.push_cb = nv50_cb_push; in nv50_create()
333 nv50->screen = screen; in nv50_create()
357 nv50->state = screen->save_state; in nv50_create()
358 screen->cur_ctx = nv50; in nv50_create()
359 nouveau_pushbuf_bufctx(screen->base.pushbuf, nv50->bufctx); in nv50_create()
361 nv50->base.pushbuf->kick_notify = nv50_default_kick_notify; in nv50_create()
363 nouveau_context_init(&nv50->base); in nv50_create()
364 nv50_init_query_functions(nv50); in nv50_create()
365 nv50_init_surface_functions(nv50); in nv50_create()
366 nv50_init_state_functions(nv50); in nv50_create()
369 nv50->base.invalidate_resource_storage = nv50_invalidate_resource_storage; in nv50_create()
374 nouveau_context_init_vdec(&nv50->base); in nv50_create()
388 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->code); in nv50_create()
389 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->uniforms); in nv50_create()
390 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->txc); in nv50_create()
391 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->stack_bo); in nv50_create()
393 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->code); in nv50_create()
394 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->uniforms); in nv50_create()
395 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->txc); in nv50_create()
396 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->stack_bo); in nv50_create()
401 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->fence.bo); in nv50_create()
402 BCTX_REFN_bo(nv50->bufctx, FENCE, flags, screen->fence.bo); in nv50_create()
404 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->fence.bo); in nv50_create()
406 nv50->base.scratch.bo_size = 2 << 20; in nv50_create()
408 util_dynarray_init(&nv50->global_residents, NULL); in nv50_create()
413 nv50_upload_tsc0(nv50); in nv50_create()
417 nv50->dirty_3d |= NV50_NEW_3D_SAMPLERS; in nv50_create()
424 if (nv50->bufctx_3d) in nv50_create()
425 nouveau_bufctx_del(&nv50->bufctx_3d); in nv50_create()
426 if (nv50->bufctx_cp) in nv50_create()
427 nouveau_bufctx_del(&nv50->bufctx_cp); in nv50_create()
428 if (nv50->bufctx) in nv50_create()
429 nouveau_bufctx_del(&nv50->bufctx); in nv50_create()
430 FREE(nv50->blit); in nv50_create()
431 FREE(nv50); in nv50_create()