Lines Matching refs:sscreen
45 void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res, uint64_t size, in si_init_resource_fields() argument
59 if (sscreen->info.smart_access_memory) in si_init_resource_fields()
73 if (!sscreen->info.kernel_flushes_hdp_before_ib) { in si_init_resource_fields()
101 if (!sscreen->info.kernel_flushes_hdp_before_ib || !sscreen->info.is_amdgpu) in si_init_resource_fields()
120 (sscreen->debug_flags & DBG(TMZ) && in si_init_resource_fields()
127 if (sscreen->debug_flags & DBG(NO_WC)) in si_init_resource_fields()
143 if (sscreen->info.chip_class >= GFX9 && in si_init_resource_fields()
158 if (!sscreen->info.smart_access_memory && in si_init_resource_fields()
159 sscreen->info.has_dedicated_vram && in si_init_resource_fields()
165 bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res) in si_alloc_resource() argument
170 new_buf = sscreen->ws->buffer_create(sscreen->ws, res->bo_size, 1 << res->bo_alignment_log2, in si_alloc_resource()
182 res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf); in si_alloc_resource()
190 assert((start >> 32) == sscreen->info.address32_hi); in si_alloc_resource()
191 assert((last >> 32) == sscreen->info.address32_hi); in si_alloc_resource()
194 radeon_bo_reference(sscreen->ws, &old_buf, NULL); in si_alloc_resource()
200 if (sscreen->debug_flags & DBG(VM) && res->b.b.target == PIPE_BUFFER) { in si_alloc_resource()
206 si_screen_clear_buffer(sscreen, &res->b.b, 0, res->bo_size, 0, SI_OP_SYNC_AFTER); in si_alloc_resource()
214 struct si_screen *sscreen = (struct si_screen *)screen; in si_resource_destroy() local
220 util_idalloc_mt_free(&sscreen->buffer_ids, buffer->b.buffer_id_unique); in si_resource_destroy()
582 struct si_screen *sscreen = (struct si_screen *)screen; in si_buffer_create() local
588 si_init_resource_fields(sscreen, buf, templ->width0, alignment); in si_buffer_create()
593 if (!si_alloc_resource(sscreen, buf)) { in si_buffer_create()
599 buf->b.buffer_id_unique = util_idalloc_mt_alloc(&sscreen->buffer_ids); in si_buffer_create()
631 struct si_screen *sscreen = (struct si_screen *)screen; in si_buffer_from_user_memory() local
632 struct radeon_winsys *ws = sscreen->ws; in si_buffer_from_user_memory()
651 buf->b.buffer_id_unique = util_idalloc_mt_alloc(&sscreen->buffer_ids); in si_buffer_from_user_memory()
660 struct si_screen *sscreen = (struct si_screen *)screen; in si_buffer_from_winsys_buffer() local
667 res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf); in si_buffer_from_winsys_buffer()
670 res->domains = sscreen->ws->buffer_get_initial_domain(res->buf); in si_buffer_from_winsys_buffer()
674 if (sscreen->ws->buffer_get_flags) in si_buffer_from_winsys_buffer()
675 res->flags = sscreen->ws->buffer_get_flags(res->buf); in si_buffer_from_winsys_buffer()
682 res->b.buffer_id_unique = util_idalloc_mt_alloc(&sscreen->buffer_ids); in si_buffer_from_winsys_buffer()
720 void si_init_screen_buffer_functions(struct si_screen *sscreen) in si_init_screen_buffer_functions() argument
722 sscreen->b.resource_create = si_resource_create; in si_init_screen_buffer_functions()
723 sscreen->b.resource_destroy = si_resource_destroy; in si_init_screen_buffer_functions()
724 sscreen->b.resource_from_user_memory = si_buffer_from_user_memory; in si_init_screen_buffer_functions()