Lines Matching refs:rscreen
39 static void r600_texture_discard_cmask(struct r600_common_screen *rscreen,
42 r600_choose_tiling(struct r600_common_screen *rscreen,
173 static unsigned r600_texture_get_offset(struct r600_common_screen *rscreen, in r600_texture_get_offset() argument
196 static int r600_init_surface(struct r600_common_screen *rscreen, in r600_init_surface() argument
215 if (rscreen->chip_class >= EVERGREEN && !is_flushed_depth && in r600_init_surface()
248 r = rscreen->ws->surface_init(rscreen->ws, ptex, flags, bpe, in r600_init_surface()
272 static void r600_texture_init_metadata(struct r600_common_screen *rscreen, in r600_texture_init_metadata() argument
294 static void r600_surface_import_metadata(struct r600_common_screen *rscreen, in r600_surface_import_metadata() argument
320 struct r600_common_screen *rscreen = rctx->screen; in r600_eliminate_fast_color_clear() local
323 if (ctx == rscreen->aux_context) in r600_eliminate_fast_color_clear()
324 mtx_lock(&rscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
329 if (ctx == rscreen->aux_context) in r600_eliminate_fast_color_clear()
330 mtx_unlock(&rscreen->aux_context_lock); in r600_eliminate_fast_color_clear()
333 static void r600_texture_discard_cmask(struct r600_common_screen *rscreen, in r600_texture_discard_cmask() argument
352 p_atomic_inc(&rscreen->dirty_tex_counter); in r600_texture_discard_cmask()
353 p_atomic_inc(&rscreen->compressed_colortex_counter); in r600_texture_discard_cmask()
451 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_get_handle() local
460 rctx = (struct r600_common_context*)(ctx ? ctx : rscreen->aux_context); in r600_texture_get_handle()
470 if (rscreen->ws->buffer_is_suballocated(res->buf) || in r600_texture_get_handle()
490 r600_texture_discard_cmask(rscreen, rtex); in r600_texture_get_handle()
495 r600_texture_init_metadata(rscreen, rtex, &metadata); in r600_texture_get_handle()
496 if (rscreen->query_opaque_metadata) in r600_texture_get_handle()
497 rscreen->query_opaque_metadata(rscreen, rtex, in r600_texture_get_handle()
500 rscreen->ws->buffer_set_metadata(res->buf, &metadata); in r600_texture_get_handle()
509 if (rscreen->ws->buffer_is_suballocated(res->buf)) { in r600_texture_get_handle()
552 return rscreen->ws->buffer_get_handle(res->buf, stride, offset, in r600_texture_get_handle()
575 void r600_texture_get_fmask_info(struct r600_common_screen *rscreen, in r600_texture_get_fmask_info() argument
615 if (rscreen->chip_class <= R700) { in r600_texture_get_fmask_info()
619 if (rscreen->ws->surface_init(rscreen->ws, &templ, flags, bpe, in r600_texture_get_fmask_info()
639 static void r600_texture_allocate_fmask(struct r600_common_screen *rscreen, in r600_texture_allocate_fmask() argument
642 r600_texture_get_fmask_info(rscreen, rtex, in r600_texture_allocate_fmask()
649 void r600_texture_get_cmask_info(struct r600_common_screen *rscreen, in r600_texture_get_cmask_info() argument
658 unsigned num_pipes = rscreen->info.num_tile_pipes; in r600_texture_get_cmask_info()
659 unsigned pipe_interleave_bytes = rscreen->info.pipe_interleave_bytes; in r600_texture_get_cmask_info()
683 static void r600_texture_allocate_cmask(struct r600_common_screen *rscreen, in r600_texture_allocate_cmask() argument
686 r600_texture_get_cmask_info(rscreen, rtex, &rtex->cmask); in r600_texture_allocate_cmask()
694 static void r600_texture_alloc_cmask_separate(struct r600_common_screen *rscreen, in r600_texture_alloc_cmask_separate() argument
702 r600_texture_get_cmask_info(rscreen, rtex, &rtex->cmask); in r600_texture_alloc_cmask_separate()
705 r600_aligned_buffer_create(&rscreen->b, in r600_texture_alloc_cmask_separate()
720 p_atomic_inc(&rscreen->compressed_colortex_counter); in r600_texture_alloc_cmask_separate()
723 void eg_resource_alloc_immed(struct r600_common_screen *rscreen, in eg_resource_alloc_immed() argument
728 pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM, in eg_resource_alloc_immed()
732 static void r600_texture_get_htile_size(struct r600_common_screen *rscreen, in r600_texture_get_htile_size() argument
737 unsigned num_pipes = rscreen->info.num_tile_pipes; in r600_texture_get_htile_size()
741 if (rscreen->chip_class <= EVERGREEN && in r600_texture_get_htile_size()
742 rscreen->info.drm_major == 2 && rscreen->info.drm_minor < 26) in r600_texture_get_htile_size()
746 if (rscreen->chip_class == R600 && in r600_texture_get_htile_size()
783 pipe_interleave_bytes = rscreen->info.pipe_interleave_bytes; in r600_texture_get_htile_size()
792 static void r600_texture_allocate_htile(struct r600_common_screen *rscreen, in r600_texture_allocate_htile() argument
795 r600_texture_get_htile_size(rscreen, rtex); in r600_texture_allocate_htile()
804 void r600_print_texture_info(struct r600_common_screen *rscreen, in r600_print_texture_info() argument
890 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_create_object() local
920 rscreen->chip_class >= EVERGREEN) { in r600_texture_create_object()
934 if (!(rscreen->debug_flags & DBG_NO_HYPERZ)) in r600_texture_create_object()
935 r600_texture_allocate_htile(rscreen, rtex); in r600_texture_create_object()
940 r600_texture_allocate_fmask(rscreen, rtex); in r600_texture_create_object()
941 r600_texture_allocate_cmask(rscreen, rtex); in r600_texture_create_object()
953 r600_init_resource_fields(rscreen, resource, rtex->size, in r600_texture_create_object()
960 if (!r600_alloc_resource(rscreen, resource)) { in r600_texture_create_object()
966 resource->gpu_address = rscreen->ws->buffer_get_virtual_address(resource->buf); in r600_texture_create_object()
969 resource->domains = rscreen->ws->buffer_get_initial_domain(resource->buf); in r600_texture_create_object()
978 r600_screen_clear_buffer(rscreen, &rtex->cmask_buffer->b.b, in r600_texture_create_object()
985 r600_screen_clear_buffer(rscreen, &rtex->resource.b.b, in r600_texture_create_object()
995 if (rscreen->debug_flags & DBG_VM) { in r600_texture_create_object()
1003 if (rscreen->debug_flags & DBG_TEX) { in r600_texture_create_object()
1007 r600_print_texture_info(rscreen, rtex, &log); in r600_texture_create_object()
1017 r600_choose_tiling(struct r600_common_screen *rscreen, in r600_choose_tiling() argument
1034 if (rscreen->chip_class >= R600 && rscreen->chip_class <= CAYMAN && in r600_choose_tiling()
1046 if (rscreen->debug_flags & DBG_NO_TILING) in r600_choose_tiling()
1069 (rscreen->debug_flags & DBG_NO_2D_TILING)) in r600_choose_tiling()
1079 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_create() local
1084 r = r600_init_surface(rscreen, &surface, templ, in r600_texture_create()
1085 r600_choose_tiling(rscreen, templ), 0, 0, in r600_texture_create()
1100 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_from_handle() local
1115 buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle, &stride, &offset); in r600_texture_from_handle()
1119 rscreen->ws->buffer_get_metadata(buf, &metadata); in r600_texture_from_handle()
1120 r600_surface_import_metadata(rscreen, &surface, &metadata, in r600_texture_from_handle()
1123 r = r600_init_surface(rscreen, &surface, templ, array_mode, stride, in r600_texture_from_handle()
1136 if (rscreen->apply_opaque_metadata) in r600_texture_from_handle()
1137 rscreen->apply_opaque_metadata(rscreen, rtex, &metadata); in r600_texture_from_handle()
1240 static bool r600_can_invalidate_texture(struct r600_common_screen *rscreen, in r600_can_invalidate_texture() argument
1246 return rscreen->chip_class >= SI && in r600_can_invalidate_texture()
1259 struct r600_common_screen *rscreen = rctx->screen; in r600_texture_invalidate_storage() local
1266 r600_alloc_resource(rscreen, &rtex->resource); in r600_texture_invalidate_storage()
1272 p_atomic_inc(&rscreen->dirty_tex_counter); in r600_texture_invalidate_storage()
1840 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_memobj_from_handle() local
1848 buf = rscreen->ws->buffer_from_handle(rscreen->ws, whandle, in r600_memobj_from_handle()
1881 struct r600_common_screen *rscreen = (struct r600_common_screen*)screen; in r600_texture_from_memobj() local
1891 rscreen->ws->buffer_get_metadata(memobj->buf, &metadata); in r600_texture_from_memobj()
1892 r600_surface_import_metadata(rscreen, &surface, &metadata, in r600_texture_from_memobj()
1922 r = r600_init_surface(rscreen, &surface, templ, in r600_texture_from_memobj()
1941 if (rscreen->apply_opaque_metadata) in r600_texture_from_memobj()
1942 rscreen->apply_opaque_metadata(rscreen, rtex, &metadata); in r600_texture_from_memobj()
1947 void r600_init_screen_texture_functions(struct r600_common_screen *rscreen) in r600_init_screen_texture_functions() argument
1949 rscreen->b.resource_from_handle = r600_texture_from_handle; in r600_init_screen_texture_functions()
1950 rscreen->b.resource_get_handle = r600_texture_get_handle; in r600_init_screen_texture_functions()
1951 rscreen->b.resource_from_memobj = r600_texture_from_memobj; in r600_init_screen_texture_functions()
1952 rscreen->b.memobj_create_from_handle = r600_memobj_from_handle; in r600_init_screen_texture_functions()
1953 rscreen->b.memobj_destroy = r600_memobj_destroy; in r600_init_screen_texture_functions()