• Home
  • Raw
  • Download

Lines Matching refs:rsc

29 Allocation::Allocation(Context *rsc, const Type *type, uint32_t usages,  in Allocation()  argument
31 : ObjectBase(rsc) { in Allocation()
43 Allocation::Allocation(Context *rsc, const Allocation *alloc, const Type *type) in Allocation() argument
44 : ObjectBase(rsc) { in Allocation()
62 Allocation * Allocation::createAllocationStrided(Context *rsc, const Type *type, uint32_t usages, in createAllocationStrided() argument
66 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAllocationStrided()
69 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAllocationStrided()
76 if (rsc->mHal.funcs.allocation.initOem != nullptr) { in createAllocationStrided()
77 a = new (allocMem) Allocation(rsc, type, usages, mc, nullptr); in createAllocationStrided()
78 … success = rsc->mHal.funcs.allocation.initOem(rsc, a, type->getElement()->getHasReferences(), ptr); in createAllocationStrided()
80rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation Init called with USAGE_OEM but driver does not su… in createAllocationStrided()
85 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr); in createAllocationStrided()
86 …success = rsc->mHal.funcs.allocation.initStrided(rsc, a, type->getElement()->getHasReferences(), r… in createAllocationStrided()
89 a = new (allocMem) Allocation(rsc, type, usages, mc, ptr); in createAllocationStrided()
90 success = rsc->mHal.funcs.allocation.init(rsc, a, type->getElement()->getHasReferences()); in createAllocationStrided()
94 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAllocationStrided()
102 Allocation * Allocation::createAllocation(Context *rsc, const Type *type, uint32_t usages, in createAllocation() argument
104 return Allocation::createAllocationStrided(rsc, type, usages, mc, ptr, kMinimumRSAlignment); in createAllocation()
107 Allocation * Allocation::createAdapter(Context *rsc, const Allocation *alloc, const Type *type) { in createAdapter() argument
109 void* allocMem = rsc->mHal.funcs.allocRuntimeMem(sizeof(Allocation), 0); in createAdapter()
112 rsc->setError(RS_ERROR_FATAL_DRIVER, "Couldn't allocate memory for Allocation"); in createAdapter()
116 Allocation *a = new (allocMem) Allocation(rsc, alloc, type); in createAdapter()
118 if (!rsc->mHal.funcs.allocation.initAdapter(rsc, a)) { in createAdapter()
119 rsc->setError(RS_ERROR_FATAL_DRIVER, "Allocation::Allocation, alloc failure"); in createAdapter()
127 void Allocation::adapterOffset(Context *rsc, const uint32_t *offsets, size_t len) { in adapterOffset() argument
140 rsc->mHal.funcs.allocation.adapterOffset(rsc, this); in adapterOffset()
166 void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) { in syncAll() argument
167 rsc->mHal.funcs.allocation.syncAll(rsc, this, src); in syncAll()
170 void * Allocation::getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face, in getPointer() argument
182 mRSC->mHal.funcs.allocation.getPointer(rsc, this, lod, face, z, array); in getPointer()
192 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod, in data() argument
200 rsc->setError(RS_ERROR_BAD_VALUE, buf); in data()
205 rsc->mHal.funcs.allocation.data1D(rsc, this, xoff, lod, count, data, sizeBytes); in data()
206 sendDirty(rsc); in data()
209 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in data() argument
211rsc->mHal.funcs.allocation.data2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in data()
212 sendDirty(rsc); in data()
215 void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, in data() argument
218rsc->mHal.funcs.allocation.data3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in data()
219 sendDirty(rsc); in data()
222 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t lod, in read() argument
230 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
235 rsc->mHal.funcs.allocation.read1D(rsc, this, xoff, lod, count, data, sizeBytes); in read()
238 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemap… in read() argument
248 rsc->setError(RS_ERROR_BAD_VALUE, buf); in read()
253rsc->mHal.funcs.allocation.read2D(rsc, this, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in read()
256 void Allocation::read(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, in read() argument
264rsc->mHal.funcs.allocation.read3D(rsc, this, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stri… in read()
268 void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementData() argument
273 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementData()
278 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementData()
283 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementData()
288 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementData()
295 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementData()
299 rsc->mHal.funcs.allocation.elementData(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementData()
300 sendDirty(rsc); in elementData()
303 void Allocation::elementRead(Context *rsc, uint32_t x, uint32_t y, uint32_t z, in elementRead() argument
308 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); in elementRead()
313 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Y offset out of range."); in elementRead()
318 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData Z offset out of range."); in elementRead()
323 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); in elementRead()
330 rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); in elementRead()
334 rsc->mHal.funcs.allocation.elementRead(rsc, this, x, y, z, data, cIdx, sizeBytes); in elementRead()
370 void Allocation::writePackedData(Context *rsc, const Type *type, in writePackedData() argument
419 void Allocation::unpackVec3Allocation(Context *rsc, const void *data, size_t dataSize) { in unpackVec3Allocation() argument
421 uint8_t *dst = (uint8_t *)rsc->mHal.funcs.allocation.lock1D(rsc, this); in unpackVec3Allocation()
423 writePackedData(rsc, getType(), dst, src, true); in unpackVec3Allocation()
424 rsc->mHal.funcs.allocation.unlock1D(rsc, this); in unpackVec3Allocation()
427 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()
596 rsc->sendMessageToClient(&ip, RS_MESSAGE_TO_CLIENT_NEW_BUFFER, 0, sizeof(ip), true); in onFrameAvailable()
602 void Allocation::setupGrallocConsumer(const Context *rsc, uint32_t numAlloc) { in setupGrallocConsumer() argument
606 rsc->setError(RS_ERROR_FATAL_DRIVER, "resize2d not implemented"); in setupGrallocConsumer()
614 mBufferListener->rsc = rsc; in setupGrallocConsumer()
623 void * Allocation::getSurface(const Context *rsc) { in getSurface() argument
630 setupGrallocConsumer(rsc, 1); in getSurface()
640 void Allocation::shareBufferQueue(const Context *rsc, const Allocation *alloc) { in shareBufferQueue() argument
645 rsc->setError(RS_ERROR_DRIVER, "Maximum allocations attached to a BufferQueue"); in shareBufferQueue()
657 void Allocation::setSurface(const Context *rsc, RsNativeWindow sur) { in setSurface() argument
659 rsc->mHal.funcs.allocation.setSurface(rsc, this, nw); in setSurface()
662 void Allocation::ioSend(const Context *rsc) { in ioSend() argument
663 rsc->mHal.funcs.allocation.ioSend(rsc, this); in ioSend()
666 void Allocation::ioReceive(const Context *rsc) { in ioReceive() argument
674 rsc->mHal.funcs.allocation.ioReceive(rsc, this); in ioReceive()
678 rsc->setError(RS_ERROR_DRIVER, "Error receiving IO input buffer."); in ioReceive()
705 void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) { in rsi_AllocationSyncAll() argument
707 a->sendDirty(rsc); in rsi_AllocationSyncAll()
708 a->syncAll(rsc, src); in rsi_AllocationSyncAll()
711 void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) { in rsi_AllocationGenerateMipmaps() argument
713 rsc->mHal.funcs.allocation.generateMipmaps(rsc, alloc); in rsi_AllocationGenerateMipmaps()
716 void rsi_AllocationCopyToBitmap(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationCopyToBitmap() argument
719 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCopyToBitmap()
723 void rsi_Allocation1DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DData() argument
726 a->data(rsc, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DData()
729 void rsi_Allocation1DElementData(Context *rsc, RsAllocation va, uint32_t x, in rsi_Allocation1DElementData() argument
732 a->elementData(rsc, x, 0, 0, data, eoff, sizeBytes); in rsi_Allocation1DElementData()
735 void rsi_AllocationElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementData() argument
738 a->elementData(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementData()
741 void rsi_Allocation2DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t lod… in rsi_Allocation2DData() argument
744 a->data(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DData()
747 void rsi_Allocation3DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t zof… in rsi_Allocation3DData() argument
750 a->data(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DData()
754 void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) { in rsi_AllocationRead() argument
758 a->read(rsc, 0, 0, 0, 0, t->getDimX(), t->getDimY(), t->getDimZ(), in rsi_AllocationRead()
761 a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationRead()
764 a->read(rsc, 0, 0, t->getDimX(), data, sizeBytes); in rsi_AllocationRead()
769 void rsi_AllocationResize1D(Context *rsc, RsAllocation va, uint32_t dimX) { in rsi_AllocationResize1D() argument
771 a->resize1D(rsc, dimX); in rsi_AllocationResize1D()
774 void rsi_AllocationResize2D(Context *rsc, RsAllocation va, uint32_t dimX, uint32_t dimY) { in rsi_AllocationResize2D() argument
776 a->resize2D(rsc, dimX, dimY); in rsi_AllocationResize2D()
779 RsAllocation rsi_AllocationCreateTyped(Context *rsc, RsType vtype, in rsi_AllocationCreateTyped() argument
782 …Allocation * alloc = Allocation::createAllocation(rsc, static_cast<Type *>(vtype), usages, mipmaps… in rsi_AllocationCreateTyped()
790 RsAllocation rsi_AllocationCreateStrided(Context *rsc, RsType vtype, in rsi_AllocationCreateStrided() argument
794 …Allocation * alloc = Allocation::createAllocationStrided(rsc, static_cast<Type *>(vtype), usages, … in rsi_AllocationCreateStrided()
803 RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCreateFromBitmap() argument
808 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCreateFromBitmap()
815 texAlloc->data(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, in rsi_AllocationCreateFromBitmap()
818 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCreateFromBitmap()
821 texAlloc->sendDirty(rsc); in rsi_AllocationCreateFromBitmap()
825 RsAllocation rsi_AllocationCubeCreateFromBitmap(Context *rsc, RsType vtype, in rsi_AllocationCubeCreateFromBitmap() argument
833 RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mipmaps, usages, 0); in rsi_AllocationCubeCreateFromBitmap()
847 texAlloc->data(rsc, 0, dI, 0, (RsAllocationCubemapFace)face, in rsi_AllocationCubeCreateFromBitmap()
856 rsc->mHal.funcs.allocation.generateMipmaps(rsc, texAlloc); in rsi_AllocationCubeCreateFromBitmap()
859 texAlloc->sendDirty(rsc); in rsi_AllocationCubeCreateFromBitmap()
863 void rsi_AllocationCopy2DRange(Context *rsc, in rsi_AllocationCopy2DRange() argument
873 rsc->mHal.funcs.allocation.allocData2D(rsc, dst, dstXoff, dstYoff, dstMip, in rsi_AllocationCopy2DRange()
880 void rsi_AllocationCopy3DRange(Context *rsc, in rsi_AllocationCopy3DRange() argument
890 rsc->mHal.funcs.allocation.allocData3D(rsc, dst, dstXoff, dstYoff, dstZoff, dstMip, in rsi_AllocationCopy3DRange()
895 void rsi_AllocationSetupBufferQueue(Context *rsc, RsAllocation valloc, uint32_t numAlloc) { in rsi_AllocationSetupBufferQueue() argument
897 alloc->setupGrallocConsumer(rsc, numAlloc); in rsi_AllocationSetupBufferQueue()
900 void * rsi_AllocationGetSurface(Context *rsc, RsAllocation valloc) { in rsi_AllocationGetSurface() argument
902 void *s = alloc->getSurface(rsc); in rsi_AllocationGetSurface()
906 void rsi_AllocationShareBufferQueue(Context *rsc, RsAllocation valloc1, RsAllocation valloc2) { in rsi_AllocationShareBufferQueue() argument
909 alloc1->shareBufferQueue(rsc, alloc2); in rsi_AllocationShareBufferQueue()
912 void rsi_AllocationSetSurface(Context *rsc, RsAllocation valloc, RsNativeWindow sur) { in rsi_AllocationSetSurface() argument
914 alloc->setSurface(rsc, sur); in rsi_AllocationSetSurface()
917 void rsi_AllocationIoSend(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoSend() argument
919 alloc->ioSend(rsc); in rsi_AllocationIoSend()
922 int64_t rsi_AllocationIoReceive(Context *rsc, RsAllocation valloc) { in rsi_AllocationIoReceive() argument
924 alloc->ioReceive(rsc); in rsi_AllocationIoReceive()
928 void *rsi_AllocationGetPointer(Context *rsc, RsAllocation valloc, in rsi_AllocationGetPointer() argument
934 return alloc->getPointer(rsc, lod, face, z, array, stride); in rsi_AllocationGetPointer()
937 void rsi_Allocation1DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t lod, in rsi_Allocation1DRead() argument
940 rsc->mHal.funcs.allocation.read1D(rsc, a, xoff, lod, count, data, sizeBytes); in rsi_Allocation1DRead()
943 void rsi_AllocationElementRead(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, in rsi_AllocationElementRead() argument
946 a->elementRead(rsc, x, y, z, data, eoff, sizeBytes); in rsi_AllocationElementRead()
949 void rsi_Allocation2DRead(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, in rsi_Allocation2DRead() argument
953 a->read(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes, stride); in rsi_Allocation2DRead()
956 void rsi_Allocation3DRead(Context *rsc, RsAllocation va, in rsi_Allocation3DRead() argument
961 a->read(rsc, xoff, yoff, zoff, lod, w, h, d, data, sizeBytes, stride); in rsi_Allocation3DRead()
964 RsAllocation rsi_AllocationAdapterCreate(Context *rsc, RsType vwindow, RsAllocation vbase) { in rsi_AllocationAdapterCreate() argument
967 Allocation * alloc = Allocation::createAdapter(rsc, in rsi_AllocationAdapterCreate()
976 void rsi_AllocationAdapterOffset(Context *rsc, RsAllocation va, const uint32_t *offsets, size_t len… in rsi_AllocationAdapterOffset() argument
978 a->adapterOffset(rsc, offsets, len); in rsi_AllocationAdapterOffset()