Home | History | Annotate | Download | only in rs

Lines Matching defs:Allocation

28 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,
42 Allocation::Allocation(Context *rsc, const Allocation *alloc, const Type *type)
54 void Allocation::operator delete(void* ptr) {
56 Allocation *a = (Allocation*) ptr;
61 Allocation * Allocation::createAllocationStrided(Context *rsc, const Type *type, uint32_t usages,
64 // Allocation objects must use allocator specified by the driver
65 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0);
68 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation");
73 Allocation *a = nullptr;
75 if (rsc->mHal.funcs.allocation.initOem != nullptr) {
76 a = new (allocMem) Allocation(rsc, type, usages, mc, nullptr);
77 success = rsc->mHal.funcs.allocation.initOem(rsc, a, type->getElement()->getHasReferences(), ptr);
79 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation Init called with USAGE_OEM but driver does not support it");
84 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr);
85 success = rsc->mHal.funcs.allocation.initStrided(rsc, a, type->getElement()->getHasReferences(), requiredAlignment);
88 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr);
89 success = rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences());
93 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure");
101 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages,
103 return Allocation::createAllocationStrided(rsc, type, usages, mc, ptr, kMinimumRSAlignment);
106 Allocation * Allocation::createAdapter(Context *rsc, const Allocation *alloc, const Type *type) {
107 // Allocation objects must use allocator specified by the driver
108 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0);
111 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation");
115 Allocation *a = new (allocMem) Allocation(rsc, alloc, type);
117 if (!rsc->mHal.funcs.allocation.initAdapter(rsc, a)) {
118 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure");
126 void Allocation::adapterOffset(Context *rsc, const uint32_t *offsets, size_t len) {
139 rsc->mHal.funcs.allocation.adapterOffset(rsc, this);
144 void Allocation::updateCache() {
153 Allocation::~Allocation() {
165 mRSC->mHal.funcs.allocation.destroy(mRSC, this);
168 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) {
169 rsc->mHal.funcs.allocation.syncAll(rsc, this, src);
172 void * Allocation::getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face,
182 if (mRSC->mHal.funcs.allocation.getPointer != nullptr) {
184 mRSC->mHal.funcs.allocation.getPointer(rsc, this, lod, face, z, array);
194 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
201 "Allocation::subData called with mismatched size expected %zu, got %zu",
208 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes);
212 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
214 rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
218 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
221 rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
225 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod,
232 "Allocation::read called with mismatched size expected %zu, got %zu",
239 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes);
242 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
251 snprintf(buf, sizeof(buf), "Allocation size mismatch, expected %zu, got %zu",
258 rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
261 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod,
269 rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
273 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t z,
302 rsc->mHal.funcs.allocation.elementData(rsc, this, x, y, z, data, cIdx, sizeBytes);
306 void Allocation::elementRead(Context *rsc, uint32_t x, uint32_t y, uint32_t z,
335 rsc->mHal.funcs.allocation.elementRead(rsc, this, x, y, z, data, cIdx, sizeBytes);
338 void Allocation::addProgramToDirty(const Program *p) {
342 void Allocation::removeProgramToDirty(const Program *p) {
352 void Allocation::dumpLOGV(const char *prefix) const {
362 ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x",
366 uint32_t Allocation::getPackedSize() const {
371 void Allocation::writePackedData(Context *rsc, const Type *type,
420 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) {
422 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this);
425 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
428 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const {
432 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this);
439 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
442 void Allocation::serialize(Context *rsc, OStream *stream) const {
458 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize);
459 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
466 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
471 "allocation loading failed due to corrupt file. (invalid id)\n");
483 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT);
486 // Number of bytes we wrote out for this allocation
493 "allocation loading failed due to corrupt file. (invalid size)\n");
502 // Read in all of our allocation data
512 void Allocation::sendDirty(const Context *rsc) const {
518 mRSC->mHal.funcs.allocation.markDirty(rsc, this);
521 void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
525 void Allocation::decRefs(const void *ptr, size_t ct, size_t startOff) const {
532 void Allocation::callUpdateCacheObject(const Context *rsc, void *dstObj) const {
533 if (rsc->mHal.funcs.allocation.updateCachedObject != nullptr) {
534 rsc->mHal.funcs.allocation.updateCachedObject(rsc, this, (rs_allocation *)dstObj);
541 void Allocation::freeChildrenUnlocked () {
542 void *ptr = mRSC->mHal.funcs.allocation.lock1D(mRSC, this);
544 mRSC->mHal.funcs.allocation.unlock1D(mRSC, this);
547 bool Allocation::freeChildren() {
556 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, int32_t len) {
559 void Allocation::resize1D(Context *rsc, uint32_t dimX) {
567 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX);
568 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
570 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences);
575 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
579 void Allocation::setupGrallocConsumer(const Context *rsc, uint32_t numAlloc) {
592 void * Allocation::getSurface(const Context *rsc) {
607 void Allocation::shareBufferQueue(const Context *rsc, const Allocation *alloc) {
620 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) {
622 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw);
625 void Allocation::ioSend(const Context *rsc) {
626 rsc->mHal.funcs.allocation.ioSend(rsc, this);
629 void Allocation::ioReceive(const Context *rsc) {
637 rsc->mHal.funcs.allocation.ioReceive(rsc, this);
648 bool Allocation::hasSameDims(const Allocation *other) const {
666 Allocation *a = static_cast<Allocation *>(va);
672 Allocation *alloc = static_cast<Allocation *>(va);
673 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc);
677 Allocation *a = static_cast<Allocation *>(va);
685 Allocation *a = static_cast<Allocation *>(va);
691 Allocation *a = static_cast<Allocation *>(va);
697 Allocation *a = static_cast<Allocation *>(va);
703 Allocation *a = static_cast<Allocation *>(va);
709 Allocation *a = static_cast<Allocation *>(va);
715 Allocation *a = static_cast<Allocation *>(va);
730 Allocation *a = static_cast<Allocation *>(va);
735 Allocation *a = static_cast<Allocation *>(va);
742 Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mipmaps, (void*)ptr);
754 Allocation * alloc = Allocation::createAllocationStrided(rsc, static_cast<Type *>(vtype), usages, mipmaps,
769 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
771 ALOGE("Memory allocation failure");
778 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
790 // Cubemap allocation's faces should be Width by Width each.
794 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
796 ALOGE("Memory allocation failure");
816 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
831 Allocation *dst = static_cast<Allocation *>(dstAlloc);
832 Allocation *src= static_cast<Allocation *>(srcAlloc);
833 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip,
848 Allocation *dst = static_cast<Allocation *>(dstAlloc);
849 Allocation *src= static_cast<Allocation *>(srcAlloc);
850 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip,
856 Allocation *alloc = static_cast<Allocation *>(valloc);
861 Allocation *alloc = static_cast<Allocation *>(valloc);
867 Allocation *alloc1 = static_cast<Allocation *>(valloc1);
868 Allocation *alloc2 = static_cast<Allocation *>(valloc2);
873 Allocation *alloc = static_cast<Allocation *>(valloc);
878 Allocation *alloc = static_cast<Allocation *>(valloc);
883 Allocation *alloc = static_cast<Allocation *>(valloc);
891 Allocation *alloc = static_cast<Allocation *>(valloc);
899 Allocation *a = static_cast<Allocation *>(va);
900 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes);
905 Allocation *a = static_cast<Allocation *>(va);
912 Allocation *a = static_cast<Allocation *>(va);
920 Allocation *a = static_cast<Allocation *>(va);
927 Allocation * alloc = Allocation::createAdapter(rsc,
928 static_cast<Allocation *>(vbase), static_cast<Type *>(vwindow));
937 Allocation *a = static_cast<Allocation *>(va);