Lines Matching refs:rsc

28 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,  in Allocation()  argument
30 : ObjectBase(rsc) { in Allocation()
42 Allocation::Allocation(Context *rsc, const Allocation *alloc, const Type *type) in Allocation() argument
43 : ObjectBase(rsc) { in Allocation()
61 Allocation * Allocation::createAllocationStrided(Context *rsc, const Type *type, uint32_t usages, in createAllocationStrided() argument
65 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAllocationStrided()
68 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAllocationStrided()
75 if (rsc->mHal.funcs.allocation.initOem != nullptr) { in createAllocationStrided()
76 a = new (allocMem) Allocation(rsc, type, usages, mc, nullptr); in createAllocationStrided()
77 … success = rsc->mHal.funcs.allocation.initOem(rsc, a, type->getElement()->getHasReferences(), ptr); in createAllocationStrided()
79rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation Init called with USAGE_OEM but driver does not su… in createAllocationStrided()
84 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr); in createAllocationStrided()
85 …success = rsc->mHal.funcs.allocation.initStrided(rsc, a, type->getElement()->getHasReferences(), r… in createAllocationStrided()
88 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr); in createAllocationStrided()
89 success = rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences()); in createAllocationStrided()
93 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAllocationStrided()
101 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages, in createAllocation() argument
103 return Allocation::createAllocationStrided(rsc, type, usages, mc, ptr, kMinimumRSAlignment); in createAllocation()
106 Allocation * Allocation::createAdapter(Context *rsc, const Allocation *alloc, const Type *type) { in createAdapter() argument
108 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAdapter()
111 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAdapter()
115 Allocation *a = new (allocMem) Allocation(rsc, alloc, type); in createAdapter()
117 if (!rsc->mHal.funcs.allocation.initAdapter(rsc, a)) { in createAdapter()
118 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAdapter()
126 void Allocation::adapterOffset(Context *rsc, const uint32_t *offsets, size_t len) { in adapterOffset() argument
139 rsc->mHal.funcs.allocation.adapterOffset(rsc, this); in adapterOffset()
168 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) { in syncAll() argument
169 rsc->mHal.funcs.allocation.syncAll(rsc, this, src); in syncAll()
172 void * Allocation::getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face, in getPointer() argument
184 mRSC->mHal.funcs.allocation.getPointer(rsc, this, lod, face, z, array); in getPointer()
194 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod, in data() argument
203 rsc->setError(RS_ERROR_BAD_VALUE, buf); in data()
208 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes); in data()
209 sendDirty(rsc); in data()
212 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in data() argument
214rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in data()
215 sendDirty(rsc); in data()
218 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, in data() argument
221rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in data()
222 sendDirty(rsc); in data()
225 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod, in read() argument
234 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
239 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes); in read()
242 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in read() argument
253 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
258rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in read()
261 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, in read() argument
269rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in read()
273 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementData() argument
276 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementData()
281 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementData()
286 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementData()
291 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementData()
298 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementData()
302 rsc->mHal.funcs.allocation.elementData(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementData()
303 sendDirty(rsc); in elementData()
306 void Allocation::elementRead(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementRead() argument
309 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementRead()
314 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementRead()
319 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementRead()
324 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementRead()
331 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementRead()
335 rsc->mHal.funcs.allocation.elementRead(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementRead()
371 void Allocation::writePackedData(Context *rsc, const Type *type, in writePackedData() argument
420 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) { in unpackVec3Allocation() argument
422 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this); in unpackVec3Allocation()
424 writePackedData(rsc, getType(), dst, src, true); in unpackVec3Allocation()
425 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in unpackVec3Allocation()
428 void Allocation::packVec3Allocation(Context *rsc, OStream *stream) const { in packVec3Allocation() argument
432 const uint8_t *src = (const uint8_t*)rsc->mHal.funcs.allocation.lock1D(rsc, this); in packVec3Allocation()
435 writePackedData(rsc, getType(), dst, src, false); in packVec3Allocation()
439 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in packVec3Allocation()
442 void Allocation::serialize(Context *rsc, OStream *stream) const { in serialize() argument
449 mHal.state.type->serialize(rsc, stream); in serialize()
458 stream->addByteArray(rsc->mHal.funcs.allocation.lock1D(rsc, this), dataSize); in serialize()
459 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in serialize()
462 packVec3Allocation(rsc, stream); in serialize()
466 Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { in createFromStream() argument
470 rsc->setError(RS_ERROR_FATAL_DRIVER, in createFromStream()
477 Type *type = Type::createFromStream(rsc, stream); in createFromStream()
483 Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT); in createFromStream()
492 rsc->setError(RS_ERROR_FATAL_DRIVER, in createFromStream()
503 alloc->data(rsc, 0, 0, count, stream->getPtr() + stream->getPos(), dataSize); in createFromStream()
505 alloc->unpackVec3Allocation(rsc, stream->getPtr() + stream->getPos(), dataSize); in createFromStream()
512 void Allocation::sendDirty(const Context *rsc) const { in sendDirty()
518 mRSC->mHal.funcs.allocation.markDirty(rsc, this); in sendDirty()
532 void Allocation::callUpdateCacheObject(const Context *rsc, void *dstObj) const { in callUpdateCacheObject() argument
533 if (rsc->mHal.funcs.allocation.updateCachedObject != nullptr) { in callUpdateCacheObject()
534 rsc->mHal.funcs.allocation.updateCachedObject(rsc, this, (rs_allocation *)dstObj); in callUpdateCacheObject()
556 void Allocation::copyRange1D(Context *rsc, const Allocation *src, int32_t srcOff, int32_t destOff, … in copyRange1D() argument
559 void Allocation::resize1D(Context *rsc, uint32_t dimX) { in resize1D() argument
565 ObjectBaseRef<Type> t = mHal.state.type->cloneAndResize1D(rsc, dimX); in resize1D()
567 decRefs(rsc->mHal.funcs.allocation.lock1D(rsc, this), oldDimX - dimX, dimX); in resize1D()
568 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in resize1D()
570 rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences); in resize1D()
575 void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) { in resize2D() argument
576 rsc->setError(RS_ERROR_FATAL_DRIVER, "resize2d not implemented"); in resize2D()
579 void Allocation::setupGrallocConsumer(const Context *rsc, uint32_t numAlloc) { in setupGrallocConsumer() argument
583 rsc->setError(RS_ERROR_FATAL_DRIVER, "resize2d not implemented"); in setupGrallocConsumer()
586 mGrallocConsumer = new GrallocConsumer(rsc, this, numAlloc); in setupGrallocConsumer()
592 void * Allocation::getSurface(const Context *rsc) { in getSurface() argument
599 setupGrallocConsumer(rsc, 1); in getSurface()
607 void Allocation::shareBufferQueue(const Context *rsc, const Allocation *alloc) { in shareBufferQueue() argument
612 rsc->setError(RS_ERROR_DRIVER, "Maximum allocations attached to a BufferQueue"); in shareBufferQueue()
620 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) { in setSurface() argument
622 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw); in setSurface()
625 void Allocation::ioSend(const Context *rsc) { in ioSend() argument
626 rsc->mHal.funcs.allocation.ioSend(rsc, this); in ioSend()
629 void Allocation::ioReceive(const Context *rsc) { in ioReceive() argument
637 rsc->mHal.funcs.allocation.ioReceive(rsc, this); in ioReceive()
641 rsc->setError(RS_ERROR_DRIVER, "Error receiving IO input buffer."); in ioReceive()
665 void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) { in rsi_AllocationSyncAll() argument
667 a->sendDirty(rsc); in rsi_AllocationSyncAll()
668 a->syncAll(rsc, src); in rsi_AllocationSyncAll()
671 void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) { in rsi_AllocationGenerateMipmaps() argument
673 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc); in rsi_AllocationGenerateMipmaps()
676 void rsi_AllocationCopyToBitmap(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationCopyToBitmap() argument
679 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCopyToBitmap()
683 void rsi_Allocation1DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DData() argument
686 a->data(rsc, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DData()
689 void rsi_Allocation1DElementData(Context *rsc, RsAllocation va, uint32_t x, in rsi_Allocation1DElementData() argument
692 a->elementData(rsc, x, 0, 0, data, eoff, sizeBytes); in rsi_Allocation1DElementData()
695 void rsi_AllocationElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementData() argument
698 a->elementData(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementData()
701 void rsi_Allocation2DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t lod… in rsi_Allocation2DData() argument
704 a->data(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DData()
707 void rsi_Allocation3DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t zof… in rsi_Allocation3DData() argument
710 a->data(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DData()
714 void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationRead() argument
718 a->read(rsc, 0, 0, 0, 0, t->getDimX(), t->getDimY(), t->getDimZ(), in rsi_AllocationRead()
721 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationRead()
724 a->read(rsc, 0, 0, t->getDimX(), data, sizeBytes); in rsi_AllocationRead()
729 void rsi_AllocationResize1D(Context *rsc, RsAllocation va, uint32_t dimX) { in rsi_AllocationResize1D() argument
731 a->resize1D(rsc, dimX); in rsi_AllocationResize1D()
734 void rsi_AllocationResize2D(Context *rsc, RsAllocation va, uint32_t dimX, uint32_t dimY) { in rsi_AllocationResize2D() argument
736 a->resize2D(rsc, dimX, dimY); in rsi_AllocationResize2D()
739 RsAllocation rsi_AllocationCreateTyped(Context *rsc, RsType vtype, in rsi_AllocationCreateTyped() argument
742 …Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mipmaps… in rsi_AllocationCreateTyped()
750 RsAllocation rsi_AllocationCreateStrided(Context *rsc, RsType vtype, in rsi_AllocationCreateStrided() argument
754 …Allocation * alloc = Allocation::createAllocationStrided(rsc, static_cast<Type *>(vtype), usages, … in rsi_AllocationCreateStrided()
763 RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCreateFromBitmap() argument
768 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCreateFromBitmap()
775 texAlloc->data(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCreateFromBitmap()
778 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCreateFromBitmap()
781 texAlloc->sendDirty(rsc); in rsi_AllocationCreateFromBitmap()
785 RsAllocation rsi_AllocationCubeCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCubeCreateFromBitmap() argument
793 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCubeCreateFromBitmap()
807 texAlloc->data(rsc, 0, dI, 0, (RsAllocationCubemapFace)face, in rsi_AllocationCubeCreateFromBitmap()
816 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCubeCreateFromBitmap()
819 texAlloc->sendDirty(rsc); in rsi_AllocationCubeCreateFromBitmap()
823 void rsi_AllocationCopy2DRange(Context *rsc, in rsi_AllocationCopy2DRange() argument
833 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip, in rsi_AllocationCopy2DRange()
840 void rsi_AllocationCopy3DRange(Context *rsc, in rsi_AllocationCopy3DRange() argument
850 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip, in rsi_AllocationCopy3DRange()
855 void rsi_AllocationSetupBufferQueue(Context *rsc, RsAllocation valloc, uint32_t numAlloc) { in rsi_AllocationSetupBufferQueue() argument
857 alloc->setupGrallocConsumer(rsc, numAlloc); in rsi_AllocationSetupBufferQueue()
860 void * rsi_AllocationGetSurface(Context *rsc, RsAllocation valloc) { in rsi_AllocationGetSurface() argument
862 void *s = alloc->getSurface(rsc); in rsi_AllocationGetSurface()
866 void rsi_AllocationShareBufferQueue(Context *rsc, RsAllocation valloc1, RsAllocation valloc2) { in rsi_AllocationShareBufferQueue() argument
869 alloc1->shareBufferQueue(rsc, alloc2); in rsi_AllocationShareBufferQueue()
872 void rsi_AllocationSetSurface(Context *rsc, RsAllocation valloc, RsNativeWindow sur) { in rsi_AllocationSetSurface() argument
874 alloc->setSurface(rsc, sur); in rsi_AllocationSetSurface()
877 void rsi_AllocationIoSend(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoSend() argument
879 alloc->ioSend(rsc); in rsi_AllocationIoSend()
882 int64_t rsi_AllocationIoReceive(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoReceive() argument
884 alloc->ioReceive(rsc); in rsi_AllocationIoReceive()
888 void *rsi_AllocationGetPointer(Context *rsc, RsAllocation valloc, in rsi_AllocationGetPointer() argument
894 return alloc->getPointer(rsc, lod, face, z, array, stride); in rsi_AllocationGetPointer()
897 void rsi_Allocation1DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DRead() argument
900 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DRead()
903 void rsi_AllocationElementRead(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementRead() argument
906 a->elementRead(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementRead()
909 void rsi_Allocation2DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, in rsi_Allocation2DRead() argument
913 a->read(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DRead()
916 void rsi_Allocation3DRead(Context *rsc, RsAllocation va, in rsi_Allocation3DRead() argument
921 a->read(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DRead()
924 RsAllocation rsi_AllocationAdapterCreate(Context *rsc, RsType vwindow, RsAllocation vbase) { in rsi_AllocationAdapterCreate() argument
927 Allocation * alloc = Allocation::createAdapter(rsc, in rsi_AllocationAdapterCreate()
936 void rsi_AllocationAdapterOffset(Context *rsc, RsAllocation va, const uint32_t *offsets, size_t len… in rsi_AllocationAdapterOffset() argument
938 a->adapterOffset(rsc, offsets, len); in rsi_AllocationAdapterOffset()