Lines Matching refs:tx
339 struct nvc0_transfer *tx; in nvc0_miptree_transfer_new() local
346 tx = CALLOC_STRUCT(nvc0_transfer); in nvc0_miptree_transfer_new()
347 if (!tx) in nvc0_miptree_transfer_new()
350 pipe_resource_reference(&tx->base.resource, res); in nvc0_miptree_transfer_new()
352 tx->base.level = level; in nvc0_miptree_transfer_new()
353 tx->base.usage = usage; in nvc0_miptree_transfer_new()
354 tx->base.box = *box; in nvc0_miptree_transfer_new()
357 tx->nblocksx = box->width << mt->ms_x; in nvc0_miptree_transfer_new()
358 tx->nblocksy = box->height << mt->ms_y; in nvc0_miptree_transfer_new()
360 tx->nblocksx = util_format_get_nblocksx(res->format, box->width); in nvc0_miptree_transfer_new()
361 tx->nblocksy = util_format_get_nblocksy(res->format, box->height); in nvc0_miptree_transfer_new()
363 tx->nlayers = box->depth; in nvc0_miptree_transfer_new()
365 tx->base.stride = tx->nblocksx * util_format_get_blocksize(res->format); in nvc0_miptree_transfer_new()
366 tx->base.layer_stride = tx->nblocksy * tx->base.stride; in nvc0_miptree_transfer_new()
368 nv50_m2mf_rect_setup(&tx->rect[0], res, level, box->x, box->y, box->z); in nvc0_miptree_transfer_new()
370 size = tx->base.layer_stride; in nvc0_miptree_transfer_new()
373 size * tx->nlayers, NULL, &tx->rect[1].bo); in nvc0_miptree_transfer_new()
375 FREE(tx); in nvc0_miptree_transfer_new()
379 tx->rect[1].cpp = tx->rect[0].cpp; in nvc0_miptree_transfer_new()
380 tx->rect[1].width = tx->nblocksx; in nvc0_miptree_transfer_new()
381 tx->rect[1].height = tx->nblocksy; in nvc0_miptree_transfer_new()
382 tx->rect[1].depth = 1; in nvc0_miptree_transfer_new()
383 tx->rect[1].pitch = tx->base.stride; in nvc0_miptree_transfer_new()
384 tx->rect[1].domain = NOUVEAU_BO_GART; in nvc0_miptree_transfer_new()
387 unsigned base = tx->rect[0].base; in nvc0_miptree_transfer_new()
388 unsigned z = tx->rect[0].z; in nvc0_miptree_transfer_new()
390 for (i = 0; i < tx->nlayers; ++i) { in nvc0_miptree_transfer_new()
391 nvc0->m2mf_copy_rect(nvc0, &tx->rect[1], &tx->rect[0], in nvc0_miptree_transfer_new()
392 tx->nblocksx, tx->nblocksy); in nvc0_miptree_transfer_new()
394 tx->rect[0].z++; in nvc0_miptree_transfer_new()
396 tx->rect[0].base += mt->layer_stride; in nvc0_miptree_transfer_new()
397 tx->rect[1].base += size; in nvc0_miptree_transfer_new()
399 tx->rect[0].z = z; in nvc0_miptree_transfer_new()
400 tx->rect[0].base = base; in nvc0_miptree_transfer_new()
401 tx->rect[1].base = 0; in nvc0_miptree_transfer_new()
404 return &tx->base; in nvc0_miptree_transfer_new()
412 struct nvc0_transfer *tx = (struct nvc0_transfer *)transfer; in nvc0_miptree_transfer_del() local
413 struct nv50_miptree *mt = nv50_miptree(tx->base.resource); in nvc0_miptree_transfer_del()
416 if (tx->base.usage & PIPE_TRANSFER_WRITE) { in nvc0_miptree_transfer_del()
417 for (i = 0; i < tx->nlayers; ++i) { in nvc0_miptree_transfer_del()
418 nvc0->m2mf_copy_rect(nvc0, &tx->rect[0], &tx->rect[1], in nvc0_miptree_transfer_del()
419 tx->nblocksx, tx->nblocksy); in nvc0_miptree_transfer_del()
421 tx->rect[0].z++; in nvc0_miptree_transfer_del()
423 tx->rect[0].base += mt->layer_stride; in nvc0_miptree_transfer_del()
424 tx->rect[1].base += tx->nblocksy * tx->base.stride; in nvc0_miptree_transfer_del()
428 nouveau_bo_ref(NULL, &tx->rect[1].bo); in nvc0_miptree_transfer_del()
431 FREE(tx); in nvc0_miptree_transfer_del()
439 struct nvc0_transfer *tx = (struct nvc0_transfer *)transfer; in nvc0_miptree_transfer_map() local
443 if (tx->rect[1].bo->map) in nvc0_miptree_transfer_map()
444 return tx->rect[1].bo->map; in nvc0_miptree_transfer_map()
451 ret = nouveau_bo_map(tx->rect[1].bo, flags, nvc0->screen->base.client); in nvc0_miptree_transfer_map()
454 return tx->rect[1].bo->map; in nvc0_miptree_transfer_map()