• Home
  • Raw
  • Download

Lines Matching refs:rctx

68 	struct r600_context *rctx = (struct r600_context *)context;  in r600_destroy_context()  local
71 r600_isa_destroy(rctx->isa); in r600_destroy_context()
73 r600_sb_context_destroy(rctx->sb_context); in r600_destroy_context()
75 for (sh = 0; sh < (rctx->b.chip_class < EVERGREEN ? R600_NUM_HW_STAGES : EG_NUM_HW_STAGES); sh++) { in r600_destroy_context()
76 r600_resource_reference(&rctx->scratch_buffers[sh].buffer, NULL); in r600_destroy_context()
78 r600_resource_reference(&rctx->dummy_cmask, NULL); in r600_destroy_context()
79 r600_resource_reference(&rctx->dummy_fmask, NULL); in r600_destroy_context()
81 if (rctx->append_fence) in r600_destroy_context()
82 pipe_resource_reference((struct pipe_resource**)&rctx->append_fence, NULL); in r600_destroy_context()
84 rctx->b.b.set_constant_buffer(&rctx->b.b, sh, R600_BUFFER_INFO_CONST_BUFFER, NULL); in r600_destroy_context()
85 free(rctx->driver_consts[sh].constants); in r600_destroy_context()
88 if (rctx->fixed_func_tcs_shader) in r600_destroy_context()
89 rctx->b.b.delete_tcs_state(&rctx->b.b, rctx->fixed_func_tcs_shader); in r600_destroy_context()
91 if (rctx->dummy_pixel_shader) { in r600_destroy_context()
92 rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); in r600_destroy_context()
94 if (rctx->custom_dsa_flush) { in r600_destroy_context()
95 rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush); in r600_destroy_context()
97 if (rctx->custom_blend_resolve) { in r600_destroy_context()
98 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); in r600_destroy_context()
100 if (rctx->custom_blend_decompress) { in r600_destroy_context()
101 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); in r600_destroy_context()
103 if (rctx->custom_blend_fastclear) { in r600_destroy_context()
104 rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_fastclear); in r600_destroy_context()
106 util_unreference_framebuffer_state(&rctx->framebuffer.state); in r600_destroy_context()
108 if (rctx->gs_rings.gsvs_ring.buffer) in r600_destroy_context()
109 pipe_resource_reference(&rctx->gs_rings.gsvs_ring.buffer, NULL); in r600_destroy_context()
111 if (rctx->gs_rings.esgs_ring.buffer) in r600_destroy_context()
112 pipe_resource_reference(&rctx->gs_rings.esgs_ring.buffer, NULL); in r600_destroy_context()
116 rctx->b.b.set_constant_buffer(context, sh, i, NULL); in r600_destroy_context()
118 if (rctx->blitter) { in r600_destroy_context()
119 util_blitter_destroy(rctx->blitter); in r600_destroy_context()
121 if (rctx->allocator_fetch_shader) { in r600_destroy_context()
122 u_suballocator_destroy(rctx->allocator_fetch_shader); in r600_destroy_context()
125 r600_release_command_buffer(&rctx->start_cs_cmd); in r600_destroy_context()
127 FREE(rctx->start_compute_cs_cmd.buf); in r600_destroy_context()
129 r600_common_context_cleanup(&rctx->b); in r600_destroy_context()
131 r600_resource_reference(&rctx->trace_buf, NULL); in r600_destroy_context()
132 r600_resource_reference(&rctx->last_trace_buf, NULL); in r600_destroy_context()
133 radeon_clear_saved_cs(&rctx->last_gfx); in r600_destroy_context()
135 FREE(rctx); in r600_destroy_context()
141 struct r600_context *rctx = CALLOC_STRUCT(r600_context); in r600_create_context() local
145 if (!rctx) in r600_create_context()
148 rctx->b.b.screen = screen; in r600_create_context()
150 rctx->b.b.priv = NULL; /* for threaded_context_unwrap_sync */ in r600_create_context()
151 rctx->b.b.destroy = r600_destroy_context; in r600_create_context()
152 rctx->b.set_atom_dirty = (void *)r600_set_atom_dirty; in r600_create_context()
154 if (!r600_common_context_init(&rctx->b, &rscreen->b, flags)) in r600_create_context()
157 rctx->screen = rscreen; in r600_create_context()
158 list_inithead(&rctx->texture_buffers); in r600_create_context()
160 r600_init_blit_functions(rctx); in r600_create_context()
163 rctx->b.b.create_video_codec = r600_uvd_create_decoder; in r600_create_context()
164 rctx->b.b.create_video_buffer = r600_video_buffer_create; in r600_create_context()
166 rctx->b.b.create_video_codec = vl_create_decoder; in r600_create_context()
167 rctx->b.b.create_video_buffer = vl_video_buffer_create; in r600_create_context()
171 rctx->is_debug = true; in r600_create_context()
172 r600_init_common_state_functions(rctx); in r600_create_context()
174 switch (rctx->b.chip_class) { in r600_create_context()
177 r600_init_state_functions(rctx); in r600_create_context()
178 r600_init_atom_start_cs(rctx); in r600_create_context()
179 rctx->custom_dsa_flush = r600_create_db_flush_dsa(rctx); in r600_create_context()
180 rctx->custom_blend_resolve = rctx->b.chip_class == R700 ? r700_create_resolve_blend(rctx) in r600_create_context()
181 : r600_create_resolve_blend(rctx); in r600_create_context()
182 rctx->custom_blend_decompress = r600_create_decompress_blend(rctx); in r600_create_context()
183 rctx->has_vertex_cache = !(rctx->b.family == CHIP_RV610 || in r600_create_context()
184 rctx->b.family == CHIP_RV620 || in r600_create_context()
185 rctx->b.family == CHIP_RS780 || in r600_create_context()
186 rctx->b.family == CHIP_RS880 || in r600_create_context()
187 rctx->b.family == CHIP_RV710); in r600_create_context()
191 evergreen_init_state_functions(rctx); in r600_create_context()
192 evergreen_init_atom_start_cs(rctx); in r600_create_context()
193 evergreen_init_atom_start_compute_cs(rctx); in r600_create_context()
194 rctx->custom_dsa_flush = evergreen_create_db_flush_dsa(rctx); in r600_create_context()
195 rctx->custom_blend_resolve = evergreen_create_resolve_blend(rctx); in r600_create_context()
196 rctx->custom_blend_decompress = evergreen_create_decompress_blend(rctx); in r600_create_context()
197 rctx->custom_blend_fastclear = evergreen_create_fastclear_blend(rctx); in r600_create_context()
198 rctx->has_vertex_cache = !(rctx->b.family == CHIP_CEDAR || in r600_create_context()
199 rctx->b.family == CHIP_PALM || in r600_create_context()
200 rctx->b.family == CHIP_SUMO || in r600_create_context()
201 rctx->b.family == CHIP_SUMO2 || in r600_create_context()
202 rctx->b.family == CHIP_CAICOS || in r600_create_context()
203 rctx->b.family == CHIP_CAYMAN || in r600_create_context()
204 rctx->b.family == CHIP_ARUBA); in r600_create_context()
206 rctx->append_fence = pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM, in r600_create_context()
210 R600_ERR("Unsupported chip class %d.\n", rctx->b.chip_class); in r600_create_context()
214 rctx->b.gfx.cs = ws->cs_create(rctx->b.ctx, RING_GFX, in r600_create_context()
215 r600_context_gfx_flush, rctx, false); in r600_create_context()
216 rctx->b.gfx.flush = r600_context_gfx_flush; in r600_create_context()
218 rctx->allocator_fetch_shader = in r600_create_context()
219 u_suballocator_create(&rctx->b.b, 64 * 1024, in r600_create_context()
221 if (!rctx->allocator_fetch_shader) in r600_create_context()
224 rctx->isa = calloc(1, sizeof(struct r600_isa)); in r600_create_context()
225 if (!rctx->isa || r600_isa_init(rctx, rctx->isa)) in r600_create_context()
229 rctx->b.b.resource_copy_region = rctx->b.dma_copy; in r600_create_context()
231 rctx->blitter = util_blitter_create(&rctx->b.b); in r600_create_context()
232 if (rctx->blitter == NULL) in r600_create_context()
234 util_blitter_set_texture_multisample(rctx->blitter, rscreen->has_msaa); in r600_create_context()
235 rctx->blitter->draw_rectangle = r600_draw_rectangle; in r600_create_context()
237 r600_begin_new_cs(rctx); in r600_create_context()
239 rctx->dummy_pixel_shader = in r600_create_context()
240 util_make_fragment_cloneinput_shader(&rctx->b.b, 0, in r600_create_context()
243 rctx->b.b.bind_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); in r600_create_context()
245 return &rctx->b.b; in r600_create_context()
248 r600_destroy_context(&rctx->b.b); in r600_create_context()