Lines Matching refs:sscreen
39 static void r600_texture_discard_cmask(struct si_screen *sscreen,
42 r600_choose_tiling(struct si_screen *sscreen,
181 static unsigned r600_texture_get_offset(struct si_screen *sscreen, in r600_texture_get_offset() argument
187 if (sscreen->info.chip_class >= GFX9) { in r600_texture_get_offset()
220 static int r600_init_surface(struct si_screen *sscreen, in r600_init_surface() argument
252 (sscreen->info.chip_class >= GFX9 || in r600_init_surface()
259 if (sscreen->info.chip_class == VI) in r600_init_surface()
269 if (sscreen->info.chip_class >= VI && in r600_init_surface()
274 (!sscreen->dcc_msaa_allowed || ptex->array_size > 1)))) in r600_init_surface()
295 r = sscreen->ws->surface_init(sscreen->ws, ptex, flags, bpe, in r600_init_surface()
303 if (sscreen->info.chip_class >= GFX9) { in r600_init_surface()
324 static void r600_texture_init_metadata(struct si_screen *sscreen, in r600_texture_init_metadata() argument
332 if (sscreen->info.chip_class >= GFX9) { in r600_texture_init_metadata()
350 static void r600_surface_import_metadata(struct si_screen *sscreen, in r600_surface_import_metadata() argument
356 if (sscreen->info.chip_class >= GFX9) { in r600_surface_import_metadata()
388 struct si_screen *sscreen = rctx->screen; in r600_eliminate_fast_color_clear() local
391 if (ctx == sscreen->aux_context) in r600_eliminate_fast_color_clear()
392 mtx_lock(&sscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
397 if (ctx == sscreen->aux_context) in r600_eliminate_fast_color_clear()
398 mtx_unlock(&sscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
401 static void r600_texture_discard_cmask(struct si_screen *sscreen, in r600_texture_discard_cmask() argument
420 p_atomic_inc(&sscreen->dirty_tex_counter); in r600_texture_discard_cmask()
421 p_atomic_inc(&sscreen->compressed_colortex_counter); in r600_texture_discard_cmask()
432 static bool r600_texture_discard_dcc(struct si_screen *sscreen, in r600_texture_discard_dcc() argument
444 p_atomic_inc(&sscreen->dirty_tex_counter); in r600_texture_discard_dcc()
472 struct si_screen *sscreen = rctx->screen; in si_texture_disable_dcc() local
477 if (&rctx->b == sscreen->aux_context) in si_texture_disable_dcc()
478 mtx_lock(&sscreen->aux_context_lock); in si_texture_disable_dcc()
484 if (&rctx->b == sscreen->aux_context) in si_texture_disable_dcc()
485 mtx_unlock(&sscreen->aux_context_lock); in si_texture_disable_dcc()
487 return r600_texture_discard_dcc(sscreen, rtex); in si_texture_disable_dcc()
578 static uint32_t si_get_bo_metadata_word1(struct si_screen *sscreen) in si_get_bo_metadata_word1() argument
580 return (ATI_VENDOR_ID << 16) | sscreen->info.pci_id; in si_get_bo_metadata_word1()
583 static void si_query_opaque_metadata(struct si_screen *sscreen, in si_query_opaque_metadata() argument
598 if (sscreen->info.drm_major != 3) in si_query_opaque_metadata()
617 md->metadata[1] = si_get_bo_metadata_word1(sscreen); in si_query_opaque_metadata()
619 si_make_texture_descriptor(sscreen, rtex, true, in si_query_opaque_metadata()
626 si_set_mutable_tex_desc_fields(sscreen, rtex, &rtex->surface.u.legacy.level[0], in si_query_opaque_metadata()
639 if (sscreen->info.chip_class <= VI) { in si_query_opaque_metadata()
647 static void si_apply_opaque_metadata(struct si_screen *sscreen, in si_apply_opaque_metadata() argument
653 if (sscreen->info.chip_class < VI) in si_apply_opaque_metadata()
661 md->metadata[1] == si_get_bo_metadata_word1(sscreen) && in si_apply_opaque_metadata()
679 struct si_screen *sscreen = (struct si_screen*)screen; in r600_texture_get_handle() local
689 rctx = (struct r600_common_context*)(ctx ? ctx : sscreen->aux_context); in r600_texture_get_handle()
699 if (sscreen->ws->buffer_is_suballocated(res->buf) || in r600_texture_get_handle()
736 r600_texture_discard_cmask(sscreen, rtex); in r600_texture_get_handle()
741 r600_texture_init_metadata(sscreen, rtex, &metadata); in r600_texture_get_handle()
742 si_query_opaque_metadata(sscreen, rtex, &metadata); in r600_texture_get_handle()
744 sscreen->ws->buffer_set_metadata(res->buf, &metadata); in r600_texture_get_handle()
747 if (sscreen->info.chip_class >= GFX9) { in r600_texture_get_handle()
761 if (sscreen->ws->buffer_is_suballocated(res->buf) || in r600_texture_get_handle()
810 return sscreen->ws->buffer_get_handle(res->buf, stride, offset, in r600_texture_get_handle()
834 void si_texture_get_fmask_info(struct si_screen *sscreen, in si_texture_get_fmask_info() argument
846 if (sscreen->info.chip_class >= GFX9) { in si_texture_get_fmask_info()
868 if (sscreen->ws->surface_init(sscreen->ws, &templ, flags, bpe, in si_texture_get_fmask_info()
888 static void r600_texture_allocate_fmask(struct si_screen *sscreen, in r600_texture_allocate_fmask() argument
891 si_texture_get_fmask_info(sscreen, rtex, in r600_texture_allocate_fmask()
898 void si_texture_get_cmask_info(struct si_screen *sscreen, in si_texture_get_cmask_info() argument
902 unsigned pipe_interleave_bytes = sscreen->info.pipe_interleave_bytes; in si_texture_get_cmask_info()
903 unsigned num_pipes = sscreen->info.num_tile_pipes; in si_texture_get_cmask_info()
906 if (sscreen->info.chip_class >= GFX9) { in si_texture_get_cmask_info()
952 static void r600_texture_allocate_cmask(struct si_screen *sscreen, in r600_texture_allocate_cmask() argument
955 si_texture_get_cmask_info(sscreen, rtex, &rtex->cmask); in r600_texture_allocate_cmask()
963 static void r600_texture_get_htile_size(struct si_screen *sscreen, in r600_texture_get_htile_size() argument
968 unsigned num_pipes = sscreen->info.num_tile_pipes; in r600_texture_get_htile_size()
970 assert(sscreen->info.chip_class <= VI); in r600_texture_get_htile_size()
975 if (sscreen->info.chip_class >= CIK && in r600_texture_get_htile_size()
977 sscreen->info.drm_major == 2 && sscreen->info.drm_minor < 38) in r600_texture_get_htile_size()
987 if (sscreen->info.chip_class >= CIK && num_pipes < 4) in r600_texture_get_htile_size()
1022 pipe_interleave_bytes = sscreen->info.pipe_interleave_bytes; in r600_texture_get_htile_size()
1031 static void r600_texture_allocate_htile(struct si_screen *sscreen, in r600_texture_allocate_htile() argument
1034 if (sscreen->info.chip_class <= VI && !rtex->tc_compatible_htile) in r600_texture_allocate_htile()
1035 r600_texture_get_htile_size(sscreen, rtex); in r600_texture_allocate_htile()
1044 void si_print_texture_info(struct si_screen *sscreen, in si_print_texture_info() argument
1060 if (sscreen->info.chip_class >= GFX9) { in si_print_texture_info()
1201 struct si_screen *sscreen = (struct si_screen*)screen; in r600_texture_create_object() local
1228 if (sscreen->info.chip_class >= GFX9 && in r600_texture_create_object()
1250 if (sscreen->info.chip_class >= GFX9) { in r600_texture_create_object()
1262 if (!(sscreen->debug_flags & DBG(NO_HYPERZ))) in r600_texture_create_object()
1263 r600_texture_allocate_htile(sscreen, rtex); in r600_texture_create_object()
1268 r600_texture_allocate_fmask(sscreen, rtex); in r600_texture_create_object()
1269 r600_texture_allocate_cmask(sscreen, rtex); in r600_texture_create_object()
1283 (buf || !(sscreen->debug_flags & DBG(NO_DCC))) && in r600_texture_create_object()
1293 si_init_resource_fields(sscreen, resource, rtex->size, in r600_texture_create_object()
1296 if (!si_alloc_resource(sscreen, resource)) { in r600_texture_create_object()
1302 resource->gpu_address = sscreen->ws->buffer_get_virtual_address(resource->buf); in r600_texture_create_object()
1305 resource->domains = sscreen->ws->buffer_get_initial_domain(resource->buf); in r600_texture_create_object()
1314 si_screen_clear_buffer(sscreen, &rtex->cmask_buffer->b.b, in r600_texture_create_object()
1321 if (sscreen->info.chip_class >= GFX9 || rtex->tc_compatible_htile) in r600_texture_create_object()
1324 si_screen_clear_buffer(sscreen, &rtex->resource.b.b, in r600_texture_create_object()
1332 si_screen_clear_buffer(sscreen, &rtex->resource.b.b, in r600_texture_create_object()
1342 if (sscreen->debug_flags & DBG(VM)) { in r600_texture_create_object()
1350 if (sscreen->debug_flags & DBG(TEX)) { in r600_texture_create_object()
1354 si_print_texture_info(sscreen, rtex, &log); in r600_texture_create_object()
1364 r600_choose_tiling(struct si_screen *sscreen, in r600_choose_tiling() argument
1383 if (sscreen->info.chip_class == VI && in r600_choose_tiling()
1394 if (sscreen->debug_flags & DBG(NO_TILING)) in r600_choose_tiling()
1425 (sscreen->debug_flags & DBG(NO_2D_TILING))) in r600_choose_tiling()
1435 struct si_screen *sscreen = (struct si_screen*)screen; in si_texture_create() local
1439 sscreen->info.chip_class >= VI && in si_texture_create()
1441 !(sscreen->debug_flags & DBG(NO_HYPERZ)) && in si_texture_create()
1448 r = r600_init_surface(sscreen, &surface, templ, in si_texture_create()
1449 r600_choose_tiling(sscreen, templ), 0, 0, in si_texture_create()
1465 struct si_screen *sscreen = (struct si_screen*)screen; in r600_texture_from_handle() local
1480 buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle, &stride, &offset); in r600_texture_from_handle()
1484 sscreen->ws->buffer_get_metadata(buf, &metadata); in r600_texture_from_handle()
1485 r600_surface_import_metadata(sscreen, &surface, &metadata, in r600_texture_from_handle()
1488 r = r600_init_surface(sscreen, &surface, templ, array_mode, stride, in r600_texture_from_handle()
1501 si_apply_opaque_metadata(sscreen, rtex, &metadata); in r600_texture_from_handle()
1602 static bool r600_can_invalidate_texture(struct si_screen *sscreen, in r600_can_invalidate_texture() argument
1619 struct si_screen *sscreen = rctx->screen; in r600_texture_invalidate_storage() local
1626 si_alloc_resource(sscreen, &rtex->resource); in r600_texture_invalidate_storage()
1632 p_atomic_inc(&sscreen->dirty_tex_counter); in r600_texture_invalidate_storage()
2365 struct si_screen *sscreen = (struct si_screen*)screen; in r600_memobj_from_handle() local
2373 buf = sscreen->ws->buffer_from_handle(sscreen->ws, whandle, in r600_memobj_from_handle()
2406 struct si_screen *sscreen = (struct si_screen*)screen; in r600_texture_from_memobj() local
2416 sscreen->ws->buffer_get_metadata(memobj->buf, &metadata); in r600_texture_from_memobj()
2417 r600_surface_import_metadata(sscreen, &surface, &metadata, in r600_texture_from_memobj()
2447 r = r600_init_surface(sscreen, &surface, templ, in r600_texture_from_memobj()
2466 si_apply_opaque_metadata(sscreen, rtex, &metadata); in r600_texture_from_memobj()
2491 void si_init_screen_texture_functions(struct si_screen *sscreen) in si_init_screen_texture_functions() argument
2493 sscreen->b.resource_from_handle = r600_texture_from_handle; in si_init_screen_texture_functions()
2494 sscreen->b.resource_get_handle = r600_texture_get_handle; in si_init_screen_texture_functions()
2495 sscreen->b.resource_from_memobj = r600_texture_from_memobj; in si_init_screen_texture_functions()
2496 sscreen->b.memobj_create_from_handle = r600_memobj_from_handle; in si_init_screen_texture_functions()
2497 sscreen->b.memobj_destroy = r600_memobj_destroy; in si_init_screen_texture_functions()
2498 sscreen->b.check_resource_capability = si_check_resource_capability; in si_init_screen_texture_functions()