Lines Matching refs:sctx

108 	struct si_context *sctx = (struct si_context *)context;  in si_destroy_context()  local
118 si_release_all_descriptors(sctx); in si_destroy_context()
120 pipe_resource_reference(&sctx->esgs_ring, NULL); in si_destroy_context()
121 pipe_resource_reference(&sctx->gsvs_ring, NULL); in si_destroy_context()
122 pipe_resource_reference(&sctx->tf_ring, NULL); in si_destroy_context()
123 pipe_resource_reference(&sctx->tess_offchip_ring, NULL); in si_destroy_context()
124 pipe_resource_reference(&sctx->null_const_buf.buffer, NULL); in si_destroy_context()
125 r600_resource_reference(&sctx->border_color_buffer, NULL); in si_destroy_context()
126 free(sctx->border_color_table); in si_destroy_context()
127 r600_resource_reference(&sctx->scratch_buffer, NULL); in si_destroy_context()
128 r600_resource_reference(&sctx->compute_scratch_buffer, NULL); in si_destroy_context()
129 r600_resource_reference(&sctx->wait_mem_scratch, NULL); in si_destroy_context()
131 si_pm4_free_state(sctx, sctx->init_config, ~0); in si_destroy_context()
132 if (sctx->init_config_gs_rings) in si_destroy_context()
133 si_pm4_free_state(sctx, sctx->init_config_gs_rings, ~0); in si_destroy_context()
134 for (i = 0; i < ARRAY_SIZE(sctx->vgt_shader_config); i++) in si_destroy_context()
135 si_pm4_delete_state(sctx, vgt_shader_config, sctx->vgt_shader_config[i]); in si_destroy_context()
137 if (sctx->fixed_func_tcs_shader.cso) in si_destroy_context()
138 sctx->b.b.delete_tcs_state(&sctx->b.b, sctx->fixed_func_tcs_shader.cso); in si_destroy_context()
139 if (sctx->custom_dsa_flush) in si_destroy_context()
140 sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush); in si_destroy_context()
141 if (sctx->custom_blend_resolve) in si_destroy_context()
142 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve); in si_destroy_context()
143 if (sctx->custom_blend_fmask_decompress) in si_destroy_context()
144 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fmask_decompress); in si_destroy_context()
145 if (sctx->custom_blend_eliminate_fastclear) in si_destroy_context()
146 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_eliminate_fastclear); in si_destroy_context()
147 if (sctx->custom_blend_dcc_decompress) in si_destroy_context()
148 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress); in si_destroy_context()
149 if (sctx->vs_blit_pos) in si_destroy_context()
150 sctx->b.b.delete_vs_state(&sctx->b.b, sctx->vs_blit_pos); in si_destroy_context()
151 if (sctx->vs_blit_pos_layered) in si_destroy_context()
152 sctx->b.b.delete_vs_state(&sctx->b.b, sctx->vs_blit_pos_layered); in si_destroy_context()
153 if (sctx->vs_blit_color) in si_destroy_context()
154 sctx->b.b.delete_vs_state(&sctx->b.b, sctx->vs_blit_color); in si_destroy_context()
155 if (sctx->vs_blit_color_layered) in si_destroy_context()
156 sctx->b.b.delete_vs_state(&sctx->b.b, sctx->vs_blit_color_layered); in si_destroy_context()
157 if (sctx->vs_blit_texcoord) in si_destroy_context()
158 sctx->b.b.delete_vs_state(&sctx->b.b, sctx->vs_blit_texcoord); in si_destroy_context()
160 if (sctx->blitter) in si_destroy_context()
161 util_blitter_destroy(sctx->blitter); in si_destroy_context()
163 si_common_context_cleanup(&sctx->b); in si_destroy_context()
165 LLVMDisposeTargetMachine(sctx->tm); in si_destroy_context()
167 si_saved_cs_reference(&sctx->current_saved_cs, NULL); in si_destroy_context()
169 _mesa_hash_table_destroy(sctx->tex_handles, NULL); in si_destroy_context()
170 _mesa_hash_table_destroy(sctx->img_handles, NULL); in si_destroy_context()
172 util_dynarray_fini(&sctx->resident_tex_handles); in si_destroy_context()
173 util_dynarray_fini(&sctx->resident_img_handles); in si_destroy_context()
174 util_dynarray_fini(&sctx->resident_tex_needs_color_decompress); in si_destroy_context()
175 util_dynarray_fini(&sctx->resident_img_needs_color_decompress); in si_destroy_context()
176 util_dynarray_fini(&sctx->resident_tex_needs_depth_decompress); in si_destroy_context()
177 FREE(sctx); in si_destroy_context()
183 struct si_context *sctx = (struct si_context *)ctx; in si_amdgpu_get_reset_status() local
185 return sctx->b.ws->ctx_query_reset_status(sctx->b.ctx); in si_amdgpu_get_reset_status()
199 struct si_context *sctx = (struct si_context *)ctx; in si_emit_string_marker() local
201 dd_parse_apitrace_marker(string, len, &sctx->apitrace_call_number); in si_emit_string_marker()
203 if (sctx->b.log) in si_emit_string_marker()
204 u_log_printf(sctx->b.log, "\nString marker: %*s\n", len, string); in si_emit_string_marker()
222 struct si_context *sctx = (struct si_context *)ctx; in si_set_debug_callback() local
223 struct si_screen *screen = sctx->screen; in si_set_debug_callback()
229 sctx->debug = *cb; in si_set_debug_callback()
231 memset(&sctx->debug, 0, sizeof(sctx->debug)); in si_set_debug_callback()
237 struct si_context *sctx = (struct si_context *)ctx; in si_set_log_context() local
238 sctx->b.log = log; in si_set_log_context()
241 u_log_add_auto_logger(log, si_auto_log_cs, sctx); in si_set_log_context()
247 struct si_context *sctx = CALLOC_STRUCT(si_context); in si_create_context() local
252 if (!sctx) in si_create_context()
258 sctx->b.b.screen = screen; /* this must be set first */ in si_create_context()
259 sctx->b.b.priv = NULL; in si_create_context()
260 sctx->b.b.destroy = si_destroy_context; in si_create_context()
261 sctx->b.b.emit_string_marker = si_emit_string_marker; in si_create_context()
262 sctx->b.b.set_debug_callback = si_set_debug_callback; in si_create_context()
263 sctx->b.b.set_log_context = si_set_log_context; in si_create_context()
264 sctx->b.set_atom_dirty = (void *)si_set_atom_dirty; in si_create_context()
265 sctx->screen = sscreen; /* Easy accessing of screen/winsys. */ in si_create_context()
266 sctx->is_debug = (flags & PIPE_CONTEXT_DEBUG) != 0; in si_create_context()
268 if (!si_common_context_init(&sctx->b, sscreen, flags)) in si_create_context()
272 sctx->b.b.get_device_reset_status = si_amdgpu_get_reset_status; in si_create_context()
274 si_init_buffer_functions(sctx); in si_create_context()
275 si_init_clear_functions(sctx); in si_create_context()
276 si_init_blit_functions(sctx); in si_create_context()
277 si_init_compute_functions(sctx); in si_create_context()
278 si_init_cp_dma_functions(sctx); in si_create_context()
279 si_init_debug_functions(sctx); in si_create_context()
280 si_init_msaa_functions(sctx); in si_create_context()
281 si_init_streamout_functions(sctx); in si_create_context()
284 sctx->b.b.create_video_codec = si_uvd_create_decoder; in si_create_context()
285 sctx->b.b.create_video_buffer = si_video_buffer_create; in si_create_context()
287 sctx->b.b.create_video_codec = vl_create_decoder; in si_create_context()
288 sctx->b.b.create_video_buffer = vl_video_buffer_create; in si_create_context()
291 sctx->b.gfx.cs = ws->cs_create(sctx->b.ctx, RING_GFX, in si_create_context()
292 si_context_gfx_flush, sctx); in si_create_context()
293 sctx->b.gfx.flush = si_context_gfx_flush; in si_create_context()
296 sctx->border_color_table = malloc(SI_MAX_BORDER_COLORS * in si_create_context()
297 sizeof(*sctx->border_color_table)); in si_create_context()
298 if (!sctx->border_color_table) in si_create_context()
301 sctx->border_color_buffer = (struct r600_resource*) in si_create_context()
304 sizeof(*sctx->border_color_table)); in si_create_context()
305 if (!sctx->border_color_buffer) in si_create_context()
308 sctx->border_color_map = in si_create_context()
309 ws->buffer_map(sctx->border_color_buffer->buf, in si_create_context()
311 if (!sctx->border_color_map) in si_create_context()
314 si_init_all_descriptors(sctx); in si_create_context()
315 si_init_fence_functions(sctx); in si_create_context()
316 si_init_state_functions(sctx); in si_create_context()
317 si_init_shader_functions(sctx); in si_create_context()
318 si_init_viewport_functions(sctx); in si_create_context()
319 si_init_ia_multi_vgt_param_table(sctx); in si_create_context()
321 if (sctx->b.chip_class >= CIK) in si_create_context()
322 cik_init_sdma_functions(sctx); in si_create_context()
324 si_init_dma_functions(sctx); in si_create_context()
327 sctx->b.b.resource_copy_region = sctx->b.dma_copy; in si_create_context()
329 sctx->blitter = util_blitter_create(&sctx->b.b); in si_create_context()
330 if (sctx->blitter == NULL) in si_create_context()
332 sctx->blitter->draw_rectangle = si_draw_rectangle; in si_create_context()
333 sctx->blitter->skip_viewport_restore = true; in si_create_context()
335 sctx->sample_mask.sample_mask = 0xffff; in si_create_context()
337 if (sctx->b.chip_class >= GFX9) { in si_create_context()
338 sctx->wait_mem_scratch = (struct r600_resource*) in si_create_context()
340 if (!sctx->wait_mem_scratch) in si_create_context()
344 struct radeon_winsys_cs *cs = sctx->b.gfx.cs; in si_create_context()
349 radeon_emit(cs, sctx->wait_mem_scratch->gpu_address); in si_create_context()
350 radeon_emit(cs, sctx->wait_mem_scratch->gpu_address >> 32); in si_create_context()
351 radeon_emit(cs, sctx->wait_mem_number); in si_create_context()
352 radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, in si_create_context()
353 sctx->wait_mem_scratch, in si_create_context()
359 if (sctx->b.chip_class == CIK) { in si_create_context()
360 sctx->null_const_buf.buffer = in si_create_context()
364 sctx->screen->info.tcc_cache_line_size); in si_create_context()
365 if (!sctx->null_const_buf.buffer) in si_create_context()
367 sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0; in si_create_context()
371 sctx->b.b.set_constant_buffer(&sctx->b.b, shader, i, in si_create_context()
372 &sctx->null_const_buf); in si_create_context()
376 si_set_rw_buffer(sctx, SI_HS_CONST_DEFAULT_TESS_LEVELS, in si_create_context()
377 &sctx->null_const_buf); in si_create_context()
378 si_set_rw_buffer(sctx, SI_VS_CONST_INSTANCE_DIVISORS, in si_create_context()
379 &sctx->null_const_buf); in si_create_context()
380 si_set_rw_buffer(sctx, SI_VS_CONST_CLIP_PLANES, in si_create_context()
381 &sctx->null_const_buf); in si_create_context()
382 si_set_rw_buffer(sctx, SI_PS_CONST_POLY_STIPPLE, in si_create_context()
383 &sctx->null_const_buf); in si_create_context()
384 si_set_rw_buffer(sctx, SI_PS_CONST_SAMPLE_POSITIONS, in si_create_context()
385 &sctx->null_const_buf); in si_create_context()
388 si_clear_buffer(&sctx->b.b, sctx->null_const_buf.buffer, 0, in si_create_context()
389 sctx->null_const_buf.buffer->width0, 0, in si_create_context()
410 sctx->scratch_waves = MAX2(32 * sscreen->info.num_good_compute_units, in si_create_context()
413 sctx->tm = si_create_llvm_target_machine(sscreen); in si_create_context()
416 sctx->tex_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in si_create_context()
418 sctx->img_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in si_create_context()
421 util_dynarray_init(&sctx->resident_tex_handles, NULL); in si_create_context()
422 util_dynarray_init(&sctx->resident_img_handles, NULL); in si_create_context()
423 util_dynarray_init(&sctx->resident_tex_needs_color_decompress, NULL); in si_create_context()
424 util_dynarray_init(&sctx->resident_img_needs_color_decompress, NULL); in si_create_context()
425 util_dynarray_init(&sctx->resident_tex_needs_depth_decompress, NULL); in si_create_context()
428 si_begin_new_cs(sctx); in si_create_context()
429 return &sctx->b.b; in si_create_context()
432 si_destroy_context(&sctx->b.b); in si_create_context()
593 struct si_context *sctx = (struct si_context *)ctx; in si_test_vmfault() local
605 si_copy_buffer(sctx, buf, buf, 0, 4, 4, 0); in si_test_vmfault()
610 sctx->b.dma_clear_buffer(ctx, buf, 0, 4, 0); in si_test_vmfault()