mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Prepare for future changes
- Implement changing MemObj's GraphicsAllocation - Create function for resolving change of SharedHandler's GraphicsAllocation Change-Id: Ibd975070ca11ba8591f5561d9f02bf5d9af1636b
This commit is contained in:
committed by
sys_ocldev
parent
a95c6d3c1a
commit
4993a94b5b
@@ -246,6 +246,16 @@ GraphicsAllocation *MemObj::getGraphicsAllocation() {
|
||||
return graphicsAllocation;
|
||||
}
|
||||
|
||||
void MemObj::resetGraphicsAllocation(GraphicsAllocation *newGraphicsAllocation) {
|
||||
TakeOwnershipWrapper<MemObj> lock(*this);
|
||||
|
||||
if (graphicsAllocation != nullptr && (peekSharingHandler() == nullptr || graphicsAllocation->peekReuseCount() == 0)) {
|
||||
memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(graphicsAllocation);
|
||||
}
|
||||
|
||||
graphicsAllocation = newGraphicsAllocation;
|
||||
}
|
||||
|
||||
bool MemObj::readMemObjFlagsInvalid() {
|
||||
if (this->getFlags() & (CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS)) {
|
||||
return true;
|
||||
|
||||
@@ -94,6 +94,7 @@ class MemObj : public BaseObject<_cl_mem> {
|
||||
virtual void transferDataFromHostPtr(MemObjSizeArray ©Size, MemObjOffsetArray ©Offset) { UNRECOVERABLE_IF(true); };
|
||||
|
||||
GraphicsAllocation *getGraphicsAllocation();
|
||||
void resetGraphicsAllocation(GraphicsAllocation *newGraphicsAllocation);
|
||||
GraphicsAllocation *getMcsAllocation() { return mcsAllocation; }
|
||||
void setMcsAllocation(GraphicsAllocation *alloc) { mcsAllocation = alloc; }
|
||||
|
||||
@@ -115,7 +116,7 @@ class MemObj : public BaseObject<_cl_mem> {
|
||||
void setSharingHandler(SharingHandler *sharingHandler) { this->sharingHandler.reset(sharingHandler); }
|
||||
void setParentSharingHandler(std::shared_ptr<SharingHandler> &handler) { sharingHandler = handler; }
|
||||
unsigned int acquireCount = 0;
|
||||
const Context *getContext() const { return context; }
|
||||
Context *getContext() const { return context; }
|
||||
|
||||
void waitForCsrCompletion();
|
||||
void destroyGraphicsAllocation(GraphicsAllocation *allocation, bool asyncDestroy);
|
||||
|
||||
Reference in New Issue
Block a user