Home | History | Annotate | Download | only in src

Lines Matching full:buf

165     node->buf = item;
358 wsbmBOWaitIdle(struct _WsbmBufferObject *buf, int lazy)
362 storage = buf->storage;
370 wsbmBOMap(struct _WsbmBufferObject *buf, unsigned mode)
372 struct _WsbmBufStorage *storage = buf->storage;
382 wsbmBOUnmap(struct _WsbmBufferObject *buf)
384 struct _WsbmBufStorage *storage = buf->storage;
393 wsbmBOSyncForCpu(struct _WsbmBufferObject *buf, unsigned mode)
395 struct _WsbmBufStorage *storage = buf->storage;
401 wsbmBOReleaseFromCpu(struct _WsbmBufferObject *buf, unsigned mode)
403 struct _WsbmBufStorage *storage = buf->storage;
409 wsbmBOOffsetHint(struct _WsbmBufferObject *buf)
411 struct _WsbmBufStorage *storage = buf->storage;
417 wsbmBOPoolOffset(struct _WsbmBufferObject *buf)
419 struct _WsbmBufStorage *storage = buf->storage;
425 wsbmBOPlacementHint(struct _WsbmBufferObject * buf)
427 struct _WsbmBufStorage *storage = buf->storage;
429 assert(buf->storage != NULL);
435 wsbmBOReference(struct _WsbmBufferObject *buf)
437 if (buf->bufferType == WSBM_BUFFER_SIMPLE) {
438 wsbmAtomicInc(&buf->storage->refCount);
440 wsbmAtomicInc(&buf->refCount);
442 return buf;
446 wsbmBOSetStatus(struct _WsbmBufferObject *buf,
449 struct _WsbmBufStorage *storage = buf->storage;
463 struct _WsbmBufferObject *buf = *p_buf;
467 if (!buf)
470 if (buf->bufferType == WSBM_BUFFER_SIMPLE) {
471 struct _WsbmBufStorage *dummy = buf->storage;
477 if (wsbmAtomicDecZero(&buf->refCount)) {
478 wsbmBufStorageUnref(&buf->storage);
479 free(buf);
484 wsbmBOData(struct _WsbmBufferObject *buf,
496 if (buf->bufferType == WSBM_BUFFER_SIMPLE)
499 storage = buf->storage;
502 newPool = buf->pool;
513 placement = buf->placement;
516 if (buf->bufferType == WSBM_BUFFER_REF)
519 wsbmBufStorageUnref(&buf->storage);
522 buf->pool = newPool;
523 buf->placement = placement;
528 buf->storage =
529 newPool->create(newPool, size, placement, buf->alignment);
530 if (!buf->storage) {
535 buf->placement = placement;
536 buf->pool = newPool;
549 curPool->create(curPool, size, placement, buf->alignment);
552 wsbmBufStorageUnref(&buf->storage);
553 buf->storage = tmp_storage;
554 buf->placement = placement;
564 placement_diff = placement ^ buf->placement;
570 storage = buf->storage;
582 buf->placement = placement;
587 retval = curPool->syncforcpu(buf->storage, WSBM_SYNCCPU_WRITE);
594 storage = buf->storage;
614 wsbmBODataUB(struct _WsbmBufferObject *buf,
629 if (buf->bufferType == WSBM_BUFFER_SIMPLE)
632 storage = buf->storage;
635 newPool = buf->pool;
646 placement = buf->placement;
649 if (buf->bufferType == WSBM_BUFFER_REF)
652 wsbmBufStorageUnref(&buf->storage);
655 buf->pool = newPool;
656 buf->placement = placement;
661 buf->storage =
662 ttm_pool_ub_create(newPool, size, placement, buf->alignment, user_ptr, fd);
663 if (!buf->storage) {
668 buf->placement = placement;
669 buf->pool = newPool;
684 ttm_pool_ub_create(curPool, size, placement, buf->alignment, user_ptr, fd);
687 wsbmBufStorageUnref(&buf->storage);
688 buf->storage = tmp_storage;
689 buf->placement = placement;
700 placement_diff = placement ^ buf->placement;
706 storage = buf->storage;
718 buf->placement = placement;
722 retval = curPool->syncforcpu(buf->storage, WSBM_SYNCCPU_WRITE);
728 storage = buf
744 wsbmStorageClone(struct _WsbmBufferObject *buf)
746 struct _WsbmBufStorage *storage = buf->storage;
749 return pool->create(pool, pool->size(storage), buf->placement,
750 buf->alignment);
754 wsbmBOClone(struct _WsbmBufferObject *buf,
765 *newBuf = *buf;
766 newBuf->storage = wsbmStorageClone(buf);
771 if (!accelCopy || accelCopy(newBuf, buf) != 0) {
773 struct _WsbmBufferPool *pool = buf->storage->pool;
774 struct _WsbmBufStorage *storage = buf->storage;
791 pool->unmap(buf->storage);
797 buf->pool->unmap(buf->storage);
799 buf->pool->releasefromcpu(buf->storage, WSBM_SYNCCPU_READ);
808 wsbmBOSubData(struct _WsbmBufferObject *buf,
815 if (buf->bufferType == WSBM_BUFFER_SIMPLE)
820 struct _WsbmBufStorage *storage = buf->storage;
838 newBuf = wsbmBOClone(buf, accelCopy);
850 wsbmBufStorageUnref(&buf->storage);
851 buf->storage = storage;
876 wsbmBOGetSubData(struct _WsbmBufferObject *buf,
883 struct _WsbmBufStorage *storage = buf->storage;
903 wsbmBOSetReferenced(struct _WsbmBufferObject *buf, unsigned long handle)
907 wsbmBufStorageUnref(&buf->storage);
908 if (buf->pool->createByReference == NULL) {
912 buf->storage = buf->pool->createByReference(buf->pool, handle);
913 if (!buf->storage) {
917 buf->bufferType = WSBM_BUFFER_REF;
934 struct _WsbmBufferObject *buf;
937 *offset = (sizeof(*buf) + 15) & ~15;
940 extra_size += *offset - sizeof(*buf);
943 buf = (struct _WsbmBufferObject *)calloc(1, sizeof(*buf) + extra_size);
944 if (!buf)
952 storage->destroyArg = buf;
954 buf->storage = storage;
955 buf->alignment = alignment;
956 buf->pool = pool;
957 buf->placement = placement;
958 buf->bufferType = WSBM_BUFFER_SIMPLE;
960 return buf;
963 free(buf);
973 struct _WsbmBufferObject *buf;
980 buf = (struct _WsbmBufferObject *)calloc(1, sizeof(*buf));
981 if (!buf)
984 wsbmAtomicSet(&buf->refCount, 1);
985 buf->placement = placement;
986 buf->alignment = alignment;
987 buf->pool = pool;
988 buf->bufferType = WSBM_BUFFER_COMPLEX;
989 buffers[i] = buf;
1056 wsbmAddValidateItem(struct _ValidateList *list, void *buf, uint64_t flags,
1065 uint32_t key = (unsigned long) buf;
1076 if (node->buf == buf) {
1083 cur = validateListAddNode(list, buf, hash, flags, mask);
1120 struct _WsbmBufferObject *buf,
1125 struct _WsbmBufStorage *storage = buf->storage;
1156 wsbmBOFence(struct _WsbmBufferObject *buf, struct _WsbmFenceObject *fence)
1160 storage = buf->storage;
1167 wsbmBOOnList(const struct _WsbmBufferObject *buf)
1169 if (buf->storage == NULL)
1171 return wsbmAtomicRead(&buf->storage->onList);
1183 storage = (struct _WsbmBufStorage *)(validateListNode(curBuf)->buf);
1207 storage = (struct _WsbmBufStorage *)(validateListNode(curBuf)->buf);
1234 storage = (struct _WsbmBufStorage *)node->buf;
1261 storage = (struct _WsbmBufStorage *)node->buf;
1280 wsbmBOSize(struct _WsbmBufferObject *buf)
1285 storage = buf->storage;
1352 wsbmKBuf(const struct _WsbmBufferObject *buf)
1354 struct _WsbmBufStorage *storage = buf->storage;