Lines Matching refs:kbo

136     struct _WsbmSlabKernelBO *kbo;  member
235 wsbmFreeKernelBO(struct _WsbmSlabKernelBO *kbo) in wsbmFreeKernelBO() argument
240 if (!kbo) in wsbmFreeKernelBO()
243 slabPool = kbo->slabPool; in wsbmFreeKernelBO()
244 arg.handle = kbo->kBuf.handle; in wsbmFreeKernelBO()
245 (void)munmap(kbo->virtual, kbo->actualSize); in wsbmFreeKernelBO()
249 free(kbo); in wsbmFreeKernelBO()
256 struct _WsbmSlabKernelBO *kbo; in wsbmFreeTimeoutKBOsLocked() local
262 kbo = WSBMLISTENTRY(list, struct _WsbmSlabKernelBO, timeoutHead); in wsbmFreeTimeoutKBOsLocked()
264 if (!wsbmTimeAfterEq(time, &kbo->timeFreed)) in wsbmFreeTimeoutKBOsLocked()
267 WSBMLISTDELINIT(&kbo->timeoutHead); in wsbmFreeTimeoutKBOsLocked()
268 WSBMLISTDELINIT(&kbo->head); in wsbmFreeTimeoutKBOsLocked()
269 wsbmFreeKernelBO(kbo); in wsbmFreeTimeoutKBOsLocked()
284 struct _WsbmSlabKernelBO *kbo) in wsbmSetKernelBOFree() argument
293 kbo->timeFreed = timeFreed; in wsbmSetKernelBOFree()
295 if (kbo->kBuf.placement & TTM_PL_FLAG_CACHED) in wsbmSetKernelBOFree()
296 WSBMLISTADD(&kbo->head, &cache->cached); in wsbmSetKernelBOFree()
298 WSBMLISTADD(&kbo->head, &cache->unCached); in wsbmSetKernelBOFree()
300 WSBMLISTADDTAIL(&kbo->timeoutHead, &cache->timeoutList); in wsbmSetKernelBOFree()
317 struct _WsbmSlabKernelBO *kbo; in wsbmAllocKernelBO() local
332 kbo = NULL; in wsbmAllocKernelBO()
345 if (!kbo) in wsbmAllocKernelBO()
346 kbo = kboTmp; in wsbmAllocKernelBO()
348 if ((kbo->proposedPlacement ^ slabPool->proposedPlacement) == 0) in wsbmAllocKernelBO()
354 if (kbo) { in wsbmAllocKernelBO()
355 WSBMLISTDELINIT(&kbo->head); in wsbmAllocKernelBO()
356 WSBMLISTDELINIT(&kbo->timeoutHead); in wsbmAllocKernelBO()
361 if (kbo) { in wsbmAllocKernelBO()
363 kbo->proposedPlacement ^ slabPool->proposedPlacement; in wsbmAllocKernelBO()
371 req->handle = kbo->kBuf.handle; in wsbmAllocKernelBO()
378 kbo->kBuf.gpuOffset = rep->gpu_offset; in wsbmAllocKernelBO()
379 kbo->kBuf.placement = rep->placement; in wsbmAllocKernelBO()
381 kbo->proposedPlacement = slabPool->proposedPlacement; in wsbmAllocKernelBO()
385 return kbo; in wsbmAllocKernelBO()
387 wsbmFreeKernelBO(kbo); in wsbmAllocKernelBO()
388 kbo = NULL; in wsbmAllocKernelBO()
392 kbo = calloc(1, sizeof(*kbo)); in wsbmAllocKernelBO()
393 if (!kbo) in wsbmAllocKernelBO()
399 kbo->slabPool = slabPool; in wsbmAllocKernelBO()
400 WSBMINITLISTHEAD(&kbo->head); in wsbmAllocKernelBO()
401 WSBMINITLISTHEAD(&kbo->timeoutHead); in wsbmAllocKernelBO()
413 kbo->kBuf.gpuOffset = arg.rep.gpu_offset; in wsbmAllocKernelBO()
414 kbo->kBuf.placement = arg.rep.placement; in wsbmAllocKernelBO()
415 kbo->kBuf.handle = arg.rep.handle; in wsbmAllocKernelBO()
417 kbo->actualSize = arg.rep.bo_size; in wsbmAllocKernelBO()
418 kbo->mapHandle = arg.rep.map_handle; in wsbmAllocKernelBO()
419 kbo->proposedPlacement = slabPool->proposedPlacement; in wsbmAllocKernelBO()
422 kbo->virtual = mmap(0, kbo->actualSize, in wsbmAllocKernelBO()
424 slabPool->pool.fd, kbo->mapHandle); in wsbmAllocKernelBO()
426 if (kbo->virtual == MAP_FAILED) { in wsbmAllocKernelBO()
431 return kbo; in wsbmAllocKernelBO()
435 struct ttm_pl_reference_req arg = {.handle = kbo->kBuf.handle }; in wsbmAllocKernelBO()
442 free(kbo); in wsbmAllocKernelBO()
459 slab->kbo = wsbmAllocKernelBO(header); in wsbmAllocSlab()
460 if (!slab->kbo) { in wsbmAllocSlab()
465 numBuffers = slab->kbo->actualSize / header->bufSize; in wsbmAllocSlab()
486 sBuf->virtual = (void *)((uint8_t *) slab->kbo->virtual + in wsbmAllocSlab()
511 wsbmSetKernelBOFree(header->slabPool->cache, slab->kbo); in wsbmAllocSlab()
564 wsbmSetKernelBOFree(cache, slab->kbo); in wsbmSlabFreeBufferLocked()
973 return (sBuf->isSlabBuffer) ? &sBuf->parent->kbo->kBuf : &sBuf->kBuf; in pool_kernel()