Home | History | Annotate | Download | only in rs

Lines Matching full: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::getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face,
108 //void *ptr = mRSC->mHal.funcs.allocation.lock1D(rsc, this);
115 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
121 sprintf(buf, "Allocation::subData called with mismatched size expected %zu, got %zu",
128 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes);
132 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
134 rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
138 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
141 rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
145 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod,
151 sprintf(buf, "Allocation::read called with mismatched size expected %zu, got %zu",
158 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes);
161 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
170 sprintf(buf, "Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
176 rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
179 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod,
187 rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
191 void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
212 rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, cIdx, sizeBytes);
216 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
242 rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, cIdx, sizeBytes);
246 void Allocation::addProgramToDirty(const Program *p) {
250 void Allocation::removeProgramToDirty(const Program *p) {
260 void Allocation::dumpLOGV(const char *prefix) const {
270 ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x",
274 uint32_t Allocation::getPackedSize() const {
279 void Allocation::writePackedData(Context *rsc, const Type *type,
328 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) {
330 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this);
333 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
336 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const {
341 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this);
348 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
351 void Allocation::serialize(Context *rsc, OStream *stream) const {
367 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize);
368 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
375 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
380 "allocation loading failed due to corrupt file. (invalid id)\n");
392 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT);
395 // Number of bytes we wrote out for this allocation
402 "allocation loading failed due to corrupt file. (invalid size)\n");
411 // Read in all of our allocation data
421 void Allocation::sendDirty(const Context *rsc) const {
427 mRSC->mHal.funcs.allocation.markDirty(rsc, this);
430 void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
434 void Allocation::decRefs(const void *ptr, size_t ct, size_t startOff) const {
441 void Allocation::callUpdateCacheObject(const Context *rsc, void *dstObj) const {
442 if (rsc->mHal.funcs.allocation.updateCachedObject != NULL) {
443 rsc->mHal.funcs.allocation.updateCachedObject(rsc, this, (rs_allocation *)dstObj);
450 void Allocation::freeChildrenUnlocked () {
451 void *ptr = mRSC->mHal.funcs.allocation.lock1D(mRSC, this);
453 mRSC->mHal.funcs.allocation.unlock1D(mRSC, this);
456 bool Allocation::freeChildren() {
465 void AllocationAllocation *src, int32_t srcOff, int32_t destOff, int32_t len) {
468 void Allocation::resize1D(Context *rsc, uint32_t dimX) {
476 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX);
477 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
479 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences);
484 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
489 void Allocation::NewBufferListener::onFrameAvailable(const BufferItem& /* item */) {
495 void * Allocation::getSurface(const Context *rsc) {
513 //return rsc->mHal.funcs.allocation.getSurface(rsc, this);
516 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) {
518 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw);
521 void Allocation::ioSend(const Context *rsc) {
522 rsc->mHal.funcs.allocation.ioSend(rsc, this);
525 void Allocation::ioReceive(const Context *rsc) {
533 rsc->mHal.funcs.allocation.ioReceive(rsc, this);
544 bool Allocation::hasSameDims(const Allocation *other) const {
565 Allocation *a = static_cast<Allocation *>(va);
571 Allocation *alloc = static_cast<Allocation *>(va);
572 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc);
576 Allocation *a = static_cast<Allocation *>(va);
584 Allocation *a = static_cast<Allocation *>(va);
590 Allocation *a = static_cast<Allocation *>(va);
596 Allocation *a = static_cast<Allocation *>(va);
602 Allocation *a = static_cast<Allocation *>(va);
608 Allocation *a = static_cast<Allocation *>(va);
614 Allocation *a = static_cast<Allocation *>(va);
626 Allocation *a = static_cast<Allocation *>(va);
631 Allocation *a = static_cast<Allocation *>(va);
638 Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mipmaps, (void*)ptr);
652 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
654 ALOGE("Memory allocation failure");
661 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
673 // Cubemap allocation's faces should be Width by Width each.
677 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
679 ALOGE("Memory allocation failure");
699 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
714 Allocation *dst = static_cast<Allocation *>(dstAlloc);
715 Allocation *src= static_cast<Allocation *>(srcAlloc);
716 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip,
731 Allocation *dst = static_cast<Allocation *>(dstAlloc);
732 Allocation *src= static_cast<Allocation *>(srcAlloc);
733 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip,
740 Allocation *alloc = static_cast<Allocation *>(valloc);
746 Allocation *alloc = static_cast<Allocation *>(valloc);
751 Allocation *alloc = static_cast<Allocation *>(valloc);
756 Allocation *alloc = static_cast<Allocation *>(valloc);
763 Allocation *alloc = static_cast<Allocation *>(valloc);
771 Allocation *a = static_cast<Allocation *>(va);
772 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes);
778 Allocation *a = static_cast<Allocation *>(va);
786 Allocation *a = static_cast<Allocation *>(va);