Lines Matching refs:rsc

30 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,  in Allocation()  argument
32 : ObjectBase(rsc) { in Allocation()
44 Allocation::Allocation(Context *rsc, const Allocation *alloc, const Type *type) in Allocation() argument
45 : ObjectBase(rsc) { in Allocation()
63 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages, in createAllocation() argument
66 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAllocation()
69 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAllocation()
76 if (rsc->mHal.funcs.allocation.initOem != nullptr) { in createAllocation()
77 a = new (allocMem) Allocation(rsc, type, usages, mc, nullptr); in createAllocation()
78 … success = rsc->mHal.funcs.allocation.initOem(rsc, a, type->getElement()->getHasReferences(), ptr); in createAllocation()
80rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation Init called with USAGE_OEM but driver does not su… in createAllocation()
84 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr); in createAllocation()
85 success = rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences()); in createAllocation()
89 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAllocation()
97 Allocation * Allocation::createAdapter(Context *rsc, const Allocation *alloc, const Type *type) { in createAdapter() argument
99 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAdapter()
102 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAdapter()
106 Allocation *a = new (allocMem) Allocation(rsc, alloc, type); in createAdapter()
108 if (!rsc->mHal.funcs.allocation.initAdapter(rsc, a)) { in createAdapter()
109 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAdapter()
117 void Allocation::adapterOffset(Context *rsc, const uint32_t *offsets, size_t len) { in adapterOffset() argument
130 rsc->mHal.funcs.allocation.adapterOffset(rsc, this); in adapterOffset()
156 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) { in syncAll() argument
157 rsc->mHal.funcs.allocation.syncAll(rsc, this, src); in syncAll()
160 void * Allocation::getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face, in getPointer() argument
172 mRSC->mHal.funcs.allocation.getPointer(rsc, this, lod, face, z, array); in getPointer()
182 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod, in data() argument
190 rsc->setError(RS_ERROR_BAD_VALUE, buf); in data()
195 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes); in data()
196 sendDirty(rsc); in data()
199 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in data() argument
201rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in data()
202 sendDirty(rsc); in data()
205 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, in data() argument
208rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in data()
209 sendDirty(rsc); in data()
212 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod, in read() argument
220 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
225 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes); in read()
228 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in read() argument
238 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
243rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in read()
246 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, in read() argument
254rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in read()
258 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementData() argument
263 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementData()
268 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementData()
273 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementData()
278 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementData()
285 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementData()
289 rsc->mHal.funcs.allocation.elementData(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementData()
290 sendDirty(rsc); in elementData()
293 void Allocation::elementRead(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementRead() argument
298 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementRead()
303 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementRead()
308 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementRead()
313 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementRead()
320 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementRead()
324 rsc->mHal.funcs.allocation.elementRead(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementRead()
360 void Allocation::writePackedData(Context *rsc, const Type *type, in writePackedData() argument
409 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) { in unpackVec3Allocation() argument
411 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this); in unpackVec3Allocation()
413 writePackedData(rsc, getType(), dst, src, true); in unpackVec3Allocation()
414 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in unpackVec3Allocation()
417 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const { in packVec3Allocation() argument
422 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this); in packVec3Allocation()
425 writePackedData(rsc, getType(), dst, src, false); in packVec3Allocation()
429 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in packVec3Allocation()
432 void Allocation::serialize(Context *rsc, OStream *stream) const { in serialize() argument
439 mHal.state.type->serialize(rsc, stream); in serialize()
448 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize); in serialize()
449 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in serialize()
452 packVec3Allocation(rsc, stream); in serialize()
456 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { in createFromStream() argument
460 rsc->setError(RS_ERROR_FATAL_DRIVER, in createFromStream()
467 Type *type = Type::createFromStream(rsc, stream); in createFromStream()
473 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT); in createFromStream()
482 rsc->setError(RS_ERROR_FATAL_DRIVER, in createFromStream()
493 alloc->data(rsc, 0, 0, count, stream->getPtr() + stream->getPos(), dataSize); in createFromStream()
495 alloc->unpackVec3Allocation(rsc, stream->getPtr() + stream->getPos(), dataSize); in createFromStream()
502 void Allocation::sendDirty(const Context *rsc) const { in sendDirty()
508 mRSC->mHal.funcs.allocation.markDirty(rsc, this); in sendDirty()
522 void Allocation::callUpdateCacheObject(const Context *rsc, void *dstObj) const { in callUpdateCacheObject() argument
523 if (rsc->mHal.funcs.allocation.updateCachedObject != nullptr) { in callUpdateCacheObject()
524 rsc->mHal.funcs.allocation.updateCachedObject(rsc, this, (rs_allocation *)dstObj); in callUpdateCacheObject()
546 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, … in copyRange1D() argument
549 void Allocation::resize1D(Context *rsc, uint32_t dimX) { in resize1D() argument
555 ObjectBaseRef<Type> t = mHal.state.type->cloneAndResize1D(rsc, dimX); in resize1D()
557 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX); in resize1D()
558 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in resize1D()
560 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences); in resize1D()
565 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) { in resize2D() argument
566 rsc->setError(RS_ERROR_FATAL_DRIVER, "resize2d not implemented"); in resize2D()
572 rsc->sendMessageToClient(&ip, RS_MESSAGE_TO_CLIENT_NEW_BUFFER, 0, sizeof(ip), true); in onFrameAvailable()
576 void * Allocation::getSurface(const Context *rsc) { in getSurface() argument
586 mBufferListener->rsc = rsc; in getSurface()
597 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) { in setSurface() argument
599 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw); in setSurface()
602 void Allocation::ioSend(const Context *rsc) { in ioSend() argument
603 rsc->mHal.funcs.allocation.ioSend(rsc, this); in ioSend()
606 void Allocation::ioReceive(const Context *rsc) { in ioReceive() argument
614 rsc->mHal.funcs.allocation.ioReceive(rsc, this); in ioReceive()
618 rsc->setError(RS_ERROR_DRIVER, "Error receiving IO input buffer."); in ioReceive()
645 void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) { in rsi_AllocationSyncAll() argument
647 a->sendDirty(rsc); in rsi_AllocationSyncAll()
648 a->syncAll(rsc, src); in rsi_AllocationSyncAll()
651 void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) { in rsi_AllocationGenerateMipmaps() argument
653 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc); in rsi_AllocationGenerateMipmaps()
656 void rsi_AllocationCopyToBitmap(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationCopyToBitmap() argument
659 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCopyToBitmap()
663 void rsi_Allocation1DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DData() argument
666 a->data(rsc, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DData()
669 void rsi_Allocation1DElementData(Context *rsc, RsAllocation va, uint32_t x, in rsi_Allocation1DElementData() argument
672 a->elementData(rsc, x, 0, 0, data, eoff, sizeBytes); in rsi_Allocation1DElementData()
675 void rsi_AllocationElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementData() argument
678 a->elementData(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementData()
681 void rsi_Allocation2DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t lod… in rsi_Allocation2DData() argument
684 a->data(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DData()
687 void rsi_Allocation3DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t zof… in rsi_Allocation3DData() argument
690 a->data(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DData()
694 void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationRead() argument
698 a->read(rsc, 0, 0, 0, 0, t->getDimX(), t->getDimY(), t->getDimZ(), in rsi_AllocationRead()
701 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationRead()
704 a->read(rsc, 0, 0, t->getDimX(), data, sizeBytes); in rsi_AllocationRead()
709 void rsi_AllocationResize1D(Context *rsc, RsAllocation va, uint32_t dimX) { in rsi_AllocationResize1D() argument
711 a->resize1D(rsc, dimX); in rsi_AllocationResize1D()
714 void rsi_AllocationResize2D(Context *rsc, RsAllocation va, uint32_t dimX, uint32_t dimY) { in rsi_AllocationResize2D() argument
716 a->resize2D(rsc, dimX, dimY); in rsi_AllocationResize2D()
719 RsAllocation rsi_AllocationCreateTyped(Context *rsc, RsType vtype, in rsi_AllocationCreateTyped() argument
722 …Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mipmaps… in rsi_AllocationCreateTyped()
730 RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCreateFromBitmap() argument
735 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCreateFromBitmap()
742 texAlloc->data(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCreateFromBitmap()
745 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCreateFromBitmap()
748 texAlloc->sendDirty(rsc); in rsi_AllocationCreateFromBitmap()
752 RsAllocation rsi_AllocationCubeCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCubeCreateFromBitmap() argument
760 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCubeCreateFromBitmap()
774 texAlloc->data(rsc, 0, dI, 0, (RsAllocationCubemapFace)face, in rsi_AllocationCubeCreateFromBitmap()
783 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCubeCreateFromBitmap()
786 texAlloc->sendDirty(rsc); in rsi_AllocationCubeCreateFromBitmap()
790 void rsi_AllocationCopy2DRange(Context *rsc, in rsi_AllocationCopy2DRange() argument
800 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip, in rsi_AllocationCopy2DRange()
807 void rsi_AllocationCopy3DRange(Context *rsc, in rsi_AllocationCopy3DRange() argument
817 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip, in rsi_AllocationCopy3DRange()
823 void * rsi_AllocationGetSurface(Context *rsc, RsAllocation valloc) { in rsi_AllocationGetSurface() argument
825 void *s = alloc->getSurface(rsc); in rsi_AllocationGetSurface()
829 void rsi_AllocationSetSurface(Context *rsc, RsAllocation valloc, RsNativeWindow sur) { in rsi_AllocationSetSurface() argument
831 alloc->setSurface(rsc, sur); in rsi_AllocationSetSurface()
834 void rsi_AllocationIoSend(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoSend() argument
836 alloc->ioSend(rsc); in rsi_AllocationIoSend()
839 void rsi_AllocationIoReceive(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoReceive() argument
841 alloc->ioReceive(rsc); in rsi_AllocationIoReceive()
844 void *rsi_AllocationGetPointer(Context *rsc, RsAllocation valloc, in rsi_AllocationGetPointer() argument
850 return alloc->getPointer(rsc, lod, face, z, array, stride); in rsi_AllocationGetPointer()
853 void rsi_Allocation1DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DRead() argument
856 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DRead()
859 void rsi_AllocationElementRead(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementRead() argument
862 a->elementRead(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementRead()
865 void rsi_Allocation2DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, in rsi_Allocation2DRead() argument
869 a->read(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DRead()
872 void rsi_Allocation3DRead(Context *rsc, RsAllocation va, in rsi_Allocation3DRead() argument
877 a->read(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DRead()
880 RsAllocation rsi_AllocationAdapterCreate(Context *rsc, RsType vwindow, RsAllocation vbase) { in rsi_AllocationAdapterCreate() argument
883 Allocation * alloc = Allocation::createAdapter(rsc, in rsi_AllocationAdapterCreate()
892 void rsi_AllocationAdapterOffset(Context *rsc, RsAllocation va, const uint32_t *offsets, size_t len… in rsi_AllocationAdapterOffset() argument
894 a->adapterOffset(rsc, offsets, len); in rsi_AllocationAdapterOffset()