Lines Matching refs:tx

259    struct nv50_transfer *tx;  in nv50_miptree_transfer_new()  local
266 tx = CALLOC_STRUCT(nv50_transfer); in nv50_miptree_transfer_new()
267 if (!tx) in nv50_miptree_transfer_new()
270 pipe_resource_reference(&tx->base.resource, res); in nv50_miptree_transfer_new()
272 tx->base.level = level; in nv50_miptree_transfer_new()
273 tx->base.usage = usage; in nv50_miptree_transfer_new()
274 tx->base.box = *box; in nv50_miptree_transfer_new()
277 tx->nblocksx = box->width << mt->ms_x; in nv50_miptree_transfer_new()
278 tx->nblocksy = box->height << mt->ms_x; in nv50_miptree_transfer_new()
280 tx->nblocksx = util_format_get_nblocksx(res->format, box->width); in nv50_miptree_transfer_new()
281 tx->nblocksy = util_format_get_nblocksy(res->format, box->height); in nv50_miptree_transfer_new()
284 tx->base.stride = tx->nblocksx * util_format_get_blocksize(res->format); in nv50_miptree_transfer_new()
285 tx->base.layer_stride = tx->nblocksy * tx->base.stride; in nv50_miptree_transfer_new()
287 nv50_m2mf_rect_setup(&tx->rect[0], res, level, box->x, box->y, box->z); in nv50_miptree_transfer_new()
289 size = tx->base.layer_stride; in nv50_miptree_transfer_new()
292 size * tx->base.box.depth, NULL, &tx->rect[1].bo); in nv50_miptree_transfer_new()
294 FREE(tx); in nv50_miptree_transfer_new()
298 tx->rect[1].cpp = tx->rect[0].cpp; in nv50_miptree_transfer_new()
299 tx->rect[1].width = tx->nblocksx; in nv50_miptree_transfer_new()
300 tx->rect[1].height = tx->nblocksy; in nv50_miptree_transfer_new()
301 tx->rect[1].depth = 1; in nv50_miptree_transfer_new()
302 tx->rect[1].pitch = tx->base.stride; in nv50_miptree_transfer_new()
303 tx->rect[1].domain = NOUVEAU_BO_GART; in nv50_miptree_transfer_new()
306 unsigned base = tx->rect[0].base; in nv50_miptree_transfer_new()
307 unsigned z = tx->rect[0].z; in nv50_miptree_transfer_new()
310 nv50_m2mf_transfer_rect(nv50, &tx->rect[1], &tx->rect[0], in nv50_miptree_transfer_new()
311 tx->nblocksx, tx->nblocksy); in nv50_miptree_transfer_new()
313 tx->rect[0].z++; in nv50_miptree_transfer_new()
315 tx->rect[0].base += mt->layer_stride; in nv50_miptree_transfer_new()
316 tx->rect[1].base += size; in nv50_miptree_transfer_new()
318 tx->rect[0].z = z; in nv50_miptree_transfer_new()
319 tx->rect[0].base = base; in nv50_miptree_transfer_new()
320 tx->rect[1].base = 0; in nv50_miptree_transfer_new()
323 return &tx->base; in nv50_miptree_transfer_new()
331 struct nv50_transfer *tx = (struct nv50_transfer *)transfer; in nv50_miptree_transfer_del() local
332 struct nv50_miptree *mt = nv50_miptree(tx->base.resource); in nv50_miptree_transfer_del()
335 if (tx->base.usage & PIPE_TRANSFER_WRITE) { in nv50_miptree_transfer_del()
336 for (i = 0; i < tx->base.box.depth; ++i) { in nv50_miptree_transfer_del()
337 nv50_m2mf_transfer_rect(nv50, &tx->rect[0], &tx->rect[1], in nv50_miptree_transfer_del()
338 tx->nblocksx, tx->nblocksy); in nv50_miptree_transfer_del()
340 tx->rect[0].z++; in nv50_miptree_transfer_del()
342 tx->rect[0].base += mt->layer_stride; in nv50_miptree_transfer_del()
343 tx->rect[1].base += tx->nblocksy * tx->base.stride; in nv50_miptree_transfer_del()
347 nouveau_bo_ref(NULL, &tx->rect[1].bo); in nv50_miptree_transfer_del()
350 FREE(tx); in nv50_miptree_transfer_del()
358 struct nv50_transfer *tx = (struct nv50_transfer *)transfer; in nv50_miptree_transfer_map() local
362 if (tx->rect[1].bo->map) in nv50_miptree_transfer_map()
363 return tx->rect[1].bo->map; in nv50_miptree_transfer_map()
370 ret = nouveau_bo_map(tx->rect[1].bo, flags, screen->base.client); in nv50_miptree_transfer_map()
373 return tx->rect[1].bo->map; in nv50_miptree_transfer_map()