Home | History | Annotate | Download | only in rs

Lines Matching defs: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() {
83 mRSC->mHal.funcs.allocation.destroy(mRSC, this);
86 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) {
87 rsc->mHal.funcs.allocation.syncAll(rsc, this, src);
90 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
95 ALOGE("Allocation::subData called with mismatched size expected %zu, got %zu",
101 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes);
105 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
107 rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
111 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
114 rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
118 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod,
123 ALOGE("Allocation::read called with mismatched size expected %zu, got %zu",
129 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes);
132 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
140 ALOGE("Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
141 rsAssert(!"Allocation::read called with mismatched size");
146 rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride);
149 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod,
157 rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride);
161 void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
166 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
172 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
180 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
185 rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, cIdx, sizeBytes);
189 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
194 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
200 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
206 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
214 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
219 rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, cIdx, sizeBytes);
223 void Allocation::addProgramToDirty(const Program *p) {
227 void Allocation::removeProgramToDirty(const Program *p) {
237 void Allocation::dumpLOGV(const char *prefix) const {
246 ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x",
250 uint32_t Allocation::getPackedSize() const {
255 void Allocation::writePackedData(Context *rsc, const Type *type,
304 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) {
306 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this);
309 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
312 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const {
317 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this);
324 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
327 void Allocation::serialize(Context *rsc, OStream *stream) const {
345 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize);
346 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
353 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
357 ALOGE("allocation loading skipped due to invalid class id\n");
370 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT);
373 // Number of bytes we wrote out for this allocation
379 ALOGE("failed to read allocation because numbytes written is not the same loaded type wants\n");
389 // Read in all of our allocation data
399 void Allocation::sendDirty(const Context *rsc) const {
405 mRSC->mHal.funcs.allocation.markDirty(rsc, this);
408 void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
412 void Allocation::decRefs(const void *ptr, size_t ct, size_t startOff) const {
419 void Allocation::freeChildrenUnlocked () {
420 void *ptr = mRSC->mHal.funcs.allocation.lock1D(mRSC, this);
422 mRSC->mHal.funcs.allocation.unlock1D(mRSC, this);
425 bool Allocation::freeChildren() {
434 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, int32_t len) {
437 void Allocation::resize1D(Context *rsc, uint32_t dimX) {
445 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX);
446 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
448 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences);
453 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
457 void * Allocation::getSurface(const Context *rsc) {
458 return rsc->mHal.funcs.allocation.getSurface(rsc, this);
461 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) {
463 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw);
466 void Allocation::ioSend(const Context *rsc) {
467 rsc->mHal.funcs.allocation.ioSend(rsc, this);
470 void Allocation::ioReceive(const Context *rsc) {
471 rsc->mHal.funcs.allocation.ioReceive(rsc, this);
482 Allocation *a = static_cast<Allocation *>(va);
488 Allocation *alloc = static_cast<Allocation *>(va);
489 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc);
493 Allocation *a = static_cast<Allocation *>(va);
501 Allocation *a = static_cast<Allocation *>(va);
507 Allocation *a = static_cast<Allocation *>(va);
513 Allocation *a = static_cast<Allocation *>(va);
519 Allocation *a = static_cast<Allocation *>(va);
525 Allocation *a = static_cast<Allocation *>(va);
531 Allocation *a = static_cast<Allocation *>(va);
543 Allocation *a = static_cast<Allocation *>(va);
548 Allocation *a = static_cast<Allocation *>(va);
555 Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mips, (void*)ptr);
569 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
571 ALOGE("Memory allocation failure");
578 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
590 // Cubemap allocation's faces should be Width by Width each.
594 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
596 ALOGE("Memory allocation failure");
616 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
631 Allocation *dst = static_cast<Allocation *>(dstAlloc);
632 Allocation *src= static_cast<Allocation *>(srcAlloc);
633 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip,
648 Allocation *dst = static_cast<Allocation *>(dstAlloc);
649 Allocation *src= static_cast<Allocation *>(srcAlloc);
650 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip,
657 Allocation *alloc = static_cast<Allocation *>(valloc);
663 Allocation *alloc = static_cast<Allocation *>(valloc);
668 Allocation *alloc = static_cast<Allocation *>(valloc);
673 Allocation *alloc = static_cast<Allocation *>(valloc);
679 Allocation *a = static_cast<Allocation *>(va);
680 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes);
686 Allocation *a = static_cast<Allocation *>(va);
694 Allocation *a = static_cast<Allocation *>(va);