• Home
  • Raw
  • Download

Lines Matching refs:alloc

87 uint8_t *GetOffsetPtr(const android::renderscript::Allocation *alloc,  in GetOffsetPtr()  argument
90 uint8_t *ptr = (uint8_t *)alloc->mHal.drvState.lod[lod].mallocPtr; in GetOffsetPtr()
91 ptr += face * alloc->mHal.drvState.faceOffset; in GetOffsetPtr()
92 ptr += zoff * alloc->mHal.drvState.lod[lod].dimY * alloc->mHal.drvState.lod[lod].stride; in GetOffsetPtr()
93 ptr += yoff * alloc->mHal.drvState.lod[lod].stride; in GetOffsetPtr()
94 ptr += xoff * alloc->mHal.state.elementSizeBytes; in GetOffsetPtr()
99 static void Update2DTexture(const Context *rsc, const Allocation *alloc, const void *ptr, in Update2DTexture() argument
103 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in Update2DTexture()
109 if (alloc->mHal.state.hasFaces) { in Update2DTexture()
118 static void Upload2DTexture(const Context *rsc, const Allocation *alloc, bool isFirstUpload) { in Upload2DTexture() argument
119 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in Upload2DTexture()
125 if (alloc->mHal.state.hasFaces) { in Upload2DTexture()
131 for (uint32_t lod = 0; lod < alloc->mHal.state.type->getLODCount(); lod++) { in Upload2DTexture()
132 const uint8_t *p = GetOffsetPtr(alloc, 0, 0, 0, lod, (RsAllocationCubemapFace)face); in Upload2DTexture()
135 if (alloc->mHal.state.hasFaces) { in Upload2DTexture()
141 alloc->mHal.state.type->getLODDimX(lod), in Upload2DTexture()
142 alloc->mHal.state.type->getLODDimY(lod), in Upload2DTexture()
146 alloc->mHal.state.type->getLODDimX(lod), in Upload2DTexture()
147 alloc->mHal.state.type->getLODDimY(lod), in Upload2DTexture()
153 if (alloc->mHal.state.mipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) { in Upload2DTexture()
160 static void UploadToTexture(const Context *rsc, const Allocation *alloc) { in UploadToTexture() argument
162 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in UploadToTexture()
164 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_INPUT) { in UploadToTexture()
175 if (!alloc->mHal.drvState.lod[0].mallocPtr) { in UploadToTexture()
186 Upload2DTexture(rsc, alloc, isFirstUpload); in UploadToTexture()
188 if (!(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT)) { in UploadToTexture()
189 if (alloc->mHal.drvState.lod[0].mallocPtr) { in UploadToTexture()
190 free(alloc->mHal.drvState.lod[0].mallocPtr); in UploadToTexture()
191 alloc->mHal.drvState.lod[0].mallocPtr = nullptr; in UploadToTexture()
198 static void AllocateRenderTarget(const Context *rsc, const Allocation *alloc) { in AllocateRenderTarget() argument
200 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in AllocateRenderTarget()
217 alloc->mHal.drvState.lod[0].dimX, alloc->mHal.drvState.lod[0].dimY); in AllocateRenderTarget()
223 static void UploadToBufferObject(const Context *rsc, const Allocation *alloc) { in UploadToBufferObject() argument
225 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in UploadToBufferObject()
227 rsAssert(!alloc->mHal.state.type->getDimY()); in UploadToBufferObject()
228 rsAssert(!alloc->mHal.state.type->getDimZ()); in UploadToBufferObject()
242 alloc->mHal.state.type->getPackedSizeBytes(), in UploadToBufferObject()
243 alloc->mHal.drvState.lod[0].mallocPtr, GL_DYNAMIC_DRAW); in UploadToBufferObject()
299 static size_t AllocationBuildPointerTable(const Context *rsc, const Allocation *alloc, in AllocationBuildPointerTable() argument
301 alloc->mHal.drvState.lod[0].dimX = type->getDimX(); in AllocationBuildPointerTable()
302 alloc->mHal.drvState.lod[0].dimY = type->getDimY(); in AllocationBuildPointerTable()
303 alloc->mHal.drvState.lod[0].dimZ = type->getDimZ(); in AllocationBuildPointerTable()
304 alloc->mHal.drvState.lod[0].mallocPtr = 0; in AllocationBuildPointerTable()
306 size_t stride = alloc->mHal.drvState.lod[0].dimX * type->getElementSizeBytes(); in AllocationBuildPointerTable()
307 alloc->mHal.drvState.lod[0].stride = rsRound(stride, requiredAlignment); in AllocationBuildPointerTable()
308 alloc->mHal.drvState.lodCount = type->getLODCount(); in AllocationBuildPointerTable()
309 alloc->mHal.drvState.faceCount = type->getDimFaces(); in AllocationBuildPointerTable()
314 size_t o = alloc->mHal.drvState.lod[0].stride * rsMax(alloc->mHal.drvState.lod[0].dimY, 1u) * in AllocationBuildPointerTable()
315 rsMax(alloc->mHal.drvState.lod[0].dimZ, 1u); in AllocationBuildPointerTable()
316 if (alloc->mHal.state.yuv) { in AllocationBuildPointerTable()
317 o += DeriveYUVLayout(alloc->mHal.state.yuv, &alloc->mHal.drvState); in AllocationBuildPointerTable()
319 for (uint32_t ct = 1; ct < alloc->mHal.drvState.lodCount; ct++) { in AllocationBuildPointerTable()
320 offsets[ct] = (size_t)alloc->mHal.drvState.lod[ct].mallocPtr; in AllocationBuildPointerTable()
322 } else if(alloc->mHal.drvState.lodCount > 1) { in AllocationBuildPointerTable()
323 uint32_t tx = alloc->mHal.drvState.lod[0].dimX; in AllocationBuildPointerTable()
324 uint32_t ty = alloc->mHal.drvState.lod[0].dimY; in AllocationBuildPointerTable()
325 uint32_t tz = alloc->mHal.drvState.lod[0].dimZ; in AllocationBuildPointerTable()
326 for (uint32_t lod=1; lod < alloc->mHal.drvState.lodCount; lod++) { in AllocationBuildPointerTable()
327 alloc->mHal.drvState.lod[lod].dimX = tx; in AllocationBuildPointerTable()
328 alloc->mHal.drvState.lod[lod].dimY = ty; in AllocationBuildPointerTable()
329 alloc->mHal.drvState.lod[lod].dimZ = tz; in AllocationBuildPointerTable()
330 alloc->mHal.drvState.lod[lod].stride = in AllocationBuildPointerTable()
333 o += alloc->mHal.drvState.lod[lod].stride * rsMax(ty, 1u) * rsMax(tz, 1u); in AllocationBuildPointerTable()
340 alloc->mHal.drvState.faceOffset = o; in AllocationBuildPointerTable()
342 alloc->mHal.drvState.lod[0].mallocPtr = ptr; in AllocationBuildPointerTable()
343 for (uint32_t lod=1; lod < alloc->mHal.drvState.lodCount; lod++) { in AllocationBuildPointerTable()
344 alloc->mHal.drvState.lod[lod].mallocPtr = ptr + offsets[lod]; in AllocationBuildPointerTable()
347 size_t allocSize = alloc->mHal.drvState.faceOffset; in AllocationBuildPointerTable()
348 if(alloc->mHal.drvState.faceCount) { in AllocationBuildPointerTable()
355 static size_t AllocationBuildPointerTable(const Context *rsc, const Allocation *alloc, in AllocationBuildPointerTable() argument
357 return AllocationBuildPointerTable(rsc, alloc, type, ptr, Allocation::kMinimumRSAlignment); in AllocationBuildPointerTable()
372 bool rsdAllocationInitStrided(const Context *rsc, Allocation *alloc, bool forceZero, size_t require… in rsdAllocationInitStrided() argument
377 alloc->mHal.drv = drv; in rsdAllocationInitStrided()
385 …size_t allocSize = AllocationBuildPointerTable(rsc, alloc, alloc->getType(), nullptr, requiredAlig… in rsdAllocationInitStrided()
388 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_OUTPUT) { in rsdAllocationInitStrided()
390 } else if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_INPUT) { in rsdAllocationInitStrided()
394 …} else if (alloc->mHal.state.usageFlags == (RS_ALLOCATION_USAGE_INCREMENTAL_SUPPORT | RS_ALLOCATIO… in rsdAllocationInitStrided()
395 if (alloc->mHal.state.userProvidedPtr == nullptr) { in rsdAllocationInitStrided()
399 if (alloc->getType()->getDimLOD() || alloc->getType()->getDimFaces()) { in rsdAllocationInitStrided()
405 ptr = (uint8_t*)alloc->mHal.state.userProvidedPtr; in rsdAllocationInitStrided()
407 } else if (alloc->mHal.state.userProvidedPtr != nullptr) { in rsdAllocationInitStrided()
410 … if (!(alloc->mHal.state.usageFlags == (RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED) || in rsdAllocationInitStrided()
411alloc->mHal.state.usageFlags == (RS_ALLOCATION_USAGE_SCRIPT | RS_ALLOCATION_USAGE_SHARED | RS_ALLO… in rsdAllocationInitStrided()
415 if (alloc->getType()->getDimLOD() || alloc->getType()->getDimFaces()) { in rsdAllocationInitStrided()
422 …if (((alloc->getType()->getDimX() * alloc->getType()->getElement()->getSizeBytes()) % requiredAlig… in rsdAllocationInitStrided()
428 alloc->mHal.drv = nullptr; in rsdAllocationInitStrided()
435 ptr = (uint8_t*)alloc->mHal.state.userProvidedPtr; in rsdAllocationInitStrided()
440 alloc->mHal.drv = nullptr; in rsdAllocationInitStrided()
446 …size_t verifySize = AllocationBuildPointerTable(rsc, alloc, alloc->getType(), ptr, requiredAlignme… in rsdAllocationInitStrided()
452 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE) { in rsdAllocationInitStrided()
453 if (alloc->mHal.state.hasFaces) { in rsdAllocationInitStrided()
459 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_VERTEX) { in rsdAllocationInitStrided()
465 drv->glType = rsdTypeToGLType(alloc->mHal.state.type->getElement()->getComponent().getType()); in rsdAllocationInitStrided()
466 … drv->glFormat = rsdKindToGLFormat(alloc->mHal.state.type->getElement()->getComponent().getKind()); in rsdAllocationInitStrided()
472 if (alloc->mHal.state.usageFlags & ~RS_ALLOCATION_USAGE_SCRIPT) { in rsdAllocationInitStrided()
481 if ((alloc->mHal.state.userProvidedPtr != 0) && (drv->useUserProvidedPtr == false)) { in rsdAllocationInitStrided()
482 …ationData2D(rsc, alloc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, alloc->getType()->getDimX(… in rsdAllocationInitStrided()
487 ALOGE("pointer for allocation: %p", alloc); in rsdAllocationInitStrided()
488 ALOGE("pointer for allocation.drv: %p", &alloc->mHal.drv); in rsdAllocationInitStrided()
495 bool rsdAllocationInit(const Context *rsc, Allocation *alloc, bool forceZero) { in rsdAllocationInit() argument
496 return rsdAllocationInitStrided(rsc, alloc, forceZero, Allocation::kMinimumRSAlignment); in rsdAllocationInit()
499 void rsdAllocationAdapterOffset(const Context *rsc, const Allocation *alloc) { in rsdAllocationAdapterOffset() argument
503 const Allocation *base = alloc->mHal.state.baseAlloc; in rsdAllocationAdapterOffset()
504 const Type *type = alloc->mHal.state.type; in rsdAllocationAdapterOffset()
512 const int lodBias = alloc->mHal.state.originLOD; in rsdAllocationAdapterOffset()
513 uint32_t lodCount = rsMax(alloc->mHal.drvState.lodCount, (uint32_t)1); in rsdAllocationAdapterOffset()
515 alloc->mHal.drvState.lod[lod] = base->mHal.drvState.lod[lod + lodBias]; in rsdAllocationAdapterOffset()
516 alloc->mHal.drvState.lod[lod].mallocPtr = GetOffsetPtr(alloc, in rsdAllocationAdapterOffset()
517alloc->mHal.state.originX, alloc->mHal.state.originY, alloc->mHal.state.originZ, in rsdAllocationAdapterOffset()
518 lodBias, (RsAllocationCubemapFace)alloc->mHal.state.originFace); in rsdAllocationAdapterOffset()
522 bool rsdAllocationAdapterInit(const Context *rsc, Allocation *alloc) { in rsdAllocationAdapterInit() argument
527 alloc->mHal.drv = drv; in rsdAllocationAdapterInit()
530 rsdAllocationAdapterOffset(rsc, alloc); in rsdAllocationAdapterInit()
535 void rsdAllocationDestroy(const Context *rsc, Allocation *alloc) { in rsdAllocationDestroy() argument
536 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationDestroy()
538 if (alloc->mHal.state.baseAlloc == nullptr) { in rsdAllocationDestroy()
556 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationDestroy()
559 !(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_INPUT) && in rsdAllocationDestroy()
560 !(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_OUTPUT)) { in rsdAllocationDestroy()
561 free(alloc->mHal.drvState.lod[0].mallocPtr); in rsdAllocationDestroy()
563 alloc->mHal.drvState.lod[0].mallocPtr = nullptr; in rsdAllocationDestroy()
573 if ((alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_OUTPUT) && in rsdAllocationDestroy()
574 (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT)) { in rsdAllocationDestroy()
591 alloc->mHal.drv = nullptr; in rsdAllocationDestroy()
594 void rsdAllocationResize(const Context *rsc, const Allocation *alloc, in rsdAllocationResize() argument
596 const uint32_t oldDimX = alloc->mHal.drvState.lod[0].dimX; in rsdAllocationResize()
600 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SHARED) { in rsdAllocationResize()
604 void * oldPtr = alloc->mHal.drvState.lod[0].mallocPtr; in rsdAllocationResize()
606 size_t s = AllocationBuildPointerTable(rsc, alloc, newType, nullptr); in rsdAllocationResize()
609 size_t verifySize = AllocationBuildPointerTable(rsc, alloc, newType, ptr); in rsdAllocationResize()
616 size_t stride = alloc->mHal.state.elementSizeBytes; in rsdAllocationResize()
617 memset(((uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr) + stride * oldDimX, in rsdAllocationResize()
622 static void rsdAllocationSyncFromFBO(const Context *rsc, const Allocation *alloc) { in rsdAllocationSyncFromFBO() argument
624 if (!alloc->getIsScript()) { in rsdAllocationSyncFromFBO()
631 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationSyncFromFBO()
638 drv->readBackFBO->setDimensions(alloc->getType()->getDimX(), in rsdAllocationSyncFromFBO()
639 alloc->getType()->getDimY()); in rsdAllocationSyncFromFBO()
646 RSD_CALL_GL(glReadPixels, 0, 0, alloc->mHal.drvState.lod[0].dimX, in rsdAllocationSyncFromFBO()
647 alloc->mHal.drvState.lod[0].dimY, in rsdAllocationSyncFromFBO()
648 drv->glFormat, drv->glType, alloc->mHal.drvState.lod[0].mallocPtr); in rsdAllocationSyncFromFBO()
656 void rsdAllocationSyncAll(const Context *rsc, const Allocation *alloc, in rsdAllocationSyncAll() argument
658 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationSyncAll()
661 if(!alloc->getIsRenderTarget()) { in rsdAllocationSyncAll()
665 } else if (alloc->getType()->getElement()->getKind() != RS_KIND_PIXEL_RGBA) { in rsdAllocationSyncAll()
669 rsdAllocationSyncFromFBO(rsc, alloc); in rsdAllocationSyncAll()
676 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE) { in rsdAllocationSyncAll()
677 UploadToTexture(rsc, alloc); in rsdAllocationSyncAll()
679 if ((alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET) && in rsdAllocationSyncAll()
680 !(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_OUTPUT)) { in rsdAllocationSyncAll()
681 AllocateRenderTarget(rsc, alloc); in rsdAllocationSyncAll()
684 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_VERTEX) { in rsdAllocationSyncAll()
685 UploadToBufferObject(rsc, alloc); in rsdAllocationSyncAll()
688 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SHARED) { in rsdAllocationSyncAll()
701 void rsdAllocationMarkDirty(const Context *rsc, const Allocation *alloc) { in rsdAllocationMarkDirty() argument
702 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationMarkDirty()
707 static bool IoGetBuffer(const Context *rsc, Allocation *alloc, ANativeWindow *nw) { in IoGetBuffer() argument
708 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in IoGetBuffer()
726 alloc->mHal.drvState.lod[0].mallocPtr = dst; in IoGetBuffer()
727alloc->mHal.drvState.lod[0].stride = drv->wndBuffer->stride * alloc->mHal.state.elementSizeBytes; in IoGetBuffer()
728 rsAssert((alloc->mHal.drvState.lod[0].stride & 0xf) == 0); in IoGetBuffer()
734 void rsdAllocationSetSurface(const Context *rsc, Allocation *alloc, ANativeWindow *nw) { in rsdAllocationSetSurface() argument
736 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationSetSurface()
760 int32_t r = ANativeWindow_setBuffersGeometry(nw, alloc->mHal.drvState.lod[0].dimX, in rsdAllocationSetSurface()
761 alloc->mHal.drvState.lod[0].dimY, in rsdAllocationSetSurface()
768 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT) { in rsdAllocationSetSurface()
777 IoGetBuffer(rsc, alloc, nw); in rsdAllocationSetSurface()
785 void rsdAllocationIoSend(const Context *rsc, Allocation *alloc) { in rsdAllocationIoSend() argument
787 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationIoSend()
790 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET) { in rsdAllocationIoSend()
797 if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT) { in rsdAllocationIoSend()
812 IoGetBuffer(rsc, alloc, nw); in rsdAllocationIoSend()
821 void rsdAllocationIoReceive(const Context *rsc, Allocation *alloc) { in rsdAllocationIoReceive() argument
822 if (alloc->mHal.state.yuv) { in rsdAllocationIoReceive()
823 DeriveYUVLayout(alloc->mHal.state.yuv, &alloc->mHal.drvState); in rsdAllocationIoReceive()
828 void rsdAllocationData1D(const Context *rsc, const Allocation *alloc, in rsdAllocationData1D() argument
831 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationData1D()
833 const size_t eSize = alloc->mHal.state.type->getElementSizeBytes(); in rsdAllocationData1D()
834 uint8_t * ptr = GetOffsetPtr(alloc, xoff, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X); in rsdAllocationData1D()
839 if (alloc->mHal.state.hasReferences) { in rsdAllocationData1D()
840 alloc->incRefs(data, count); in rsdAllocationData1D()
841 alloc->decRefs(ptr, count); in rsdAllocationData1D()
848 void rsdAllocationData2D(const Context *rsc, const Allocation *alloc, in rsdAllocationData2D() argument
851 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationData2D()
853 size_t eSize = alloc->mHal.state.elementSizeBytes; in rsdAllocationData2D()
859 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationData2D()
861 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationData2D()
870 if (alloc->mHal.state.hasReferences) { in rsdAllocationData2D()
871 alloc->incRefs(src, w); in rsdAllocationData2D()
872 alloc->decRefs(dst, w); in rsdAllocationData2D()
876 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData2D()
878 if (alloc->mHal.state.yuv) { in rsdAllocationData2D()
882 if (alloc->mHal.state.yuv == RS_YUV_YV12) { in rsdAllocationData2D()
885 } else if (alloc->mHal.state.yuv == RS_YUV_NV21) { in rsdAllocationData2D()
891 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationData2D()
898 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData2D()
906 Update2DTexture(rsc, alloc, data, xoff, yoff, lod, face, w, h); in rsdAllocationData2D()
910 void rsdAllocationData3D(const Context *rsc, const Allocation *alloc, in rsdAllocationData3D() argument
915 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationData3D()
917 uint32_t eSize = alloc->mHal.state.elementSizeBytes; in rsdAllocationData3D()
923 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationData3D()
926 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, z, lod, in rsdAllocationData3D()
936 if (alloc->mHal.state.hasReferences) { in rsdAllocationData3D()
937 alloc->incRefs(src, w); in rsdAllocationData3D()
938 alloc->decRefs(dst, w); in rsdAllocationData3D()
942 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData3D()
949 void rsdAllocationRead1D(const Context *rsc, const Allocation *alloc, in rsdAllocationRead1D() argument
952 const size_t eSize = alloc->mHal.state.type->getElementSizeBytes(); in rsdAllocationRead1D()
953 const uint8_t * ptr = GetOffsetPtr(alloc, xoff, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X); in rsdAllocationRead1D()
961 void rsdAllocationRead2D(const Context *rsc, const Allocation *alloc, in rsdAllocationRead2D() argument
964 size_t eSize = alloc->mHal.state.elementSizeBytes; in rsdAllocationRead2D()
970 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationRead2D()
972 const uint8_t *src = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationRead2D()
982 src += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationRead2D()
990 void rsdAllocationRead3D(const Context *rsc, const Allocation *alloc, in rsdAllocationRead3D() argument
994 uint32_t eSize = alloc->mHal.state.elementSizeBytes; in rsdAllocationRead3D()
1000 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationRead3D()
1003 const uint8_t *src = GetOffsetPtr(alloc, xoff, yoff, z, lod, in rsdAllocationRead3D()
1014 src += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationRead3D()
1021 const android::renderscript::Allocation *alloc) { in rsdAllocationLock1D() argument
1022 return alloc->mHal.drvState.lod[0].mallocPtr; in rsdAllocationLock1D()
1026 const android::renderscript::Allocation *alloc) { in rsdAllocationUnlock1D() argument
1112 void rsdAllocationElementData(const Context *rsc, const Allocation *alloc, in rsdAllocationElementData() argument
1115 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationElementData()
1117 uint8_t * ptr = GetOffsetPtr(alloc, x, y, z, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X); in rsdAllocationElementData()
1119 const Element * e = alloc->mHal.state.type->getElement()->getField(cIdx); in rsdAllocationElementData()
1120 ptr += alloc->mHal.state.type->getElement()->getFieldOffsetBytes(cIdx); in rsdAllocationElementData()
1122 if (alloc->mHal.state.hasReferences) { in rsdAllocationElementData()
1131 void rsdAllocationElementRead(const Context *rsc, const Allocation *alloc, in rsdAllocationElementRead() argument
1134 DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv; in rsdAllocationElementRead()
1136 uint8_t * ptr = GetOffsetPtr(alloc, x, y, z, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X); in rsdAllocationElementRead()
1138 const Element * e = alloc->mHal.state.type->getElement()->getField(cIdx); in rsdAllocationElementRead()
1139 ptr += alloc->mHal.state.type->getElement()->getFieldOffsetBytes(cIdx); in rsdAllocationElementRead()
1144 static void mip565(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip565() argument
1145 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip565()
1146 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip565()
1149 uint16_t *oPtr = (uint16_t *)GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip565()
1150 const uint16_t *i1 = (uint16_t *)GetOffsetPtr(alloc, 0, 0, y*2, lod, face); in mip565()
1151 const uint16_t *i2 = (uint16_t *)GetOffsetPtr(alloc, 0, 0, y*2+1, lod, face); in mip565()
1162 static void mip8888(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip8888() argument
1163 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip8888()
1164 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip8888()
1167 uint32_t *oPtr = (uint32_t *)GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip8888()
1168 const uint32_t *i1 = (uint32_t *)GetOffsetPtr(alloc, 0, y*2, 0, lod, face); in mip8888()
1169 const uint32_t *i2 = (uint32_t *)GetOffsetPtr(alloc, 0, y*2+1, 0, lod, face); in mip8888()
1180 static void mip8(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip8() argument
1181 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip8()
1182 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip8()
1185 uint8_t *oPtr = GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip8()
1186 const uint8_t *i1 = GetOffsetPtr(alloc, 0, y*2, 0, lod, face); in mip8()
1187 const uint8_t *i2 = GetOffsetPtr(alloc, 0, y*2+1, 0, lod, face); in mip8()
1198 void rsdAllocationGenerateMipmaps(const Context *rsc, const Allocation *alloc) { in rsdAllocationGenerateMipmaps() argument
1199 if(!alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationGenerateMipmaps()
1202 uint32_t numFaces = alloc->getType()->getDimFaces() ? 6 : 1; in rsdAllocationGenerateMipmaps()
1204 for (uint32_t lod=0; lod < (alloc->getType()->getLODCount() -1); lod++) { in rsdAllocationGenerateMipmaps()
1205 switch (alloc->getType()->getElement()->getSizeBits()) { in rsdAllocationGenerateMipmaps()
1207 mip8888(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1210 mip565(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1213 mip8(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1221 android::renderscript::Allocation *alloc) in rsdAllocationGrallocBits() argument
1227 const Allocation *alloc, in rsdAllocationUpdateCachedObject() argument
1230 obj->p = alloc; in rsdAllocationUpdateCachedObject()