Lines Matching refs:r300
42 static void r300_release_referenced_objects(struct r300_context *r300) in r300_release_referenced_objects() argument
45 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_release_referenced_objects()
47 (struct r300_textures_state*)r300->textures_state.state; in r300_release_referenced_objects()
59 if (r300->texkill_sampler) { in r300_release_referenced_objects()
61 (struct pipe_sampler_view**)&r300->texkill_sampler, in r300_release_referenced_objects()
66 pipe_vertex_buffer_unreference(&r300->dummy_vb); in r300_release_referenced_objects()
67 pb_reference(&r300->vbo, NULL); in r300_release_referenced_objects()
69 r300->context.delete_depth_stencil_alpha_state(&r300->context, in r300_release_referenced_objects()
70 r300->dsa_decompress_zmask); in r300_release_referenced_objects()
75 struct r300_context* r300 = r300_context(context); in r300_destroy_context() local
77 if (r300->cs.priv && r300->hyperz_enabled) { in r300_destroy_context()
78 r300->rws->cs_request_feature(&r300->cs, RADEON_FID_R300_HYPERZ_ACCESS, FALSE); in r300_destroy_context()
80 if (r300->cs.priv && r300->cmask_access) { in r300_destroy_context()
81 r300->rws->cs_request_feature(&r300->cs, RADEON_FID_R300_CMASK_ACCESS, FALSE); in r300_destroy_context()
84 if (r300->blitter) in r300_destroy_context()
85 util_blitter_destroy(r300->blitter); in r300_destroy_context()
86 if (r300->draw) in r300_destroy_context()
87 draw_destroy(r300->draw); in r300_destroy_context()
89 if (r300->uploader) in r300_destroy_context()
90 u_upload_destroy(r300->uploader); in r300_destroy_context()
91 if (r300->context.stream_uploader) in r300_destroy_context()
92 u_upload_destroy(r300->context.stream_uploader); in r300_destroy_context()
95 r300_release_referenced_objects(r300); in r300_destroy_context()
97 r300->rws->cs_destroy(&r300->cs); in r300_destroy_context()
98 if (r300->ctx) in r300_destroy_context()
99 r300->rws->ctx_destroy(r300->ctx); in r300_destroy_context()
101 rc_destroy_regalloc_state(&r300->fs_regalloc_state); in r300_destroy_context()
104 slab_destroy_child(&r300->pool_transfers); in r300_destroy_context()
107 if (r300->aa_state.state) { in r300_destroy_context()
108 FREE(r300->aa_state.state); in r300_destroy_context()
109 FREE(r300->blend_color_state.state); in r300_destroy_context()
110 FREE(r300->clip_state.state); in r300_destroy_context()
111 FREE(r300->fb_state.state); in r300_destroy_context()
112 FREE(r300->gpu_flush.state); in r300_destroy_context()
113 FREE(r300->hyperz_state.state); in r300_destroy_context()
114 FREE(r300->invariant_state.state); in r300_destroy_context()
115 FREE(r300->rs_block_state.state); in r300_destroy_context()
116 FREE(r300->sample_mask.state); in r300_destroy_context()
117 FREE(r300->scissor_state.state); in r300_destroy_context()
118 FREE(r300->textures_state.state); in r300_destroy_context()
119 FREE(r300->vap_invariant_state.state); in r300_destroy_context()
120 FREE(r300->viewport_state.state); in r300_destroy_context()
121 FREE(r300->ztop_state.state); in r300_destroy_context()
122 FREE(r300->fs_constants.state); in r300_destroy_context()
123 FREE(r300->vs_constants.state); in r300_destroy_context()
124 if (!r300->screen->caps.has_tcl) { in r300_destroy_context()
125 FREE(r300->vertex_stream_state.state); in r300_destroy_context()
128 FREE(r300); in r300_destroy_context()
141 r300->atomname.name = #atomname; \
142 r300->atomname.state = NULL; \
143 r300->atomname.size = atomsize; \
144 r300->atomname.emit = r300_emit_##atomname; \
145 r300->atomname.dirty = FALSE; \
150 r300->atomname.state = CALLOC_STRUCT(statetype); \
151 if (r300->atomname.state == NULL) \
155 static boolean r300_setup_atoms(struct r300_context* r300) in r300_setup_atoms() argument
157 boolean is_rv350 = r300->screen->caps.is_rv350; in r300_setup_atoms()
158 boolean is_r500 = r300->screen->caps.is_r500; in r300_setup_atoms()
159 boolean has_tcl = r300->screen->caps.has_tcl; in r300_setup_atoms()
212 R300_INIT_ATOM(hiz_clear, r300->screen->caps.hiz_ram > 0 ? 4 : 0); in r300_setup_atoms()
213 R300_INIT_ATOM(zmask_clear, r300->screen->caps.zmask_ram > 0 ? 4 : 0); in r300_setup_atoms()
220 r300->fs.emit = r500_emit_fs; in r300_setup_atoms()
221 r300->fs_rc_constant_state.emit = r500_emit_fs_rc_constant_state; in r300_setup_atoms()
222 r300->fs_constants.emit = r500_emit_fs_constants; in r300_setup_atoms()
237 r300->sample_mask.state = malloc(4); in r300_setup_atoms()
242 if (!r300->screen->caps.has_tcl) { in r300_setup_atoms()
247 r300->fb_state_pipelined.allow_null_state = TRUE; in r300_setup_atoms()
248 r300->fs_rc_constant_state.allow_null_state = TRUE; in r300_setup_atoms()
249 r300->pvs_flush.allow_null_state = TRUE; in r300_setup_atoms()
250 r300->query_start.allow_null_state = TRUE; in r300_setup_atoms()
251 r300->texture_cache_inval.allow_null_state = TRUE; in r300_setup_atoms()
255 r300_mark_atom_dirty(r300, &r300->invariant_state); in r300_setup_atoms()
256 r300_mark_atom_dirty(r300, &r300->pvs_flush); in r300_setup_atoms()
257 r300_mark_atom_dirty(r300, &r300->vap_invariant_state); in r300_setup_atoms()
258 r300_mark_atom_dirty(r300, &r300->texture_cache_inval); in r300_setup_atoms()
259 r300_mark_atom_dirty(r300, &r300->textures_state); in r300_setup_atoms()
268 struct r300_context *r300 = r300_context(pipe); in r300_init_states() local
273 (struct r300_gpu_flush*)r300->gpu_flush.state; in r300_init_states()
275 (struct r300_vap_invariant_state*)r300->vap_invariant_state.state; in r300_init_states()
277 (struct r300_invariant_state*)r300->invariant_state.state; in r300_init_states()
307 BEGIN_CB(vap_invariant->cb, r300->vap_invariant_state.size); in r300_init_states()
316 if (r300->screen->caps.is_r500) { in r300_init_states()
318 } else if (!r300->screen->caps.has_tcl) { in r300_init_states()
332 BEGIN_CB(invariant->cb, r300->invariant_state.size); in r300_init_states()
341 if (r300->screen->caps.is_rv350) { in r300_init_states()
346 if (r300->screen->caps.is_r500) { in r300_init_states()
356 (struct r300_hyperz_state*)r300->hyperz_state.state; in r300_init_states()
357 BEGIN_CB(&hyperz->cb_flush_begin, r300->hyperz_state.size); in r300_init_states()
364 if (r300->screen->caps.is_r500 || r300->screen->caps.is_rv350) { in r300_init_states()
374 struct r300_context* r300 = CALLOC_STRUCT(r300_context); local
378 if (!r300)
381 r300->rws = rws;
382 r300->screen = r300screen;
384 r300->context.screen = screen;
385 r300->context.priv = priv;
387 r300->context.destroy = r300_destroy_context;
389 slab_create_child(&r300->pool_transfers, &r300screen->pool_transfers);
391 r300->ctx = rws->ctx_create(rws);
392 if (!r300->ctx)
396 if (!rws->cs_create(&r300->cs, r300->ctx, RING_GFX, r300_flush_callback, r300, false))
401 r300->draw = draw_create(&r300->context);
402 if (r300->draw == NULL)
405 draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
407 draw_wide_line_threshold(r300->draw, 10000000.f);
408 draw_wide_point_threshold(r300->draw, 10000000.f);
409 draw_wide_point_sprites(r300->draw, FALSE);
410 draw_enable_line_stipple(r300->draw, TRUE);
411 draw_enable_point_sprites(r300->draw, FALSE);
414 if (!r300_setup_atoms(r300))
417 r300_init_blit_functions(r300);
418 r300_init_flush_functions(r300);
419 r300_init_query_functions(r300);
420 r300_init_state_functions(r300);
421 r300_init_resource_functions(r300);
422 r300_init_render_functions(r300);
423 r300_init_states(&r300->context);
425 r300->context.create_video_codec = vl_create_decoder;
426 r300->context.create_video_buffer = vl_video_buffer_create;
428 r300->uploader = u_upload_create(&r300->context, 128 * 1024,
430 r300->context.stream_uploader = u_upload_create(&r300->context, 1024 * 1024,
432 r300->context.const_uploader = r300->context.stream_uploader;
434 r300->blitter = util_blitter_create(&r300->context);
435 if (r300->blitter == NULL)
437 r300->blitter->draw_rectangle = r300_blitter_draw_rectangle;
442 if (!r300->screen->caps.is_r500) {
457 r300->texkill_sampler = (struct r300_sampler_view*)
458 r300->context.create_sampler_view(&r300->context, tex, &vtempl);
473 r300->dummy_vb.buffer.resource = screen->resource_create(screen, &vb);
474 r300->context.set_vertex_buffers(&r300->context, 0, 1, 0, false, &r300->dummy_vb);
482 r300->dsa_decompress_zmask =
483 r300->context.create_depth_stencil_alpha_state(&r300->context,
487 r300->hyperz_time_of_last_flush = os_time_get();
490 rc_init_regalloc_state(&r300->fs_regalloc_state);
496 if (DBG_ON(r300, DBG_INFO)) {
502 r300->screen->info.drm_major,
503 r300->screen->info.drm_minor,
504 r300->screen->info.drm_patchlevel,
506 r300->screen->info.pci_id,
507 r300->screen->info.r300_num_gb_pipes,
508 r300->screen->info.r300_num_z_pipes,
509 r300->screen->info.gart_size >> 20,
510 r300->screen->info.vram_size >> 20,
512 r300->screen->caps.zmask_ram ? "YES" : "NO",
513 r300->screen->caps.hiz_ram ? "YES" : "NO");
516 return &r300->context;
519 r300_destroy_context(&r300->context);