Lines Matching refs:rctx

67 	struct r600_context *rctx = (struct r600_context *)context;  in r600_destroy_context()  local
70 r600_isa_destroy(rctx->isa); in r600_destroy_context()
72 r600_sb_context_destroy(rctx->sb_context); in r600_destroy_context()
74 r600_resource_reference(&rctx->dummy_cmask, NULL); in r600_destroy_context()
75 r600_resource_reference(&rctx->dummy_fmask, NULL); in r600_destroy_context()
77 if (rctx->append_fence) in r600_destroy_context()
78 pipe_resource_reference((struct pipe_resource**)&rctx->append_fence, NULL); in r600_destroy_context()
80 rctx->b.b.set_constant_buffer(&rctx->b.b, sh, R600_BUFFER_INFO_CONST_BUFFER, NULL); in r600_destroy_context()
81 free(rctx->driver_consts[sh].constants); in r600_destroy_context()
84 if (rctx->fixed_func_tcs_shader) in r600_destroy_context()
85 rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader); in r600_destroy_context()
87 if (rctx->dummy_pixel_shader) { in r600_destroy_context()
88 rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); in r600_destroy_context()
90 if (rctx->custom_dsa_flush) { in r600_destroy_context()
91 rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush); in r600_destroy_context()
93 if (rctx->custom_blend_resolve) { in r600_destroy_context()
94 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); in r600_destroy_context()
96 if (rctx->custom_blend_decompress) { in r600_destroy_context()
97 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); in r600_destroy_context()
99 if (rctx->custom_blend_fastclear) { in r600_destroy_context()
100 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_fastclear); in r600_destroy_context()
102 util_unreference_framebuffer_state(&rctx->framebuffer.state); in r600_destroy_context()
104 if (rctx->blitter) { in r600_destroy_context()
105 util_blitter_destroy(rctx->blitter); in r600_destroy_context()
107 if (rctx->allocator_fetch_shader) { in r600_destroy_context()
108 u_suballocator_destroy(rctx->allocator_fetch_shader); in r600_destroy_context()
111 r600_release_command_buffer(&rctx->start_cs_cmd); in r600_destroy_context()
113 FREE(rctx->start_compute_cs_cmd.buf); in r600_destroy_context()
115 r600_common_context_cleanup(&rctx->b); in r600_destroy_context()
117 r600_resource_reference(&rctx->trace_buf, NULL); in r600_destroy_context()
118 r600_resource_reference(&rctx->last_trace_buf, NULL); in r600_destroy_context()
119 radeon_clear_saved_cs(&rctx->last_gfx); in r600_destroy_context()
121 FREE(rctx); in r600_destroy_context()
127 struct r600_context *rctx = CALLOC_STRUCT(r600_context); in r600_create_context() local
131 if (!rctx) in r600_create_context()
134 rctx->b.b.screen = screen; in r600_create_context()
136 rctx->b.b.priv = NULL; /* for threaded_context_unwrap_sync */ in r600_create_context()
137 rctx->b.b.destroy = r600_destroy_context; in r600_create_context()
138 rctx->b.set_atom_dirty = (void *)r600_set_atom_dirty; in r600_create_context()
140 if (!r600_common_context_init(&rctx->b, &rscreen->b, flags)) in r600_create_context()
143 rctx->screen = rscreen; in r600_create_context()
144 LIST_INITHEAD(&rctx->texture_buffers); in r600_create_context()
146 r600_init_blit_functions(rctx); in r600_create_context()
149 rctx->b.b.create_video_codec = r600_uvd_create_decoder; in r600_create_context()
150 rctx->b.b.create_video_buffer = r600_video_buffer_create; in r600_create_context()
152 rctx->b.b.create_video_codec = vl_create_decoder; in r600_create_context()
153 rctx->b.b.create_video_buffer = vl_video_buffer_create; in r600_create_context()
157 rctx->is_debug = true; in r600_create_context()
158 r600_init_common_state_functions(rctx); in r600_create_context()
160 switch (rctx->b.chip_class) { in r600_create_context()
163 r600_init_state_functions(rctx); in r600_create_context()
164 r600_init_atom_start_cs(rctx); in r600_create_context()
165 rctx->custom_dsa_flush = r600_create_db_flush_dsa(rctx); in r600_create_context()
166 rctx->custom_blend_resolve = rctx->b.chip_class == R700 ? r700_create_resolve_blend(rctx) in r600_create_context()
167 : r600_create_resolve_blend(rctx); in r600_create_context()
168 rctx->custom_blend_decompress = r600_create_decompress_blend(rctx); in r600_create_context()
169 rctx->has_vertex_cache = !(rctx->b.family == CHIP_RV610 || in r600_create_context()
170 rctx->b.family == CHIP_RV620 || in r600_create_context()
171 rctx->b.family == CHIP_RS780 || in r600_create_context()
172 rctx->b.family == CHIP_RS880 || in r600_create_context()
173 rctx->b.family == CHIP_RV710); in r600_create_context()
177 evergreen_init_state_functions(rctx); in r600_create_context()
178 evergreen_init_atom_start_cs(rctx); in r600_create_context()
179 evergreen_init_atom_start_compute_cs(rctx); in r600_create_context()
180 rctx->custom_dsa_flush = evergreen_create_db_flush_dsa(rctx); in r600_create_context()
181 rctx->custom_blend_resolve = evergreen_create_resolve_blend(rctx); in r600_create_context()
182 rctx->custom_blend_decompress = evergreen_create_decompress_blend(rctx); in r600_create_context()
183 rctx->custom_blend_fastclear = evergreen_create_fastclear_blend(rctx); in r600_create_context()
184 rctx->has_vertex_cache = !(rctx->b.family == CHIP_CEDAR || in r600_create_context()
185 rctx->b.family == CHIP_PALM || in r600_create_context()
186 rctx->b.family == CHIP_SUMO || in r600_create_context()
187 rctx->b.family == CHIP_SUMO2 || in r600_create_context()
188 rctx->b.family == CHIP_CAICOS || in r600_create_context()
189 rctx->b.family == CHIP_CAYMAN || in r600_create_context()
190 rctx->b.family == CHIP_ARUBA); in r600_create_context()
192 rctx->append_fence = pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM, in r600_create_context()
196 R600_ERR("Unsupported chip class %d.\n", rctx->b.chip_class); in r600_create_context()
200 rctx->b.gfx.cs = ws->cs_create(rctx->b.ctx, RING_GFX, in r600_create_context()
201 r600_context_gfx_flush, rctx); in r600_create_context()
202 rctx->b.gfx.flush = r600_context_gfx_flush; in r600_create_context()
204 rctx->allocator_fetch_shader = in r600_create_context()
205 u_suballocator_create(&rctx->b.b, 64 * 1024, in r600_create_context()
207 if (!rctx->allocator_fetch_shader) in r600_create_context()
210 rctx->isa = calloc(1, sizeof(struct r600_isa)); in r600_create_context()
211 if (!rctx->isa || r600_isa_init(rctx, rctx->isa)) in r600_create_context()
215 rctx->b.b.resource_copy_region = rctx->b.dma_copy; in r600_create_context()
217 rctx->blitter = util_blitter_create(&rctx->b.b); in r600_create_context()
218 if (rctx->blitter == NULL) in r600_create_context()
220 util_blitter_set_texture_multisample(rctx->blitter, rscreen->has_msaa); in r600_create_context()
221 rctx->blitter->draw_rectangle = r600_draw_rectangle; in r600_create_context()
223 r600_begin_new_cs(rctx); in r600_create_context()
225 rctx->dummy_pixel_shader = in r600_create_context()
226 util_make_fragment_cloneinput_shader(&rctx->b.b, 0, in r600_create_context()
229 rctx->b.b.bind_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); in r600_create_context()
231 return &rctx->b.b; in r600_create_context()
234 r600_destroy_context(&rctx->b.b); in r600_create_context()