• Home
  • Raw
  • Download

Lines Matching refs:sscreen

45 static enum radeon_surf_mode si_choose_tiling(struct si_screen *sscreen,
181 static unsigned si_texture_get_offset(struct si_screen *sscreen, struct si_texture *tex, in si_texture_get_offset() argument
185 if (sscreen->info.chip_class >= GFX9) { in si_texture_get_offset()
217 static int si_init_surface(struct si_screen *sscreen, struct radeon_surf *surface, in si_init_surface() argument
240 if ((sscreen->debug_flags & DBG(NO_HYPERZ)) || in si_init_surface()
244 (sscreen->info.chip_class >= GFX9 || array_mode == RADEON_SURF_MODE_2D)) { in si_init_surface()
250 if (sscreen->info.chip_class == GFX8) in si_init_surface()
260 if (sscreen->info.chip_class >= GFX8 && in si_init_surface()
262 (sscreen->info.chip_class < GFX10_3 && in si_init_surface()
264 (ptex->nr_samples >= 2 && !sscreen->dcc_msaa_allowed))) in si_init_surface()
268 if (sscreen->info.family == CHIP_STONEY && bpe == 16 && ptex->nr_samples >= 2) in si_init_surface()
272 if (sscreen->info.chip_class == GFX8 && ptex->nr_storage_samples >= 4 && ptex->array_size > 1) in si_init_surface()
276 if (sscreen->info.chip_class == GFX9 && in si_init_surface()
278 (sscreen->info.family == CHIP_RAVEN && ptex->nr_storage_samples >= 2 && bpe < 4))) in si_init_surface()
282 if (sscreen->info.chip_class >= GFX10 && ptex->nr_storage_samples >= 2) in si_init_surface()
289 if (!is_imported && (sscreen->debug_flags & DBG(NO_DCC))) in si_init_surface()
304 if (sscreen->debug_flags & DBG(NO_FMASK)) in si_init_surface()
307 if (sscreen->info.chip_class == GFX9 && (ptex->flags & SI_RESOURCE_FLAG_FORCE_MICRO_TILE_MODE)) { in si_init_surface()
315 if (sscreen->info.chip_class >= GFX10) in si_init_surface()
319 r = sscreen->ws->surface_init(sscreen->ws, ptex, flags, bpe, array_mode, surface); in si_init_surface()
330 struct si_screen *sscreen = sctx->screen; in si_eliminate_fast_color_clear() local
333 if (ctx == sscreen->aux_context) in si_eliminate_fast_color_clear()
334 simple_mtx_lock(&sscreen->aux_context_lock); in si_eliminate_fast_color_clear()
349 if (ctx == sscreen->aux_context) in si_eliminate_fast_color_clear()
350 simple_mtx_unlock(&sscreen->aux_context_lock); in si_eliminate_fast_color_clear()
353 void si_texture_discard_cmask(struct si_screen *sscreen, struct si_texture *tex) in si_texture_discard_cmask() argument
372 p_atomic_inc(&sscreen->dirty_tex_counter); in si_texture_discard_cmask()
373 p_atomic_inc(&sscreen->compressed_colortex_counter); in si_texture_discard_cmask()
384 static bool si_texture_discard_dcc(struct si_screen *sscreen, struct si_texture *tex) in si_texture_discard_dcc() argument
395 p_atomic_inc(&sscreen->dirty_tex_counter); in si_texture_discard_dcc()
422 struct si_screen *sscreen = sctx->screen; in si_texture_disable_dcc() local
425 return si_texture_discard_dcc(sscreen, tex); in si_texture_disable_dcc()
430 if (&sctx->b == sscreen->aux_context) in si_texture_disable_dcc()
431 simple_mtx_lock(&sscreen->aux_context_lock); in si_texture_disable_dcc()
437 if (&sctx->b == sscreen->aux_context) in si_texture_disable_dcc()
438 simple_mtx_unlock(&sscreen->aux_context_lock); in si_texture_disable_dcc()
440 return si_texture_discard_dcc(sscreen, tex); in si_texture_disable_dcc()
553 static void si_set_tex_bo_metadata(struct si_screen *sscreen, struct si_texture *tex) in si_set_tex_bo_metadata() argument
568 sscreen->make_texture_descriptor(sscreen, tex, true, res->target, res->format, swizzle, 0, in si_set_tex_bo_metadata()
571 si_set_mutable_tex_desc_fields(sscreen, tex, &tex->surface.u.legacy.level[0], 0, 0, in si_set_tex_bo_metadata()
574 ac_surface_get_umd_metadata(&sscreen->info, &tex->surface, in si_set_tex_bo_metadata()
577 sscreen->ws->buffer_set_metadata(tex->buffer.buf, &md, &tex->surface); in si_set_tex_bo_metadata()
582 struct si_screen *sscreen = (struct si_screen *)tex->buffer.b.b.screen; in si_has_displayable_dcc() local
584 if (sscreen->info.chip_class <= GFX8) in si_has_displayable_dcc()
599 struct si_screen *sscreen = (struct si_screen *)screen; in si_resource_get_param() local
611 else if (sscreen->info.chip_class >= GFX9) in si_resource_get_param()
620 else if (sscreen->info.chip_class >= GFX9) in si_resource_get_param()
674 struct si_screen *sscreen = (struct si_screen *)screen; in si_texture_get_handle() local
683 sctx = (struct si_context *)(ctx ? ctx : sscreen->aux_context); in si_texture_get_handle()
700 if (sscreen->ws->buffer_is_suballocated(res->buf) || tex->surface.tile_swizzle || in si_texture_get_handle()
702 sscreen->info.has_local_buffers)) { in si_texture_get_handle()
739 si_texture_discard_cmask(sscreen, tex); in si_texture_get_handle()
744 si_set_tex_bo_metadata(sscreen, tex); in si_texture_get_handle()
746 if (sscreen->info.chip_class >= GFX9) { in si_texture_get_handle()
754 if (sscreen->ws->buffer_is_suballocated(res->buf) || in si_texture_get_handle()
757 sscreen->info.has_local_buffers)) { in si_texture_get_handle()
805 return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, whandle); in si_texture_get_handle()
827 void si_print_texture_info(struct si_screen *sscreen, struct si_texture *tex, in si_print_texture_info() argument
842 if (sscreen->info.chip_class >= GFX9) { in si_print_texture_info()
987 struct si_screen *sscreen = (struct si_screen *)screen; in si_texture_create_object() local
1009 tex->tc_compatible_htile = sscreen->info.chip_class == GFX8 && in si_texture_create_object()
1016 if (sscreen->info.chip_class >= GFX9 && base->format == PIPE_FORMAT_Z16_UNORM) in si_texture_create_object()
1036 ac_surface_override_offset_stride(&sscreen->info, &tex->surface, in si_texture_create_object()
1041 if (sscreen->info.chip_class >= GFX9) { in si_texture_create_object()
1047 if (sscreen->info.chip_class == GFX10 && base->last_level > 0) in si_texture_create_object()
1075 si_init_resource_fields(sscreen, resource, alloc_size, alignment); in si_texture_create_object()
1077 if (!si_alloc_resource(sscreen, resource)) in si_texture_create_object()
1081 resource->gpu_address = sscreen->ws->buffer_get_virtual_address(resource->buf); in si_texture_create_object()
1084 resource->domains = sscreen->ws->buffer_get_initial_domain(resource->buf); in si_texture_create_object()
1089 if (sscreen->ws->buffer_get_flags) in si_texture_create_object()
1090 resource->flags = sscreen->ws->buffer_get_flags(resource->buf); in si_texture_create_object()
1095 si_screen_clear_buffer(sscreen, &tex->cmask_buffer->b.b, tex->surface.cmask_offset, in si_texture_create_object()
1101 if (sscreen->info.chip_class >= GFX9 || tex->tc_compatible_htile) in si_texture_create_object()
1104 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.htile_offset, in si_texture_create_object()
1118 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.dcc_offset, in si_texture_create_object()
1120 } else if (sscreen->info.chip_class >= GFX9) { in si_texture_create_object()
1122 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.dcc_offset, in si_texture_create_object()
1128 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.dcc_offset, in si_texture_create_object()
1144 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.dcc_offset, size, in si_texture_create_object()
1149 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.dcc_offset + size, in si_texture_create_object()
1161 si_screen_clear_buffer(sscreen, &tex->buffer.b.b, tex->surface.display_dcc_offset, in si_texture_create_object()
1176 sscreen->info.tcc_cache_line_size); in si_texture_create_object()
1180 sscreen->info.tcc_cache_line_size); in si_texture_create_object()
1181 void *map = sscreen->ws->buffer_map(buf->buf, NULL, PIPE_MAP_WRITE); in si_texture_create_object()
1187 struct si_context *sctx = (struct si_context *)sscreen->aux_context; in si_texture_create_object()
1189 simple_mtx_lock(&sscreen->aux_context_lock); in si_texture_create_object()
1192 sscreen->aux_context->flush(sscreen->aux_context, NULL, 0); in si_texture_create_object()
1193 simple_mtx_unlock(&sscreen->aux_context_lock); in si_texture_create_object()
1201 if (sscreen->debug_flags & DBG(VM)) { in si_texture_create_object()
1210 if (sscreen->debug_flags & DBG(TEX)) { in si_texture_create_object()
1214 si_print_texture_info(sscreen, tex, &log); in si_texture_create_object()
1227 static enum radeon_surf_mode si_choose_tiling(struct si_screen *sscreen, in si_choose_tiling() argument
1247 if (sscreen->info.chip_class == GFX8 && tc_compatible_htile) in si_choose_tiling()
1254 if (sscreen->debug_flags & DBG(NO_TILING)) in si_choose_tiling()
1282 if (templ->width0 <= 16 || templ->height0 <= 16 || (sscreen->debug_flags & DBG(NO_2D_TILING))) in si_choose_tiling()
1292 struct si_screen *sscreen = (struct si_screen *)screen; in si_texture_create() local
1300 if (is_zs && sscreen->eqaa_force_z_samples) { in si_texture_create()
1302 ((struct pipe_resource *)templ)->nr_storage_samples = sscreen->eqaa_force_z_samples; in si_texture_create()
1303 } else if (!is_zs && sscreen->eqaa_force_color_samples) { in si_texture_create()
1304 ((struct pipe_resource *)templ)->nr_samples = sscreen->eqaa_force_coverage_samples; in si_texture_create()
1305 ((struct pipe_resource *)templ)->nr_storage_samples = sscreen->eqaa_force_color_samples; in si_texture_create()
1312 sscreen->info.chip_class >= GFX8 && in si_texture_create()
1318 sscreen->info.family != CHIP_TONGA && sscreen->info.family != CHIP_ICELAND && in si_texture_create()
1320 !(sscreen->debug_flags & DBG(NO_HYPERZ)) && !is_flushed_depth && in si_texture_create()
1323 enum radeon_surf_mode tile_mode = si_choose_tiling(sscreen, templ, tc_compatible_htile); in si_texture_create()
1352 if (si_init_surface(sscreen, &surface[i], &plane_templ[i], tile_mode, false, in si_texture_create()
1387 static struct pipe_resource *si_texture_from_winsys_buffer(struct si_screen *sscreen, in si_texture_from_winsys_buffer() argument
1403 sscreen->ws->buffer_get_metadata(buf, &metadata, &surface); in si_texture_from_winsys_buffer()
1430 r = si_init_surface(sscreen, &surface, templ, metadata.mode, true, in si_texture_from_winsys_buffer()
1435 tex = si_texture_create_object(&sscreen->b, templ, &surface, NULL, buf, in si_texture_from_winsys_buffer()
1455 if (!ac_surface_set_umd_metadata(&sscreen->info, &tex->surface, in si_texture_from_winsys_buffer()
1468 if (si_texture_discard_dcc(sscreen, tex)) { in si_texture_from_winsys_buffer()
1470 si_set_tex_bo_metadata(sscreen, tex); in si_texture_from_winsys_buffer()
1482 struct si_screen *sscreen = (struct si_screen *)screen; in si_texture_from_handle() local
1491 buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle, sscreen->info.max_alignment); in si_texture_from_handle()
1495 return si_texture_from_winsys_buffer(sscreen, templ, buf, whandle->stride, whandle->offset, in si_texture_from_handle()
1601 static bool si_can_invalidate_texture(struct si_screen *sscreen, struct si_texture *tex, in si_can_invalidate_texture() argument
1612 struct si_screen *sscreen = sctx->screen; in si_texture_invalidate_storage() local
1619 si_alloc_resource(sscreen, &tex->buffer); in si_texture_invalidate_storage()
1624 p_atomic_inc(&sscreen->dirty_tex_counter); in si_texture_invalidate_storage()
1824 bool vi_dcc_formats_compatible(struct si_screen *sscreen, enum pipe_format format1, in vi_dcc_formats_compatible() argument
1864 if (vi_alpha_is_on_msb(sscreen, format1) != vi_alpha_is_on_msb(sscreen, format2)) in vi_dcc_formats_compatible()
2251 struct si_screen *sscreen = (struct si_screen *)screen; in si_memobj_from_handle() local
2258 buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle, sscreen->info.max_alignment); in si_memobj_from_handle()
2284 struct si_screen *sscreen = (struct si_screen *)screen; in si_resource_from_memobj() local
2292 res = si_texture_from_winsys_buffer(sscreen, templ, memobj->buf, in si_resource_from_memobj()
2328 void si_init_screen_texture_functions(struct si_screen *sscreen) in si_init_screen_texture_functions() argument
2330 sscreen->b.resource_from_handle = si_texture_from_handle; in si_init_screen_texture_functions()
2331 sscreen->b.resource_get_handle = si_texture_get_handle; in si_init_screen_texture_functions()
2332 sscreen->b.resource_get_param = si_resource_get_param; in si_init_screen_texture_functions()
2333 sscreen->b.resource_get_info = si_texture_get_info; in si_init_screen_texture_functions()
2334 sscreen->b.resource_from_memobj = si_resource_from_memobj; in si_init_screen_texture_functions()
2335 sscreen->b.memobj_create_from_handle = si_memobj_from_handle; in si_init_screen_texture_functions()
2336 sscreen->b.memobj_destroy = si_memobj_destroy; in si_init_screen_texture_functions()
2337 sscreen->b.check_resource_capability = si_check_resource_capability; in si_init_screen_texture_functions()