Lines Matching refs:ptrans
76 struct pipe_transfer *ptrans) in vc4_resource_transfer_unmap() argument
79 struct vc4_transfer *trans = vc4_transfer(ptrans); in vc4_resource_transfer_unmap()
88 rsc = vc4_resource(ptrans->resource); in vc4_resource_transfer_unmap()
89 slice = &rsc->slices[ptrans->level]; in vc4_resource_transfer_unmap()
92 if (ptrans->usage & PIPE_TRANSFER_WRITE) { in vc4_resource_transfer_unmap()
94 ptrans->box.z * rsc->cube_map_stride, in vc4_resource_transfer_unmap()
96 trans->map, ptrans->stride, in vc4_resource_transfer_unmap()
98 &ptrans->box); in vc4_resource_transfer_unmap()
103 if (trans->ss_resource && (ptrans->usage & PIPE_TRANSFER_WRITE)) { in vc4_resource_transfer_unmap()
113 blit.dst.resource = ptrans->resource; in vc4_resource_transfer_unmap()
114 blit.dst.format = ptrans->resource->format; in vc4_resource_transfer_unmap()
115 blit.dst.level = ptrans->level; in vc4_resource_transfer_unmap()
118 blit.mask = util_format_get_mask(ptrans->resource->format); in vc4_resource_transfer_unmap()
126 pipe_resource_reference(&ptrans->resource, NULL); in vc4_resource_transfer_unmap()
127 slab_free(&vc4->transfer_pool, ptrans); in vc4_resource_transfer_unmap()
158 struct pipe_transfer *ptrans; in vc4_resource_transfer_map() local
214 ptrans = &trans->base; in vc4_resource_transfer_map()
216 pipe_resource_reference(&ptrans->resource, prsc); in vc4_resource_transfer_map()
217 ptrans->level = level; in vc4_resource_transfer_map()
218 ptrans->usage = usage; in vc4_resource_transfer_map()
219 ptrans->box = *box; in vc4_resource_transfer_map()
239 blit.src.resource = ptrans->resource; in vc4_resource_transfer_map()
240 blit.src.format = ptrans->resource->format; in vc4_resource_transfer_map()
241 blit.src.level = ptrans->level; in vc4_resource_transfer_map()
260 ptrans->box.x = 0; in vc4_resource_transfer_map()
261 ptrans->box.y = 0; in vc4_resource_transfer_map()
262 ptrans->box.z = 0; in vc4_resource_transfer_map()
274 *pptrans = ptrans; in vc4_resource_transfer_map()
293 assert(!(ptrans->box.x & 3)); in vc4_resource_transfer_map()
294 assert(!(ptrans->box.y & 3)); in vc4_resource_transfer_map()
295 ptrans->box.x >>= 2; in vc4_resource_transfer_map()
296 ptrans->box.y >>= 2; in vc4_resource_transfer_map()
297 ptrans->box.width = (ptrans->box.width + 3) >> 2; in vc4_resource_transfer_map()
298 ptrans->box.height = (ptrans->box.height + 3) >> 2; in vc4_resource_transfer_map()
307 uint32_t box_start_x = ptrans->box.x & (utile_w - 1); in vc4_resource_transfer_map()
308 uint32_t box_start_y = ptrans->box.y & (utile_h - 1); in vc4_resource_transfer_map()
312 ptrans->box.width += box_start_x; in vc4_resource_transfer_map()
313 ptrans->box.x -= box_start_x; in vc4_resource_transfer_map()
317 ptrans->box.height += box_start_y; in vc4_resource_transfer_map()
318 ptrans->box.y -= box_start_y; in vc4_resource_transfer_map()
321 if (ptrans->box.width & (utile_w - 1)) { in vc4_resource_transfer_map()
327 if (ptrans->box.x + ptrans->box.width != slice_width) in vc4_resource_transfer_map()
329 ptrans->box.width = align(ptrans->box.width, utile_w); in vc4_resource_transfer_map()
331 if (ptrans->box.height & (utile_h - 1)) { in vc4_resource_transfer_map()
333 if (ptrans->box.y + ptrans->box.height != slice_height) in vc4_resource_transfer_map()
335 ptrans->box.height = align(ptrans->box.height, utile_h); in vc4_resource_transfer_map()
338 ptrans->stride = ptrans->box.width * rsc->cpp; in vc4_resource_transfer_map()
339 ptrans->layer_stride = ptrans->stride * ptrans->box.height; in vc4_resource_transfer_map()
341 trans->map = malloc(ptrans->layer_stride * ptrans->box.depth); in vc4_resource_transfer_map()
344 vc4_load_tiled_image(trans->map, ptrans->stride, in vc4_resource_transfer_map()
346 ptrans->box.z * rsc->cube_map_stride, in vc4_resource_transfer_map()
349 &ptrans->box); in vc4_resource_transfer_map()
353 box_start_y * ptrans->stride); in vc4_resource_transfer_map()
355 ptrans->stride = slice->stride; in vc4_resource_transfer_map()
356 ptrans->layer_stride = ptrans->stride; in vc4_resource_transfer_map()
359 ptrans->box.y / util_format_get_blockheight(format) * ptrans->stride + in vc4_resource_transfer_map()
360 ptrans->box.x / util_format_get_blockwidth(format) * rsc->cpp + in vc4_resource_transfer_map()
361 ptrans->box.z * rsc->cube_map_stride; in vc4_resource_transfer_map()
366 vc4_resource_transfer_unmap(pctx, ptrans); in vc4_resource_transfer_map()