Home | History | Annotate | Download | only in rs

Lines Matching refs:allocation

30 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,
44 void Allocation::operator delete(void* ptr) {
46 Allocation *a = (Allocation*) ptr;
51 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages,
53 // Allocation objects must use allocator specified by the driver
54 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0);
57 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation");
61 Allocation *a = new (allocMem) Allocation(rsc, type, usages, mc, ptr);
63 if (!rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences())) {
64 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure");
72 void Allocation::updateCache() {
81 Allocation::~Allocation() {
90 mRSC->mHal.funcs.allocation.destroy(mRSC, this);
93 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) {
94 rsc->mHal.funcs.allocation.syncAll(rsc, this, src);
97 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
102 ALOGE("Allocation::subData called with mismatched size expected %zu, got %zu",
108 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes);
112 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
114 rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
118 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
121 rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
125 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod,
130 ALOGE("Allocation::read called with mismatched size expected %zu, got %zu",
136 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes);
139 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
147 ALOGE("Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
148 rsAssert(!"Allocation::read called with mismatched size");
153 rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
156 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod,
164 rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
168 void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
173 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
179 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
187 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
192 rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, cIdx, sizeBytes);
196 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
201 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
207 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
213 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
221 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
226 rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, cIdx, sizeBytes);
230 void Allocation::addProgramToDirty(const Program *p) {
234 void Allocation::removeProgramToDirty(const Program *p) {
244 void Allocation::dumpLOGV(const char *prefix) const {
254 ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x",
258 uint32_t Allocation::getPackedSize() const {
263 void Allocation::writePackedData(Context *rsc, const Type *type,
312 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) {
314 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this);
317 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
320 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const {
325 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this);
332 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
335 void Allocation::serialize(Context *rsc, OStream *stream) const {
351 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize);
352 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
359 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
363 ALOGE("allocation loading skipped due to invalid class id\n");
375 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT);
378 // Number of bytes we wrote out for this allocation
384 ALOGE("failed to read allocation because numbytes written is not the same loaded type wants\n");
393 // Read in all of our allocation data
403 void Allocation::sendDirty(const Context *rsc) const {
409 mRSC->mHal.funcs.allocation.markDirty(rsc, this);
412 void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
416 void Allocation::decRefs(const void *ptr, size_t ct, size_t startOff) const {
423 void Allocation::freeChildrenUnlocked () {
424 void *ptr = mRSC->mHal.funcs.allocation.lock1D(mRSC, this);
426 mRSC->mHal.funcs.allocation.unlock1D(mRSC, this);
429 bool Allocation::freeChildren() {
438 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, int32_t len) {
441 void Allocation::resize1D(Context *rsc, uint32_t dimX) {
449 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX);
450 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
452 rsc->mHal.funcs.allocation
457 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
462 void Allocation::NewBufferListener::onFrameAvailable() {
468 void * Allocation::getSurface(const Context *rsc) {
485 //return rsc->mHal.funcs.allocation.getSurface(rsc, this);
488 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) {
490 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw);
493 void Allocation::ioSend(const Context *rsc) {
494 rsc->mHal.funcs.allocation.ioSend(rsc, this);
497 void Allocation::ioReceive(const Context *rsc) {
505 rsc->mHal.funcs.allocation.ioReceive(rsc, this);
524 Allocation *a = static_cast<Allocation *>(va);
530 Allocation *alloc = static_cast<Allocation *>(va);
531 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc);
535 Allocation *a = static_cast<Allocation *>(va);
543 Allocation *a = static_cast<Allocation *>(va);
549 Allocation *a = static_cast<Allocation *>(va);
555 Allocation *a = static_cast<Allocation *>(va);
561 Allocation *a = static_cast<Allocation *>(va);
567 Allocation *a = static_cast<Allocation *>(va);
573 Allocation *a = static_cast<Allocation *>(va);
585 Allocation *a = static_cast<Allocation *>(va);
590 Allocation *a = static_cast<Allocation *>(va);
597 Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mips, (void*)ptr);
611 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
613 ALOGE("Memory allocation failure");
620 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
632 // Cubemap allocation's faces should be Width by Width each.
636 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
638 ALOGE("Memory allocation failure");
658 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
673 Allocation *dst = static_cast<Allocation *>(dstAlloc);
674 Allocation *src= static_cast<Allocation *>(srcAlloc);
675 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip,
690 Allocation *dst = static_cast<Allocation *>(dstAlloc);
691 Allocation *src= static_cast<Allocation *>(srcAlloc);
692 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip,
699 Allocation *alloc = static_cast<Allocation *>(valloc);
705 Allocation *alloc = static_cast<Allocation *>(valloc);
710 Allocation *alloc = static_cast<Allocation *>(valloc);
715 Allocation *alloc = static_cast<Allocation *>(valloc);
721 Allocation *a = static_cast<Allocation *>(va);
722 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes);
728 Allocation *a = static_cast<Allocation *>(va);
736 Allocation *a = static_cast<Allocation *>(va);