Home | History | Annotate | Download | only in rs

Lines Matching full:allocation

28 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,
41 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages,
43 Allocation *a = new Allocation(rsc, type, usages, mc, ptr);
45 if (!rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences())) {
46 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure");
54 void Allocation::updateCache() {
66 Allocation::~Allocation() {
69 mRSC->mHal.funcs.allocation.destroy(mRSC, this);
72 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) {
73 rsc->mHal.funcs.allocation.syncAll(rsc, this, src);
76 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod,
81 ALOGE("Allocation::subData called with mismatched size expected %zu, got %zu",
87 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes);
91 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
99 ALOGE("Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
100 rsAssert(!"Allocation::subData called with mismatched size");
104 rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes);
108 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
113 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod,
118 ALOGE("Allocation::read called with mismatched size expected %zu, got %zu",
124 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes);
127 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face,
133 ALOGE("Allocation size mismatch, expected %zu, got %zu", (lineSize * h), sizeBytes);
134 rsAssert(!"Allocation::read called with mismatched size");
138 rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes);
141 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff,
146 void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
151 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
157 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
165 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
170 rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, cIdx, sizeBytes);
174 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
179 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
185 ALOGE("Error Allocation::subElementData X offset %i out of range.", x);
191 ALOGE("Error Allocation::subElementData component %i out of range.", cIdx);
199 ALOGE("Error Allocation::subElementData data size %zu does not match field size %zu.", sizeBytes, e->getSizeBytes());
204 rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, cIdx, sizeBytes);
208 void Allocation::addProgramToDirty(const Program *p) {
212 void Allocation::removeProgramToDirty(const Program *p) {
222 void Allocation::dumpLOGV(const char *prefix) const {
231 ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x",
235 uint32_t Allocation::getPackedSize() const {
240 void Allocation::writePackedData(Context *rsc, const Type *type,
289 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) {
291 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this);
294 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
297 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const {
302 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this);
309 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
312 void Allocation::serialize(Context *rsc, OStream *stream) const {
330 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize);
331 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
338 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
342 ALOGE("allocation loading skipped due to invalid class id\n");
355 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT);
358 // Number of bytes we wrote out for this allocation
364 ALOGE("failed to read allocation because numbytes written is not the same loaded type wants\n");
374 // Read in all of our allocation data
384 void Allocation::sendDirty(const Context *rsc) const {
388 mRSC->mHal.funcs.allocation.markDirty(rsc, this);
391 void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
395 void Allocation::decRefs(const void *ptr, size_t ct, size_t startOff) const {
402 void Allocation::freeChildrenUnlocked () {
403 void *ptr = mRSC->mHal.funcs.allocation.lock1D(mRSC, this);
405 mRSC->mHal.funcs.allocation.unlock1D(mRSC, this);
408 bool Allocation::freeChildren() {
417 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, int32_t len) {
420 void Allocation::resize1D(Context *rsc, uint32_t dimX) {
428 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX);
429 rsc->mHal.funcs.allocation.unlock1D(rsc, this);
431 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences);
436 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
440 int32_t Allocation::getSurfaceTextureID(const Context *rsc) {
441 int32_t id = rsc->mHal.funcs.allocation.initSurfaceTexture(rsc, this);
446 void Allocation::setSurfaceTexture(const Context *rsc, SurfaceTexture *st) {
458 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) {
464 rsc->mHal.funcs.allocation.setSurfaceTexture(rsc, this, nw);
471 void Allocation::ioSend(const Context *rsc) {
472 rsc->mHal.funcs.allocation.ioSend(rsc, this);
475 void Allocation::ioReceive(const Context *rsc) {
476 rsc->mHal.funcs.allocation.ioReceive(rsc, this);
487 Allocation *a = static_cast<Allocation *>(va);
493 Allocation *alloc = static_cast<Allocation *>(va);
494 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc);
498 Allocation *a = static_cast<Allocation *>(va);
506 Allocation *a = static_cast<Allocation *>(va);
512 Allocation *a = static_cast<Allocation *>(va);
518 Allocation *a = static_cast<Allocation *>(va);
524 Allocation *a = static_cast<Allocation *>(va);
529 Allocation *a = static_cast<Allocation *>(va);
541 Allocation *a = static_cast<Allocation *>(va);
546 Allocation *a = static_cast<Allocation *>(va);
553 Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mips, (void *)ptr);
567 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
569 ALOGE("Memory allocation failure");
576 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
588 // Cubemap allocation's faces should be Width by Width each.
592 Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
594 ALOGE("Memory allocation failure");
614 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc);
629 Allocation *dst = static_cast<Allocation *>(dstAlloc);
630 Allocation *src= static_cast<Allocation *>(srcAlloc);
631 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip,
639 Allocation *alloc = static_cast<Allocation *>(valloc);
644 Allocation *alloc = static_cast<Allocation *>(valloc);
649 Allocation *alloc = static_cast<Allocation *>(valloc);
654 Allocation *alloc = static_cast<Allocation *>(valloc);
659 Allocation *alloc = static_cast<Allocation *>(valloc);
667 Allocation *a = static_cast<Allocation *>(va);