fix(ocl): handle gl sharing displayable textures

Displayable textures always need dc flush.

Related-To: NEO-11694

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2024-06-27 11:34:50 +00:00
committed by Compute-Runtime-Automation
parent d1e56b4e1e
commit 76e8be5c39
16 changed files with 76 additions and 7 deletions

View File

@@ -405,6 +405,7 @@ Image *Image::createSharedImage(Context *context, SharingHandler *sharingHandler
sharedImage->setSurfaceOffsets(imgInfo.offset, imgInfo.xOffset, imgInfo.yOffset, imgInfo.yOffsetForUVPlane);
sharedImage->setMcsSurfaceInfo(mcsSurfaceInfo);
sharedImage->setPlane(imgInfo.plane);
sharedImage->setIsDisplayable(imgInfo.isDisplayable);
return sharedImage;
}

View File

@@ -171,6 +171,8 @@ class Image : public MemObj {
surfaceOffsets.yOffsetForUVplane = yOffsetForUVPlane;
}
void getSurfaceOffsets(SurfaceOffsets &surfaceOffsetsOut) { surfaceOffsetsOut = this->surfaceOffsets; }
bool getIsDisplayable() const { return isDisplayable; }
void setIsDisplayable(bool displayable) { this->isDisplayable = displayable; }
void setCubeFaceIndex(uint32_t index) { cubeFaceIndex = index; }
uint32_t getCubeFaceIndex() { return cubeFaceIndex; }

View File

@@ -275,6 +275,10 @@ bool MemObj::isMemObjUncacheableForSurfaceState() const {
return isAnyBitSet(flagsIntel, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE | CL_MEM_LOCALLY_UNCACHED_RESOURCE);
}
bool MemObj::isMemObjDisplayable() const {
return this->isDisplayable;
}
GraphicsAllocation *MemObj::getGraphicsAllocation(uint32_t rootDeviceIndex) const {
return multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -70,7 +70,7 @@ class MemObj : public BaseObject<_cl_mem> {
MultiGraphicsAllocation &&multiGraphicsAllocation,
bool zeroCopy,
bool isHostPtrSVM,
bool isObjectRedescrbied);
bool isObjectRedescribed);
~MemObj() override;
cl_int getMemObjectInfo(cl_mem_info paramName,
@@ -103,6 +103,7 @@ class MemObj : public BaseObject<_cl_mem> {
bool isMemObjWithHostPtrSVM() const;
bool isMemObjUncacheable() const;
bool isMemObjUncacheableForSurfaceState() const;
bool isMemObjDisplayable() const;
virtual void transferDataToHostPtr(MemObjSizeArray &copySize, MemObjOffsetArray &copyOffset) { UNRECOVERABLE_IF(true); };
virtual void transferDataFromHostPtr(MemObjSizeArray &copySize, MemObjOffsetArray &copyOffset) { UNRECOVERABLE_IF(true); };
@@ -190,6 +191,7 @@ class MemObj : public BaseObject<_cl_mem> {
bool isZeroCopy;
bool isHostPtrSVM;
bool isObjectRedescribed;
bool isDisplayable{false};
MemoryManager *memoryManager = nullptr;
MultiGraphicsAllocation multiGraphicsAllocation;
GraphicsAllocation *mcsAllocation = nullptr;