Home | History | Annotate | Download | only in r600

Lines Matching refs:rctx

39 static struct r600_fence *r600_create_fence(struct r600_context *rctx)
41 struct r600_screen *rscreen = rctx->screen;
55 rscreen->fences.data = rctx->ws->buffer_map(rscreen->fences.bo->cs_buf,
56 rctx->cs,
103 r600_context_emit_fence(rctx, rscreen->fences.bo, fence->index, 1);
107 pipe_buffer_create(&rctx->screen->screen, PIPE_BIND_CUSTOM,
110 r600_context_bo_reloc(rctx, fence->sleep_bo, RADEON_USAGE_READWRITE);
121 struct r600_context *rctx = (struct r600_context *)ctx;
127 *rfence = r600_create_fence(rctx);
130 if (rctx->current_render_cond) {
131 render_cond = rctx->current_render_cond;
132 render_cond_mode = rctx->current_render_cond_mode;
136 r600_context_flush(rctx, flags);
157 struct r600_context *rctx = (struct r600_context *)context;
159 pipe_resource_reference((struct pipe_resource**)&rctx->dummy_cmask, NULL);
160 pipe_resource_reference((struct pipe_resource**)&rctx->dummy_fmask, NULL);
162 if (rctx->no_blend) {
163 rctx->context.delete_blend_state(&rctx->context, rctx->no_blend);
165 if (rctx->dummy_pixel_shader) {
166 rctx->context.delete_fs_state(&rctx->context, rctx->dummy_pixel_shader);
168 if (rctx->custom_dsa_flush) {
169 rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush);
171 if (rctx->custom_blend_resolve) {
172 rctx->context.delete_blend_state(&rctx->context, rctx->custom_blend_resolve);
174 if (rctx->custom_blend_decompress) {
175 rctx->context.delete_blend_state(&rctx->context, rctx->custom_blend_decompress);
177 util_unreference_framebuffer_state(&rctx->framebuffer);
179 r600_context_fini(rctx);
181 if (rctx->blitter) {
182 util_blitter_destroy(rctx->blitter);
185 free(rctx->states[i]);
188 if (rctx->uploader) {
189 u_upload_destroy(rctx->uploader);
191 util_slab_destroy(&rctx->pool_transfers);
193 r600_release_command_buffer(&rctx->start_cs_cmd);
195 if (rctx->cs) {
196 rctx->ws->cs_destroy(rctx->cs);
199 FREE(rctx->range);
200 FREE(rctx);
205 struct r600_context *rctx = CALLOC_STRUCT(r600_context);
209 if (rctx == NULL)
212 util_slab_create(&rctx->pool_transfers,
216 rctx->context.screen = screen;
217 rctx->context.priv = priv;
218 rctx->context.destroy = r600_destroy_context;
219 rctx->context.flush = r600_flush_from_st;
222 rctx->screen = rscreen;
223 rctx->ws = rscreen->ws;
224 rctx->family = rscreen->family;
225 rctx->chip_class = rscreen->chip_class;
227 LIST_INITHEAD(&rctx->dirty_states);
228 LIST_INITHEAD(&rctx->active_timer_queries);
229 LIST_INITHEAD(&rctx->active_nontimer_queries);
230 LIST_INITHEAD(&rctx->dirty);
231 LIST_INITHEAD(&rctx->enable_list);
233 rctx->range = CALLOC(NUM_RANGES, sizeof(struct r600_range));
234 if (!rctx->range)
237 r600_init_blit_functions(rctx);
238 r600_init_query_functions(rctx);
239 r600_init_context_resource_functions(rctx);
240 r600_init_surface_functions(rctx);
241 rctx->context.draw_vbo = r600_draw_vbo;
243 rctx->context.create_video_decoder = vl_create_decoder;
244 rctx->context.create_video_buffer = vl_video_buffer_create;
246 r600_init_common_atoms(rctx);
248 switch (rctx->chip_class) {
251 r600_init_state_functions(rctx);
252 r600_init_atom_start_cs(rctx);
253 if (r600_context_init(rctx))
255 rctx->custom_dsa_flush = r600_create_db_flush_dsa(rctx);
256 rctx->custom_blend_resolve = rctx->chip_class == R700 ? r700_create_resolve_blend(rctx)
257 : r600_create_resolve_blend(rctx);
258 rctx->custom_blend_decompress = r600_create_decompress_blend(rctx);
259 rctx->has_vertex_cache = !(rctx->family == CHIP_RV610 ||
260 rctx->family == CHIP_RV620 ||
261 rctx->family == CHIP_RS780 ||
262 rctx->family == CHIP_RS880 ||
263 rctx->family == CHIP_RV710);
267 evergreen_init_state_functions(rctx);
268 evergreen_init_atom_start_cs(rctx);
269 evergreen_init_atom_start_compute_cs(rctx);
270 if (evergreen_context_init(rctx))
272 rctx->custom_dsa_flush = evergreen_create_db_flush_dsa(rctx);
273 rctx->custom_blend_resolve = evergreen_create_resolve_blend(rctx);
274 rctx->custom_blend_decompress = evergreen_create_decompress_blend(rctx);
275 rctx->has_vertex_cache = !(rctx->family == CHIP_CEDAR ||
276 rctx->family == CHIP_PALM ||
277 rctx->family == CHIP_SUMO ||
278 rctx->family == CHIP_SUMO2 ||
279 rctx->family == CHIP_CAICOS ||
280 rctx->family == CHIP_CAYMAN ||
281 rctx->family == CHIP_ARUBA);
284 R600_ERR("Unsupported chip class %d.\n", rctx->chip_class);
288 rctx->cs = rctx->ws->cs_create(rctx->ws);
289 rctx->ws->cs_set_flush_callback(rctx->cs, r600_flush_from_winsys, rctx);
290 r600_emit_atom(rctx, &rctx->start_cs_cmd.atom);
292 rctx->uploader = u_upload_create(&rctx->context, 1024 * 1024, 256,
295 if (!rctx->uploader)
298 rctx->blitter = util_blitter_create(&rctx->context);
299 if (rctx->blitter == NULL)
301 rctx->blitter->draw_rectangle = r600_draw_rectangle;
303 r600_get_backend_mask(rctx); /* this emits commands and must be last */
305 if (rctx->chip_class == R600)
306 r600_set_max_scissor(rctx);
308 rctx->dummy_pixel_shader =
309 util_make_fragment_cloneinput_shader(&rctx->context, 0,
312 rctx->context.bind_fs_state(&rctx->context, rctx->dummy_pixel_shader);
315 rctx->no_blend = rctx->context.create_blend_state(&rctx->context, &no_blend);
317 return &rctx->context;
320 r600_destroy_context(&rctx->context);