• Home
  • Raw
  • Download

Lines Matching refs:res

290 iris_get_depth_stencil_resources(struct pipe_resource *res,  in iris_get_depth_stencil_resources()  argument
294 if (!res) { in iris_get_depth_stencil_resources()
300 if (res->format != PIPE_FORMAT_S8_UINT) { in iris_get_depth_stencil_resources()
301 *out_z = (void *) res; in iris_get_depth_stencil_resources()
302 *out_s = (void *) iris_resource_get_separate_stencil(res); in iris_get_depth_stencil_resources()
305 *out_s = (void *) res; in iris_get_depth_stencil_resources()
339 iris_resource_disable_aux(struct iris_resource *res) in iris_resource_disable_aux() argument
341 iris_bo_unreference(res->aux.bo); in iris_resource_disable_aux()
342 iris_bo_unreference(res->aux.clear_color_bo); in iris_resource_disable_aux()
343 free(res->aux.state); in iris_resource_disable_aux()
345 res->aux.usage = ISL_AUX_USAGE_NONE; in iris_resource_disable_aux()
346 res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE; in iris_resource_disable_aux()
347 res->aux.sampler_usages = 1 << ISL_AUX_USAGE_NONE; in iris_resource_disable_aux()
348 res->aux.has_hiz = 0; in iris_resource_disable_aux()
349 res->aux.surf.size_B = 0; in iris_resource_disable_aux()
350 res->aux.bo = NULL; in iris_resource_disable_aux()
351 res->aux.extra_aux.surf.size_B = 0; in iris_resource_disable_aux()
352 res->aux.clear_color_bo = NULL; in iris_resource_disable_aux()
353 res->aux.state = NULL; in iris_resource_disable_aux()
360 struct iris_resource *res = (struct iris_resource *)resource; in iris_resource_destroy() local
363 util_range_destroy(&res->valid_buffer_range); in iris_resource_destroy()
365 iris_resource_disable_aux(res); in iris_resource_destroy()
367 iris_bo_unreference(res->bo); in iris_resource_destroy()
368 iris_pscreen_unref(res->base.screen); in iris_resource_destroy()
370 free(res); in iris_resource_destroy()
377 struct iris_resource *res = calloc(1, sizeof(struct iris_resource)); in iris_alloc_resource() local
378 if (!res) in iris_alloc_resource()
381 res->base = *templ; in iris_alloc_resource()
382 res->base.screen = iris_pscreen_ref(pscreen); in iris_alloc_resource()
383 pipe_reference_init(&res->base.reference, 1); in iris_alloc_resource()
385 res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE; in iris_alloc_resource()
386 res->aux.sampler_usages = 1 << ISL_AUX_USAGE_NONE; in iris_alloc_resource()
389 util_range_init(&res->valid_buffer_range); in iris_alloc_resource()
391 return res; in iris_alloc_resource()
395 iris_get_num_logical_layers(const struct iris_resource *res, unsigned level) in iris_get_num_logical_layers() argument
397 if (res->surf.dim == ISL_SURF_DIM_3D) in iris_get_num_logical_layers()
398 return minify(res->surf.logical_level0_px.depth, level); in iris_get_num_logical_layers()
400 return res->surf.logical_level0_px.array_len; in iris_get_num_logical_layers()
404 create_aux_state_map(struct iris_resource *res, enum isl_aux_state initial) in create_aux_state_map() argument
406 assert(res->aux.state == NULL); in create_aux_state_map()
409 for (uint32_t level = 0; level < res->surf.levels; level++) in create_aux_state_map()
410 total_slices += iris_get_num_logical_layers(res, level); in create_aux_state_map()
413 res->surf.levels * sizeof(enum isl_aux_state *); in create_aux_state_map()
428 for (uint32_t level = 0; level < res->surf.levels; level++) { in create_aux_state_map()
430 const unsigned level_layers = iris_get_num_logical_layers(res, level); in create_aux_state_map()
447 map_aux_addresses(struct iris_screen *screen, struct iris_resource *res, in map_aux_addresses() argument
451 if (devinfo->gen >= 12 && isl_aux_usage_has_ccs(res->aux.usage)) { in map_aux_addresses()
454 const unsigned aux_offset = res->aux.extra_aux.surf.size_B > 0 ? in map_aux_addresses()
455 res->aux.extra_aux.offset : res->aux.offset; in map_aux_addresses()
457 gen_aux_map_format_bits(res->surf.tiling, format, plane); in map_aux_addresses()
458 gen_aux_map_add_mapping(aux_map_ctx, res->bo->gtt_offset + res->offset, in map_aux_addresses()
459 res->aux.bo->gtt_offset + aux_offset, in map_aux_addresses()
460 res->surf.size_B, format_bits); in map_aux_addresses()
461 res->bo->aux_map_address = res->aux.bo->gtt_offset; in map_aux_addresses()
489 struct iris_resource *res, in iris_resource_configure_main() argument
493 res->mod_info = isl_drm_modifier_get_info(modifier); in iris_resource_configure_main()
495 if (modifier != DRM_FORMAT_MOD_INVALID && res->mod_info == NULL) in iris_resource_configure_main()
500 if (res->mod_info != NULL) { in iris_resource_configure_main()
501 tiling_flags = 1 << res->mod_info->tiling; in iris_resource_configure_main()
562 if (!isl_surf_init_s(&screen->isl_dev, &res->surf, &init_info)) in iris_resource_configure_main()
565 res->internal_format = templ->format; in iris_resource_configure_main()
580 struct iris_resource *res, bool imported) in iris_resource_configure_aux() argument
587 assert(!res->mod_info || in iris_resource_configure_aux()
588 res->mod_info->aux_usage == ISL_AUX_USAGE_NONE || in iris_resource_configure_aux()
589 res->mod_info->aux_usage == ISL_AUX_USAGE_CCS_E || in iris_resource_configure_aux()
590 res->mod_info->aux_usage == ISL_AUX_USAGE_GEN12_CCS_E || in iris_resource_configure_aux()
591 res->mod_info->aux_usage == ISL_AUX_USAGE_MC); in iris_resource_configure_aux()
593 const bool has_mcs = !res->mod_info && in iris_resource_configure_aux()
594 isl_surf_get_mcs_surf(&screen->isl_dev, &res->surf, &res->aux.surf); in iris_resource_configure_aux()
596 const bool has_hiz = !res->mod_info && !(INTEL_DEBUG & DEBUG_NO_HIZ) && in iris_resource_configure_aux()
597 isl_surf_get_hiz_surf(&screen->isl_dev, &res->surf, &res->aux.surf); in iris_resource_configure_aux()
600 ((!res->mod_info && !(INTEL_DEBUG & DEBUG_NO_RBC)) || in iris_resource_configure_aux()
601 (res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE)) && in iris_resource_configure_aux()
602 isl_surf_get_ccs_surf(&screen->isl_dev, &res->surf, &res->aux.surf, in iris_resource_configure_aux()
603 &res->aux.extra_aux.surf, 0); in iris_resource_configure_aux()
610 assert(res->aux.extra_aux.surf.size_B > 0 && in iris_resource_configure_aux()
611 res->aux.extra_aux.surf.usage & ISL_SURF_USAGE_CCS_BIT); in iris_resource_configure_aux()
612 assert(res->aux.surf.size_B > 0 && in iris_resource_configure_aux()
613 res->aux.surf.usage & in iris_resource_configure_aux()
617 if (res->mod_info && has_ccs) { in iris_resource_configure_aux()
619 res->aux.possible_usages |= 1 << res->mod_info->aux_usage; in iris_resource_configure_aux()
621 res->aux.possible_usages |= in iris_resource_configure_aux()
625 res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ; in iris_resource_configure_aux()
626 } else if (res->surf.samples == 1 && in iris_resource_configure_aux()
627 (res->surf.usage & ISL_SURF_USAGE_TEXTURE_BIT)) { in iris_resource_configure_aux()
632 res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS_WT; in iris_resource_configure_aux()
634 res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS; in iris_resource_configure_aux()
636 } else if (has_ccs && isl_surf_usage_is_stencil(res->surf.usage)) { in iris_resource_configure_aux()
637 res->aux.possible_usages |= 1 << ISL_AUX_USAGE_STC_CCS; in iris_resource_configure_aux()
639 if (want_ccs_e_for_format(devinfo, res->surf.format)) { in iris_resource_configure_aux()
640 res->aux.possible_usages |= devinfo->gen < 12 ? in iris_resource_configure_aux()
642 } else if (isl_format_supports_ccs_d(devinfo, res->surf.format)) { in iris_resource_configure_aux()
643 res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_D; in iris_resource_configure_aux()
647 res->aux.usage = util_last_bit(res->aux.possible_usages) - 1; in iris_resource_configure_aux()
649 res->aux.sampler_usages = res->aux.possible_usages; in iris_resource_configure_aux()
654 if (!devinfo->has_sample_with_hiz || res->surf.samples > 1) in iris_resource_configure_aux()
655 res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ); in iris_resource_configure_aux()
658 res->aux.sampler_usages &= ~(1 << ISL_AUX_USAGE_HIZ_CCS); in iris_resource_configure_aux()
661 assert(!res->aux.bo); in iris_resource_configure_aux()
663 switch (res->aux.usage) { in iris_resource_configure_aux()
666 iris_resource_disable_aux(res); in iris_resource_configure_aux()
669 return !res->mod_info || res->mod_info->aux_usage == ISL_AUX_USAGE_NONE; in iris_resource_configure_aux()
707 assert(res->aux.usage != ISL_AUX_USAGE_STC_CCS); in iris_resource_configure_aux()
709 isl_drm_modifier_get_default_aux_state(res->mod_info->modifier); in iris_resource_configure_aux()
719 res->aux.state = create_aux_state_map(res, initial_state); in iris_resource_configure_aux()
720 if (!res->aux.state) in iris_resource_configure_aux()
723 if (isl_aux_usage_has_hiz(res->aux.usage)) { in iris_resource_configure_aux()
724 for (unsigned level = 0; level < res->surf.levels; ++level) { in iris_resource_configure_aux()
725 uint32_t width = u_minify(res->surf.phys_level0_sa.width, level); in iris_resource_configure_aux()
726 uint32_t height = u_minify(res->surf.phys_level0_sa.height, level); in iris_resource_configure_aux()
732 res->aux.has_hiz |= 1 << level; in iris_resource_configure_aux()
745 iris_resource_init_aux_buf(struct iris_resource *res, in iris_resource_init_aux_buf() argument
748 void *map = iris_bo_map(NULL, res->aux.bo, MAP_WRITE | MAP_RAW); in iris_resource_init_aux_buf()
753 if (iris_resource_get_aux_state(res, 0, 0) != ISL_AUX_STATE_AUX_INVALID) { in iris_resource_init_aux_buf()
755 uint8_t memset_value = isl_aux_usage_has_mcs(res->aux.usage) ? 0xFF : 0; in iris_resource_init_aux_buf()
756 memset((char*)map + res->aux.offset, memset_value, in iris_resource_init_aux_buf()
757 res->aux.surf.size_B); in iris_resource_init_aux_buf()
760 memset((char*)map + res->aux.extra_aux.offset, in iris_resource_init_aux_buf()
761 0, res->aux.extra_aux.surf.size_B); in iris_resource_init_aux_buf()
764 memset((char *)map + res->aux.clear_color_offset, 0, in iris_resource_init_aux_buf()
767 iris_bo_unmap(res->aux.bo); in iris_resource_init_aux_buf()
770 res->aux.clear_color_bo = res->aux.bo; in iris_resource_init_aux_buf()
771 iris_bo_reference(res->aux.clear_color_bo); in iris_resource_init_aux_buf()
778 import_aux_info(struct iris_resource *res, in import_aux_info() argument
782 assert(res->bo == aux_res->aux.bo); in import_aux_info()
783 assert(res->aux.surf.row_pitch_B == aux_res->aux.surf.row_pitch_B); in import_aux_info()
784 assert(res->bo->size >= aux_res->aux.offset + res->aux.surf.size_B); in import_aux_info()
787 res->aux.bo = aux_res->aux.bo; in import_aux_info()
788 res->aux.offset = aux_res->aux.offset; in import_aux_info()
793 struct iris_resource *res) in iris_resource_finish_aux_import() argument
796 assert(iris_resource_unfinished_aux_import(res)); in iris_resource_finish_aux_import()
797 assert(!res->mod_info->supports_clear_color); in iris_resource_finish_aux_import()
805 for (struct pipe_resource *p_res = &res->base; p_res; p_res = p_res->next) { in iris_resource_finish_aux_import()
812 switch (res->external_format) { in iris_resource_finish_aux_import()
819 default: format = res->surf.format; break; in iris_resource_finish_aux_import()
841 assert(res->aux.clear_color_bo == NULL); in iris_resource_finish_aux_import()
846 res->aux.clear_color_bo = in iris_resource_finish_aux_import()
858 struct iris_resource *res = iris_alloc_resource(pscreen, templ); in iris_resource_create_for_buffer() local
866 res->internal_format = templ->format; in iris_resource_create_for_buffer()
867 res->surf.tiling = ISL_TILING_LINEAR; in iris_resource_create_for_buffer()
882 res->bo = iris_bo_alloc(screen->bufmgr, name, templ->width0, memzone); in iris_resource_create_for_buffer()
883 if (!res->bo) { in iris_resource_create_for_buffer()
884 iris_resource_destroy(pscreen, &res->base); in iris_resource_create_for_buffer()
889 iris_bo_make_external(res->bo); in iris_resource_create_for_buffer()
891 return &res->base; in iris_resource_create_for_buffer()
902 struct iris_resource *res = iris_alloc_resource(pscreen, templ); in iris_resource_create_with_modifiers() local
904 if (!res) in iris_resource_create_with_modifiers()
916 iris_resource_configure_main(screen, res, templ, modifier, 0); in iris_resource_create_with_modifiers()
931 if (!iris_resource_configure_aux(screen, res, false)) in iris_resource_create_with_modifiers()
937 uint64_t bo_size = res->surf.size_B; in iris_resource_create_with_modifiers()
940 if (res->aux.surf.size_B > 0) { in iris_resource_create_with_modifiers()
941 res->aux.offset = ALIGN(bo_size, res->aux.surf.alignment_B); in iris_resource_create_with_modifiers()
942 bo_size = res->aux.offset + res->aux.surf.size_B; in iris_resource_create_with_modifiers()
946 if (res->aux.extra_aux.surf.size_B > 0) { in iris_resource_create_with_modifiers()
947 res->aux.extra_aux.offset = in iris_resource_create_with_modifiers()
948 ALIGN(bo_size, res->aux.extra_aux.surf.alignment_B); in iris_resource_create_with_modifiers()
949 bo_size = res->aux.extra_aux.offset + res->aux.extra_aux.surf.size_B; in iris_resource_create_with_modifiers()
958 if (res->aux.surf.size_B > 0) { in iris_resource_create_with_modifiers()
959 res->aux.clear_color_offset = ALIGN(bo_size, 4096); in iris_resource_create_with_modifiers()
960 bo_size = res->aux.clear_color_offset + in iris_resource_create_with_modifiers()
964 uint32_t alignment = MAX2(4096, res->surf.alignment_B); in iris_resource_create_with_modifiers()
965 res->bo = iris_bo_alloc_tiled(screen->bufmgr, name, bo_size, alignment, in iris_resource_create_with_modifiers()
967 isl_tiling_to_i915_tiling(res->surf.tiling), in iris_resource_create_with_modifiers()
968 res->surf.row_pitch_B, flags); in iris_resource_create_with_modifiers()
970 if (!res->bo) in iris_resource_create_with_modifiers()
973 if (res->aux.surf.size_B > 0) { in iris_resource_create_with_modifiers()
974 res->aux.bo = res->bo; in iris_resource_create_with_modifiers()
975 iris_bo_reference(res->aux.bo); in iris_resource_create_with_modifiers()
978 if (!iris_resource_init_aux_buf(res, clear_color_state_size)) in iris_resource_create_with_modifiers()
980 map_aux_addresses(screen, res, res->surf.format, 0); in iris_resource_create_with_modifiers()
984 iris_bo_make_external(res->bo); in iris_resource_create_with_modifiers()
986 return &res->base; in iris_resource_create_with_modifiers()
990 iris_resource_destroy(pscreen, &res->base); in iris_resource_create_with_modifiers()
1026 struct iris_resource *res = iris_alloc_resource(pscreen, templ); in iris_resource_from_user_memory() local
1027 if (!res) in iris_resource_from_user_memory()
1032 res->internal_format = templ->format; in iris_resource_from_user_memory()
1033 res->bo = iris_bo_create_userptr(bufmgr, "user", in iris_resource_from_user_memory()
1036 if (!res->bo) { in iris_resource_from_user_memory()
1037 iris_resource_destroy(pscreen, &res->base); in iris_resource_from_user_memory()
1041 util_range_add(&res->base, &res->valid_buffer_range, 0, templ->width0); in iris_resource_from_user_memory()
1043 return &res->base; in iris_resource_from_user_memory()
1056 struct iris_resource *res = iris_alloc_resource(pscreen, templ); in iris_resource_from_handle() local
1057 if (!res) in iris_resource_from_handle()
1062 res->bo = iris_bo_import_dmabuf(bufmgr, whandle->handle, in iris_resource_from_handle()
1066 res->bo = iris_bo_gem_create_from_name(bufmgr, "winsys image", in iris_resource_from_handle()
1072 if (!res->bo) in iris_resource_from_handle()
1075 res->offset = whandle->offset; in iris_resource_from_handle()
1076 res->external_format = whandle->format; in iris_resource_from_handle()
1083 whandle->modifier : tiling_to_modifier(res->bo->tiling_mode); in iris_resource_from_handle()
1086 iris_resource_configure_main(screen, res, templ, modifier, in iris_resource_from_handle()
1089 assert(res->bo->tiling_mode == in iris_resource_from_handle()
1090 isl_tiling_to_i915_tiling(res->surf.tiling)); in iris_resource_from_handle()
1092 UNUSED const bool ok = iris_resource_configure_aux(screen, res, true); in iris_resource_from_handle()
1103 res->aux.surf.row_pitch_B = whandle->stride; in iris_resource_from_handle()
1104 res->aux.offset = whandle->offset; in iris_resource_from_handle()
1105 res->aux.bo = res->bo; in iris_resource_from_handle()
1106 res->bo = NULL; in iris_resource_from_handle()
1109 return &res->base; in iris_resource_from_handle()
1112 iris_resource_destroy(pscreen, &res->base); in iris_resource_from_handle()
1120 struct iris_resource *res = (void *) resource; in iris_flush_resource() local
1121 const struct isl_drm_modifier_info *mod = res->mod_info; in iris_flush_resource()
1123 iris_resource_prepare_access(ice, res, in iris_flush_resource()
1134 struct iris_resource *res = (struct iris_resource *)resource; in iris_resource_disable_aux_on_first_query() local
1136 res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE; in iris_resource_disable_aux_on_first_query()
1143 (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) && in iris_resource_disable_aux_on_first_query()
1145 iris_resource_disable_aux(res); in iris_resource_disable_aux_on_first_query()
1161 struct iris_resource *res = (struct iris_resource *)resource; in iris_resource_get_param() local
1163 res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE; in iris_resource_get_param()
1168 if (iris_resource_unfinished_aux_import(res)) in iris_resource_get_param()
1169 iris_resource_finish_aux_import(pscreen, res); in iris_resource_get_param()
1171 struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo; in iris_resource_get_param()
1178 *value = 2 * util_format_get_num_planes(res->external_format); in iris_resource_get_param()
1187 *value = wants_aux ? res->aux.surf.row_pitch_B : res->surf.row_pitch_B; in iris_resource_get_param()
1190 *value = wants_aux ? res->aux.offset : 0; in iris_resource_get_param()
1193 *value = res->mod_info ? res->mod_info->modifier : in iris_resource_get_param()
1194 tiling_to_modifier(res->bo->tiling_mode); in iris_resource_get_param()
1232 struct iris_resource *res = (struct iris_resource *)resource; in iris_resource_get_handle() local
1234 res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE; in iris_resource_get_handle()
1240 assert(res->aux.bo); in iris_resource_get_handle()
1241 bo = res->aux.bo; in iris_resource_get_handle()
1242 whandle->stride = res->aux.surf.row_pitch_B; in iris_resource_get_handle()
1243 whandle->offset = res->aux.offset; in iris_resource_get_handle()
1246 whandle->stride = res->surf.row_pitch_B; in iris_resource_get_handle()
1247 bo = res->bo; in iris_resource_get_handle()
1250 whandle->format = res->external_format; in iris_resource_get_handle()
1252 res->mod_info ? res->mod_info->modifier in iris_resource_get_handle()
1253 : tiling_to_modifier(res->bo->tiling_mode); in iris_resource_get_handle()
1257 usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH ? res->aux.usage : in iris_resource_get_handle()
1258 res->mod_info ? res->mod_info->aux_usage : ISL_AUX_USAGE_NONE; in iris_resource_get_handle()
1260 if (res->aux.usage != allowed_usage) { in iris_resource_get_handle()
1261 enum isl_aux_state aux_state = iris_resource_get_aux_state(res, 0, 0); in iris_resource_get_handle()
1291 struct iris_resource *res) in resource_is_busy() argument
1293 bool busy = iris_bo_busy(res->bo); in resource_is_busy()
1296 busy |= iris_batch_references(&ice->batches[i], res->bo); in resource_is_busy()
1307 struct iris_resource *res = (void *) resource; in iris_invalidate_resource() local
1313 if (res->valid_buffer_range.start > res->valid_buffer_range.end) in iris_invalidate_resource()
1316 if (!resource_is_busy(ice, res)) { in iris_invalidate_resource()
1320 util_range_set_empty(&res->valid_buffer_range); in iris_invalidate_resource()
1327 if (res->bo->userptr) in iris_invalidate_resource()
1331 if (res->bind_history & PIPE_BIND_STREAM_OUTPUT) in iris_invalidate_resource()
1334 struct iris_bo *old_bo = res->bo; in iris_invalidate_resource()
1336 iris_bo_alloc(screen->bufmgr, res->bo->name, resource->width0, in iris_invalidate_resource()
1342 res->bo = new_bo; in iris_invalidate_resource()
1347 screen->vtbl.rebind_buffer(ice, res); in iris_invalidate_resource()
1349 util_range_set_empty(&res->valid_buffer_range); in iris_invalidate_resource()
1397 struct iris_resource *res = (void *) xfer->resource; in iris_map_copy_region() local
1410 .format = res->internal_format, in iris_map_copy_region()
1511 iris_resource_get_aligned_offset(const struct iris_resource *res, in iris_resource_get_aligned_offset() argument
1514 const struct isl_format_layout *fmtl = isl_format_get_layout(res->surf.format); in iris_resource_get_aligned_offset()
1516 uint32_t pitch = res->surf.row_pitch_B; in iris_resource_get_aligned_offset()
1518 switch (res->surf.tiling) { in iris_resource_get_aligned_offset()
1545 iris_resource_get_tile_offsets(const struct iris_resource *res, in iris_resource_get_tile_offsets() argument
1552 const struct isl_format_layout *fmtl = isl_format_get_layout(res->surf.format); in iris_resource_get_tile_offsets()
1555 iris_resource_get_tile_masks(res->surf.tiling, cpp, &mask_x, &mask_y); in iris_resource_get_tile_offsets()
1556 get_image_offset_el(&res->surf, level, z, &x, &y); in iris_resource_get_tile_offsets()
1561 return iris_resource_get_aligned_offset(res, x & ~mask_x, y & ~mask_y); in iris_resource_get_tile_offsets()
1614 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_unmap_s8() local
1615 struct isl_surf *surf = &res->surf; in iris_unmap_s8()
1620 iris_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS); in iris_unmap_s8()
1646 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_map_s8() local
1647 struct isl_surf *surf = &res->surf; in iris_map_s8()
1667 iris_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS); in iris_map_s8()
1718 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_unmap_tiled_memcpy() local
1719 struct isl_surf *surf = &res->surf; in iris_unmap_tiled_memcpy()
1725 iris_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS); in iris_unmap_tiled_memcpy()
1747 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_map_tiled_memcpy() local
1748 struct isl_surf *surf = &res->surf; in iris_map_tiled_memcpy()
1769 iris_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS); in iris_map_tiled_memcpy()
1792 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_map_direct() local
1794 void *ptr = iris_bo_map(map->dbg, res->bo, xfer->usage & MAP_FLAGS); in iris_map_direct()
1796 if (res->base.target == PIPE_BUFFER) { in iris_map_direct()
1802 struct isl_surf *surf = &res->surf; in iris_map_direct()
1818 can_promote_to_async(const struct iris_resource *res, in can_promote_to_async() argument
1826 return res->base.target == PIPE_BUFFER && (usage & PIPE_MAP_WRITE) && in can_promote_to_async()
1828 !util_ranges_intersect(&res->valid_buffer_range, box->x, in can_promote_to_async()
1841 struct iris_resource *res = (struct iris_resource *)resource; in iris_transfer_map() local
1842 struct isl_surf *surf = &res->surf; in iris_transfer_map()
1844 if (iris_resource_unfinished_aux_import(res)) in iris_transfer_map()
1845 iris_resource_finish_aux_import(ctx->screen, res); in iris_transfer_map()
1858 can_promote_to_async(res, box, usage)) { in iris_transfer_map()
1866 resource_is_busy(ice, res) || in iris_transfer_map()
1867 iris_has_invalid_primary(res, level, 1, box->z, box->depth); in iris_transfer_map()
1894 util_ranges_intersect(&res->valid_buffer_range, box->x, in iris_transfer_map()
1898 util_range_add(&res->base, &res->valid_buffer_range, box->x, box->x + box->width); in iris_transfer_map()
1920 !iris_has_invalid_primary(res, level, 1, box->z, box->depth)) { in iris_transfer_map()
1929 res->aux.usage != ISL_AUX_USAGE_CCS_E && in iris_transfer_map()
1930 res->aux.usage != ISL_AUX_USAGE_GEN12_CCS_E) { in iris_transfer_map()
1945 iris_resource_access_raw(ice, res, level, box->z, box->depth, in iris_transfer_map()
1951 if (iris_batch_references(&ice->batches[i], res->bo)) in iris_transfer_map()
1975 struct iris_resource *res = (struct iris_resource *) xfer->resource; in iris_transfer_flush_region() local
1983 if (res->base.target == PIPE_BUFFER) { in iris_transfer_flush_region()
1988 history_flush |= iris_flush_bits_for_history(ice, res); in iris_transfer_flush_region()
1990 util_range_add(&res->base, &res->valid_buffer_range, box->x, box->x + box->width); in iris_transfer_flush_region()
2008 iris_dirty_for_history(ice, res); in iris_transfer_flush_region()
2052 struct iris_resource *res = (struct iris_resource *)resource; in iris_texture_subdata() local
2053 const struct isl_surf *surf = &res->surf; in iris_texture_subdata()
2057 if (iris_resource_unfinished_aux_import(res)) in iris_texture_subdata()
2058 iris_resource_finish_aux_import(ctx->screen, res); in iris_texture_subdata()
2068 (isl_aux_usage_has_ccs(res->aux.usage) && in iris_texture_subdata()
2069 res->aux.usage != ISL_AUX_USAGE_CCS_D) || in iris_texture_subdata()
2070 resource_is_busy(ice, res)) { in iris_texture_subdata()
2077 iris_resource_access_raw(ice, res, level, box->z, box->depth, true); in iris_texture_subdata()
2080 if (iris_batch_references(&ice->batches[i], res->bo)) in iris_texture_subdata()
2084 uint8_t *dst = iris_bo_map(&ice->dbg, res->bo, MAP_WRITE | MAP_RAW); in iris_texture_subdata()
2119 struct iris_resource *res) in iris_dirty_for_history() argument
2123 if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER) { in iris_dirty_for_history()
2124 stage_dirty |= ((uint64_t)res->bind_stages) in iris_dirty_for_history()
2137 struct iris_resource *res) in iris_flush_bits_for_history() argument
2143 if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER) { in iris_flush_bits_for_history()
2150 if (res->bind_history & PIPE_BIND_SAMPLER_VIEW) in iris_flush_bits_for_history()
2153 if (res->bind_history & (PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) in iris_flush_bits_for_history()
2156 if (res->bind_history & (PIPE_BIND_SHADER_BUFFER | PIPE_BIND_SHADER_IMAGE)) in iris_flush_bits_for_history()
2165 struct iris_resource *res, in iris_flush_and_dirty_for_history() argument
2169 if (res->base.target != PIPE_BUFFER) in iris_flush_and_dirty_for_history()
2172 uint32_t flush = iris_flush_bits_for_history(ice, res) | extra_flags; in iris_flush_and_dirty_for_history()
2176 iris_dirty_for_history(ice, res); in iris_flush_and_dirty_for_history()
2181 struct iris_resource *res, in iris_resource_set_clear_color() argument
2184 if (memcmp(&res->aux.clear_color, &color, sizeof(color)) != 0) { in iris_resource_set_clear_color()
2185 res->aux.clear_color = color; in iris_resource_set_clear_color()
2193 iris_resource_get_clear_color(const struct iris_resource *res, in iris_resource_get_clear_color() argument
2197 assert(res->aux.bo); in iris_resource_get_clear_color()
2200 *clear_color_bo = res->aux.clear_color_bo; in iris_resource_get_clear_color()
2202 *clear_color_offset = res->aux.clear_color_offset; in iris_resource_get_clear_color()
2203 return res->aux.clear_color; in iris_resource_get_clear_color()
2209 struct iris_resource *res = (void *) p_res; in iris_resource_get_internal_format() local
2210 return res->internal_format; in iris_resource_get_internal_format()