Home | History | Annotate | Download | only in nv50

Lines Matching defs:nv50

27 #include "nv50/nv50_context.h"
28 #include "nv50/nv50_screen.h"
29 #include "nv50/nv50_resource.h"
60 struct nv50_context *nv50 = nv50_context(pipe);
64 for (i = 0; i < nv50->num_vtxbufs; ++i) {
65 if (!nv50->vtxbuf[i].buffer.resource && !nv50->vtxbuf[i].is_user_buffer)
67 if (nv50->vtxbuf[i].buffer.resource->flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT)
68 nv50->base.vbo_dirty = true;
71 for (s = 0; s < 3 && !nv50->cb_dirty; ++s) {
72 uint32_t valid = nv50->constbuf_valid[s];
74 while (valid && !nv50->cb_dirty) {
79 if (nv50->constbuf[s][i].user)
82 res = nv50->constbuf[s][i].u.buf;
87 nv50->cb_dirty = true;
131 nv50_context_unreference_resources(struct nv50_context *nv50)
135 nouveau_bufctx_del(&nv50->bufctx_3d);
136 nouveau_bufctx_del(&nv50->bufctx);
137 nouveau_bufctx_del(&nv50->bufctx_cp);
139 util_unreference_framebuffer_state(&nv50->framebuffer);
141 assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
142 for (i = 0; i < nv50->num_vtxbufs; ++i)
143 pipe_vertex_buffer_unreference(&nv50->vtxbuf[i]);
146 assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS);
147 for (i = 0; i < nv50->num_textures[s]; ++i)
148 pipe_sampler_view_reference(&nv50->textures[s][i], NULL);
151 if (!nv50->constbuf[s][i].user)
152 pipe_resource_reference(&nv50->constbuf[s][i].u.buf, NULL);
155 for (i = 0; i < nv50->global_residents.size / sizeof(struct pipe_resource *);
158 &nv50->global_residents, struct pipe_resource *, i);
161 util_dynarray_fini(&nv50->global_residents);
167 struct nv50_context *nv50 = nv50_context(pipe);
169 if (nv50->screen->cur_ctx == nv50) {
170 nv50->screen->cur_ctx = NULL;
172 nv50->screen->save_state = nv50->state;
175 if (nv50->base.pipe.stream_uploader)
176 u_upload_destroy(nv50->base.pipe.stream_uploader);
178 nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL);
179 nouveau_pushbuf_kick(nv50->base.pushbuf, nv50->base.pushbuf->channel);
181 nv50_context_unreference_resources(nv50);
183 FREE(nv50->blit);
185 nouveau_context_destroy(&nv50->base);
193 struct nv50_context *nv50 = nv50_context(&ctx->pipe);
198 assert(nv50->framebuffer.nr_cbufs <= PIPE_MAX_COLOR_BUFS);
199 for (i = 0; i < nv50->framebuffer.nr_cbufs; ++i) {
200 if (nv50->framebuffer.cbufs[i] &&
201 nv50->framebuffer.cbufs[i]->texture == res) {
202 nv50->dirty_3d |= NV50_NEW_3D_FRAMEBUFFER;
203 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_FB);
210 if (nv50->framebuffer.zsbuf &&
211 nv50->framebuffer.zsbuf->texture == res) {
212 nv50->dirty_3d |= NV50_NEW_3D_FRAMEBUFFER;
213 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_FB);
225 assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
226 for (i = 0; i < nv50->num_vtxbufs; ++i) {
227 if (nv50->vtxbuf[i].buffer.resource == res) {
228 nv50->dirty_3d |= NV50_NEW_3D_ARRAYS;
229 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_VERTEX);
236 assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS);
237 for (i = 0; i < nv50->num_textures[s]; ++i) {
238 if (nv50->textures[s][i] &&
239 nv50->textures[s][i]->texture == res) {
240 nv50->dirty_3d |= NV50_NEW_3D_TEXTURES;
241 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_TEXTURES);
250 if (!(nv50->constbuf_valid[s] & (1 << i)))
252 if (!nv50->constbuf[s][i].user &&
253 nv50->constbuf[s][i].u.buf == res) {
254 nv50->dirty_3d |= NV50_NEW_3D_CONSTBUF;
255 nv50->constbuf_dirty[s] |= 1 << i;
256 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_3D_CB(s, i));
275 struct nv50_context *nv50;
280 nv50 = CALLOC_STRUCT(nv50_context);
281 if (!nv50)
283 pipe = &nv50->base.pipe;
285 if (!nv50_blitctx_create(nv50))
288 nv50->base.pushbuf = screen->base.pushbuf;
289 nv50->base.client = screen->base.client;
291 ret = nouveau_bufctx_new(screen->base.client, 2, &nv50->bufctx);
294 &nv50->bufctx_3d);
297 &nv50->bufctx_cp);
301 nv50->base.screen = &screen->base;
302 nv50->base.copy_data = nv50_m2mf_copy_linear;
303 nv50->base.push_data = nv50_sifc_linear_u8;
304 nv50->base.push_cb = nv50_cb_push;
306 nv50->screen = screen;
330 nv50->state = screen->save_state;
331 screen->cur_ctx = nv50;
332 nouveau_pushbuf_bufctx(screen->base.pushbuf, nv50->bufctx);
334 nv50->base.pushbuf->kick_notify = nv50_default_kick_notify;
336 nouveau_context_init(&nv50->base);
337 nv50_init_query_functions(nv50);
338 nv50_init_surface_functions(nv50);
339 nv50_init_state_functions(nv50);
342 nv50->base.invalidate_resource_storage = nv50_invalidate_resource_storage;
347 nouveau_context_init_vdec(&nv50->base);
361 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->code);
362 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->uniforms);
363 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->txc);
364 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->stack_bo);
366 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->code);
367 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->txc);
368 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->stack_bo);
373 BCTX_REFN_bo(nv50->bufctx_3d, 3D_SCREEN, flags, screen->fence.bo);
374 BCTX_REFN_bo(nv50->bufctx, FENCE, flags, screen->fence.bo);
376 BCTX_REFN_bo(nv50->bufctx_cp, CP_SCREEN, flags, screen->fence.bo);
378 nv50->base.scratch.bo_size = 2 << 20;
380 util_dynarray_init(&nv50->global_residents, NULL);
387 if (nv50->bufctx_3d)
388 nouveau_bufctx_del(&nv50->bufctx_3d);
389 if (nv50->bufctx_cp)
390 nouveau_bufctx_del(&nv50->bufctx_cp);
391 if (nv50->bufctx)
392 nouveau_bufctx_del(&nv50->bufctx);
393 FREE(nv50->blit);
394 FREE(nv50);