Lines Matching refs:rsrc
138 struct panfrost_resource *rsrc = (struct panfrost_resource *) pt; in panfrost_resource_get_handle() local
139 struct renderonly_scanout *scanout = rsrc->scanout; in panfrost_resource_get_handle()
141 handle->modifier = rsrc->image.layout.modifier; in panfrost_resource_get_handle()
142 rsrc->modifier_constant = true; in panfrost_resource_get_handle()
150 handle->handle = rsrc->image.data.bo->gem_handle; in panfrost_resource_get_handle()
151 handle->stride = rsrc->image.layout.slices[0].line_stride; in panfrost_resource_get_handle()
152 handle->offset = rsrc->image.layout.slices[0].offset; in panfrost_resource_get_handle()
171 int fd = panfrost_bo_export(rsrc->image.data.bo); in panfrost_resource_get_handle()
177 handle->stride = rsrc->image.layout.slices[0].line_stride; in panfrost_resource_get_handle()
178 handle->offset = rsrc->image.layout.slices[0].offset; in panfrost_resource_get_handle()
193 struct panfrost_resource *rsrc = (struct panfrost_resource *) prsc; in panfrost_resource_get_param() local
197 *value = rsrc->image.layout.slices[level].line_stride; in panfrost_resource_get_param()
200 *value = rsrc->image.layout.slices[level].offset; in panfrost_resource_get_param()
203 *value = rsrc->image.layout.modifier; in panfrost_resource_get_param()
722 struct panfrost_resource *rsrc = (struct panfrost_resource *) pt; in panfrost_resource_destroy() local
724 if (rsrc->scanout) in panfrost_resource_destroy()
725 renderonly_scanout_destroy(rsrc->scanout, dev->ro); in panfrost_resource_destroy()
727 if (rsrc->image.data.bo) in panfrost_resource_destroy()
728 panfrost_bo_unreference(rsrc->image.data.bo); in panfrost_resource_destroy()
730 if (rsrc->image.crc.bo) in panfrost_resource_destroy()
731 panfrost_bo_unreference(rsrc->image.crc.bo); in panfrost_resource_destroy()
733 free(rsrc->index_cache); in panfrost_resource_destroy()
734 free(rsrc->damage.tile_map.data); in panfrost_resource_destroy()
736 util_range_destroy(&rsrc->valid_buffer_range); in panfrost_resource_destroy()
737 free(rsrc); in panfrost_resource_destroy()
801 blit.src.resource = trans->staging.rsrc; in pan_blit_from_staging()
802 blit.src.format = pan_blit_format(trans->staging.rsrc->format); in pan_blit_from_staging()
821 blit.dst.resource = trans->staging.rsrc; in pan_blit_to_staging()
822 blit.dst.format = pan_blit_format(trans->staging.rsrc->format); in pan_blit_to_staging()
841 struct panfrost_resource *rsrc = pan_resource(resource); in panfrost_ptr_map() local
842 int bytes_per_pixel = util_format_get_blocksize(rsrc->image.layout.format); in panfrost_ptr_map()
843 struct panfrost_bo *bo = rsrc->image.data.bo; in panfrost_ptr_map()
846 if ((usage & PIPE_MAP_DIRECTLY) && rsrc->image.layout.modifier != DRM_FORMAT_MOD_LINEAR) in panfrost_ptr_map()
858 if (drm_is_afbc(rsrc->image.layout.modifier)) { in panfrost_ptr_map()
859 struct panfrost_resource *staging = pan_alloc_staging(ctx, rsrc, level, box); in panfrost_ptr_map()
869 transfer->staging.rsrc = &staging->base; in panfrost_ptr_map()
876 assert(transfer->staging.rsrc != NULL); in panfrost_ptr_map()
878 bool valid = BITSET_TEST(rsrc->valid.data, level); in panfrost_ptr_map()
880 if ((usage & PIPE_MAP_READ) && (valid || rsrc->track.nr_writers > 0)) { in panfrost_ptr_map()
903 && !util_ranges_intersect(&rsrc->valid_buffer_range, box->x, box->x + box->width)) && in panfrost_ptr_map()
904 rsrc->track.nr_users > 0) { in panfrost_ptr_map()
911 panfrost_flush_writer(ctx, rsrc, "Shadow resource creation"); in panfrost_ptr_map()
923 if (rsrc->track.nr_users > 0 || in panfrost_ptr_map()
940 … memcpy(newbo->ptr.cpu, rsrc->image.data.bo->ptr.cpu, bo->size); in panfrost_ptr_map()
943 rsrc->image.data.bo = newbo; in panfrost_ptr_map()
946 drm_is_afbc(rsrc->image.layout.modifier)) in panfrost_ptr_map()
947 panfrost_resource_init_afbc_headers(rsrc); in panfrost_ptr_map()
954 panfrost_flush_batches_accessing_rsrc(ctx, rsrc, in panfrost_ptr_map()
961 … && !util_ranges_intersect(&rsrc->valid_buffer_range, box->x, box->x + box->width)) { in panfrost_ptr_map()
965 panfrost_flush_batches_accessing_rsrc(ctx, rsrc, "Synchronized write"); in panfrost_ptr_map()
968 panfrost_flush_writer(ctx, rsrc, "Synchronized read"); in panfrost_ptr_map()
973 if (rsrc->image.layout.modifier == DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED) { in panfrost_ptr_map()
979 if ((usage & PIPE_MAP_READ) && BITSET_TEST(rsrc->valid.data, level)) { in panfrost_ptr_map()
982 bo->ptr.cpu + rsrc->image.layout.slices[level].offset, in panfrost_ptr_map()
985 rsrc->image.layout.slices[level].line_stride, in panfrost_ptr_map()
986 rsrc->image.layout.format); in panfrost_ptr_map()
991 assert (rsrc->image.layout.modifier == DRM_FORMAT_MOD_LINEAR); in panfrost_ptr_map()
999 if ((usage & dpw) == dpw && rsrc->index_cache) in panfrost_ptr_map()
1002 transfer->base.stride = rsrc->image.layout.slices[level].line_stride; in panfrost_ptr_map()
1004 panfrost_get_layer_stride(&rsrc->image.layout, level); in panfrost_ptr_map()
1010 BITSET_SET(rsrc->valid.data, level); in panfrost_ptr_map()
1011 panfrost_minmax_cache_invalidate(rsrc->index_cache, &transfer->base); in panfrost_ptr_map()
1015 + rsrc->image.layout.slices[level].offset in panfrost_ptr_map()
1017 + transfer->base.box.y * rsrc->image.layout.slices[level].line_stride in panfrost_ptr_map()
1024 struct panfrost_resource *rsrc, in pan_resource_modifier_convert() argument
1027 assert(!rsrc->modifier_constant); in pan_resource_modifier_convert()
1033 ctx->base.screen, &rsrc->base, modifier); in pan_resource_modifier_convert()
1037 unsigned depth = rsrc->base.target == PIPE_TEXTURE_3D ? in pan_resource_modifier_convert()
1038 rsrc->base.depth0 : rsrc->base.array_size; in pan_resource_modifier_convert()
1041 { 0, 0, 0, rsrc->base.width0, rsrc->base.height0, depth }; in pan_resource_modifier_convert()
1047 .src.resource = &rsrc->base, in pan_resource_modifier_convert()
1048 .src.format = pan_blit_format(rsrc->base.format), in pan_resource_modifier_convert()
1054 for (int i = 0; i <= rsrc->base.last_level; i++) { in pan_resource_modifier_convert()
1055 if (BITSET_TEST(rsrc->valid.data, i)) { in pan_resource_modifier_convert()
1061 panfrost_bo_unreference(rsrc->image.data.bo); in pan_resource_modifier_convert()
1062 if (rsrc->image.crc.bo) in pan_resource_modifier_convert()
1063 panfrost_bo_unreference(rsrc->image.crc.bo); in pan_resource_modifier_convert()
1065 rsrc->image.data.bo = tmp_rsrc->image.data.bo; in pan_resource_modifier_convert()
1066 panfrost_bo_reference(rsrc->image.data.bo); in pan_resource_modifier_convert()
1068 panfrost_resource_setup(pan_device(ctx->base.screen), rsrc, modifier, in pan_resource_modifier_convert()
1079 struct panfrost_resource *rsrc, in pan_legalize_afbc_format() argument
1084 if (!drm_is_afbc(rsrc->image.layout.modifier)) in pan_legalize_afbc_format()
1087 if (panfrost_afbc_format(dev, pan_blit_format(rsrc->base.format)) == in pan_legalize_afbc_format()
1091 pan_resource_modifier_convert(ctx, rsrc, in pan_legalize_afbc_format()
1152 if (trans->staging.rsrc) { in panfrost_ptr_unmap()
1163 … prsrc->image.data.bo = pan_resource(trans->staging.rsrc)->image.data.bo; in panfrost_ptr_unmap()
1168 pan_resource(trans->staging.rsrc), in panfrost_ptr_unmap()
1173 pipe_resource_reference(&trans->staging.rsrc, NULL); in panfrost_ptr_unmap()
1270 panfrost_resource_get_internal_format(struct pipe_resource *rsrc) in panfrost_resource_get_internal_format() argument
1272 struct panfrost_resource *prsrc = (struct panfrost_resource *) rsrc; in panfrost_resource_get_internal_format()
1286 struct panfrost_resource *rsrc = pan_resource(prsrc); in panfrost_generate_mipmap() local
1292 assert(rsrc->image.data.bo); in panfrost_generate_mipmap()
1294 BITSET_CLEAR(rsrc->valid.data, l); in panfrost_generate_mipmap()