Lines Matching refs:rscreen
40 static void r600_texture_discard_cmask(struct r600_common_screen *rscreen,
43 r600_choose_tiling(struct r600_common_screen *rscreen,
174 static unsigned r600_texture_get_offset(struct r600_common_screen *rscreen, in r600_texture_get_offset() argument
197 static int r600_init_surface(struct r600_common_screen *rscreen, in r600_init_surface() argument
216 if (rscreen->gfx_level >= EVERGREEN && !is_flushed_depth && in r600_init_surface()
247 r = rscreen->ws->surface_init(rscreen->ws, ptex, in r600_init_surface()
271 static void r600_texture_init_metadata(struct r600_common_screen *rscreen, in r600_texture_init_metadata() argument
293 static void r600_surface_import_metadata(struct r600_common_screen *rscreen, in r600_surface_import_metadata() argument
319 struct r600_common_screen *rscreen = rctx->screen; in r600_eliminate_fast_color_clear() local
322 if (ctx == rscreen->aux_context) in r600_eliminate_fast_color_clear()
323 mtx_lock(&rscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
328 if (ctx == rscreen->aux_context) in r600_eliminate_fast_color_clear()
329 mtx_unlock(&rscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
332 static void r600_texture_discard_cmask(struct r600_common_screen *rscreen, in r600_texture_discard_cmask() argument
351 p_atomic_inc(&rscreen->dirty_tex_counter); in r600_texture_discard_cmask()
352 p_atomic_inc(&rscreen->compressed_colortex_counter); in r600_texture_discard_cmask()
449 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_get_info() local
454 if (!rscreen || !rtex) in r600_texture_get_info()
476 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_get_handle() local
485 rctx = (struct r600_common_context*)(ctx ? ctx : rscreen->aux_context); in r600_texture_get_handle()
495 if (rscreen->ws->buffer_is_suballocated(res->buf) || in r600_texture_get_handle()
515 r600_texture_discard_cmask(rscreen, rtex); in r600_texture_get_handle()
520 r600_texture_init_metadata(rscreen, rtex, &metadata); in r600_texture_get_handle()
522 rscreen->ws->buffer_set_metadata(rscreen->ws, res->buf, &metadata, NULL); in r600_texture_get_handle()
528 if (rscreen->ws->buffer_is_suballocated(res->buf)) { in r600_texture_get_handle()
574 return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, whandle); in r600_texture_get_handle()
593 void r600_texture_get_fmask_info(struct r600_common_screen *rscreen, in r600_texture_get_fmask_info() argument
633 if (rscreen->gfx_level <= R700) { in r600_texture_get_fmask_info()
637 if (rscreen->ws->surface_init(rscreen->ws, &templ, in r600_texture_get_fmask_info()
657 static void r600_texture_allocate_fmask(struct r600_common_screen *rscreen, in r600_texture_allocate_fmask() argument
660 r600_texture_get_fmask_info(rscreen, rtex, in r600_texture_allocate_fmask()
667 void r600_texture_get_cmask_info(struct r600_common_screen *rscreen, in r600_texture_get_cmask_info() argument
676 unsigned num_pipes = rscreen->info.num_tile_pipes; in r600_texture_get_cmask_info()
677 unsigned pipe_interleave_bytes = rscreen->info.pipe_interleave_bytes; in r600_texture_get_cmask_info()
701 static void r600_texture_allocate_cmask(struct r600_common_screen *rscreen, in r600_texture_allocate_cmask() argument
704 r600_texture_get_cmask_info(rscreen, rtex, &rtex->cmask); in r600_texture_allocate_cmask()
712 static void r600_texture_alloc_cmask_separate(struct r600_common_screen *rscreen, in r600_texture_alloc_cmask_separate() argument
720 r600_texture_get_cmask_info(rscreen, rtex, &rtex->cmask); in r600_texture_alloc_cmask_separate()
723 r600_aligned_buffer_create(&rscreen->b, in r600_texture_alloc_cmask_separate()
738 p_atomic_inc(&rscreen->compressed_colortex_counter); in r600_texture_alloc_cmask_separate()
741 void eg_resource_alloc_immed(struct r600_common_screen *rscreen, in eg_resource_alloc_immed() argument
746 pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM, in eg_resource_alloc_immed()
750 static void r600_texture_get_htile_size(struct r600_common_screen *rscreen, in r600_texture_get_htile_size() argument
755 unsigned num_pipes = rscreen->info.num_tile_pipes; in r600_texture_get_htile_size()
760 if (rscreen->gfx_level == R600 && in r600_texture_get_htile_size()
797 pipe_interleave_bytes = rscreen->info.pipe_interleave_bytes; in r600_texture_get_htile_size()
806 static void r600_texture_allocate_htile(struct r600_common_screen *rscreen, in r600_texture_allocate_htile() argument
809 r600_texture_get_htile_size(rscreen, rtex); in r600_texture_allocate_htile()
818 void r600_print_texture_info(struct r600_common_screen *rscreen, in r600_print_texture_info() argument
904 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_create_object() local
932 rscreen->gfx_level >= EVERGREEN) { in r600_texture_create_object()
946 if (!(rscreen->debug_flags & DBG_NO_HYPERZ)) in r600_texture_create_object()
947 r600_texture_allocate_htile(rscreen, rtex); in r600_texture_create_object()
952 r600_texture_allocate_fmask(rscreen, rtex); in r600_texture_create_object()
953 r600_texture_allocate_cmask(rscreen, rtex); in r600_texture_create_object()
965 r600_init_resource_fields(rscreen, resource, rtex->size, in r600_texture_create_object()
968 if (!r600_alloc_resource(rscreen, resource)) { in r600_texture_create_object()
974 resource->gpu_address = rscreen->ws->buffer_get_virtual_address(resource->buf); in r600_texture_create_object()
977 resource->domains = rscreen->ws->buffer_get_initial_domain(resource->buf); in r600_texture_create_object()
986 r600_screen_clear_buffer(rscreen, &rtex->cmask_buffer->b.b, in r600_texture_create_object()
993 r600_screen_clear_buffer(rscreen, &rtex->resource.b.b, in r600_texture_create_object()
1003 if (rscreen->debug_flags & DBG_VM) { in r600_texture_create_object()
1011 if (rscreen->debug_flags & DBG_TEX) { in r600_texture_create_object()
1015 r600_print_texture_info(rscreen, rtex, &log); in r600_texture_create_object()
1025 r600_choose_tiling(struct r600_common_screen *rscreen, in r600_choose_tiling() argument
1042 if (rscreen->gfx_level >= R600 && rscreen->gfx_level <= CAYMAN && in r600_choose_tiling()
1054 if (rscreen->debug_flags & DBG_NO_TILING) in r600_choose_tiling()
1077 (rscreen->debug_flags & DBG_NO_2D_TILING)) in r600_choose_tiling()
1087 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_create() local
1092 r = r600_init_surface(rscreen, &surface, templ, in r600_texture_create()
1093 r600_choose_tiling(rscreen, templ), 0, 0, in r600_texture_create()
1108 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_from_handle() local
1122 buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle, in r600_texture_from_handle()
1123 rscreen->info.max_alignment, false); in r600_texture_from_handle()
1127 rscreen->ws->buffer_get_metadata(rscreen->ws, buf, &metadata, NULL); in r600_texture_from_handle()
1128 r600_surface_import_metadata(rscreen, &surface, &metadata, in r600_texture_from_handle()
1131 r = r600_init_surface(rscreen, &surface, templ, array_mode, in r600_texture_from_handle()
1246 static bool r600_can_invalidate_texture(struct r600_common_screen *rscreen, in r600_can_invalidate_texture() argument
1252 return rscreen->gfx_level >= GFX6 && in r600_can_invalidate_texture()
1265 struct r600_common_screen *rscreen = rctx->screen; in r600_texture_invalidate_storage() local
1272 r600_alloc_resource(rscreen, &rtex->resource); in r600_texture_invalidate_storage()
1278 p_atomic_inc(&rscreen->dirty_tex_counter); in r600_texture_invalidate_storage()
1835 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_memobj_from_handle() local
1842 buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle, in r600_memobj_from_handle()
1843 rscreen->info.max_alignment, false); in r600_memobj_from_handle()
1875 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_from_memobj() local
1885 rscreen->ws->buffer_get_metadata(rscreen->ws, memobj->buf, &metadata, NULL); in r600_texture_from_memobj()
1886 r600_surface_import_metadata(rscreen, &surface, &metadata, in r600_texture_from_memobj()
1916 r = r600_init_surface(rscreen, &surface, templ, in r600_texture_from_memobj()
1938 void r600_init_screen_texture_functions(struct r600_common_screen *rscreen) in r600_init_screen_texture_functions() argument
1940 rscreen->b.resource_from_handle = r600_texture_from_handle; in r600_init_screen_texture_functions()
1941 rscreen->b.resource_get_handle = r600_texture_get_handle; in r600_init_screen_texture_functions()
1942 rscreen->b.resource_get_info = r600_texture_get_info; in r600_init_screen_texture_functions()
1943 rscreen->b.resource_from_memobj = r600_texture_from_memobj; in r600_init_screen_texture_functions()
1944 rscreen->b.memobj_create_from_handle = r600_memobj_from_handle; in r600_init_screen_texture_functions()
1945 rscreen->b.memobj_destroy = r600_memobj_destroy; in r600_init_screen_texture_functions()