Lines Matching refs:ptrans
121 struct pipe_transfer *ptrans) in vc5_resource_transfer_unmap() argument
124 struct vc5_transfer *trans = vc5_transfer(ptrans); in vc5_resource_transfer_unmap()
127 struct vc5_resource *rsc = vc5_resource(ptrans->resource); in vc5_resource_transfer_unmap()
128 struct vc5_resource_slice *slice = &rsc->slices[ptrans->level]; in vc5_resource_transfer_unmap()
130 if (ptrans->usage & PIPE_TRANSFER_WRITE) { in vc5_resource_transfer_unmap()
132 ptrans->box.z * rsc->cube_map_stride, in vc5_resource_transfer_unmap()
134 trans->map, ptrans->stride, in vc5_resource_transfer_unmap()
137 ptrans->level), in vc5_resource_transfer_unmap()
138 &ptrans->box); in vc5_resource_transfer_unmap()
143 pipe_resource_reference(&ptrans->resource, NULL); in vc5_resource_transfer_unmap()
144 slab_free(&vc5->transfer_pool, ptrans); in vc5_resource_transfer_unmap()
157 struct pipe_transfer *ptrans; in vc5_resource_transfer_map() local
219 ptrans = &trans->base; in vc5_resource_transfer_map()
221 pipe_resource_reference(&ptrans->resource, prsc); in vc5_resource_transfer_map()
222 ptrans->level = level; in vc5_resource_transfer_map()
223 ptrans->usage = usage; in vc5_resource_transfer_map()
224 ptrans->box = *box; in vc5_resource_transfer_map()
239 *pptrans = ptrans; in vc5_resource_transfer_map()
242 ptrans->box.x /= util_format_get_blockwidth(format); in vc5_resource_transfer_map()
243 ptrans->box.y /= util_format_get_blockheight(format); in vc5_resource_transfer_map()
244 ptrans->box.width = DIV_ROUND_UP(ptrans->box.width, in vc5_resource_transfer_map()
246 ptrans->box.height = DIV_ROUND_UP(ptrans->box.height, in vc5_resource_transfer_map()
257 ptrans->stride = ptrans->box.width * rsc->cpp; in vc5_resource_transfer_map()
258 ptrans->layer_stride = ptrans->stride * ptrans->box.height; in vc5_resource_transfer_map()
260 trans->map = malloc(ptrans->layer_stride * ptrans->box.depth); in vc5_resource_transfer_map()
263 vc5_load_tiled_image(trans->map, ptrans->stride, in vc5_resource_transfer_map()
265 ptrans->box.z * rsc->cube_map_stride, in vc5_resource_transfer_map()
269 &ptrans->box); in vc5_resource_transfer_map()
273 ptrans->stride = slice->stride; in vc5_resource_transfer_map()
274 ptrans->layer_stride = ptrans->stride; in vc5_resource_transfer_map()
277 ptrans->box.y * ptrans->stride + in vc5_resource_transfer_map()
278 ptrans->box.x * rsc->cpp + in vc5_resource_transfer_map()
279 ptrans->box.z * rsc->cube_map_stride; in vc5_resource_transfer_map()
284 vc5_resource_transfer_unmap(pctx, ptrans); in vc5_resource_transfer_map()