mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Use root device index to get graphics allocation from buffer
pass root device index to isCompressed method Related-To: NEO-4672 Change-Id: I6805254b09c86c0e0fb9333f8eb35d6dee73d327 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
15b91c4d45
commit
81cc0afb1e
@@ -543,15 +543,17 @@ size_t Buffer::calculateHostPtrSize(const size_t *origin, const size_t *region,
|
||||
return hostPtrSize;
|
||||
}
|
||||
|
||||
bool Buffer::isReadWriteOnCpuAllowed() {
|
||||
bool Buffer::isReadWriteOnCpuAllowed(uint32_t rootDeviceIndex) {
|
||||
if (forceDisallowCPUCopy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->isCompressed()) {
|
||||
if (this->isCompressed(rootDeviceIndex)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto graphicsAllocation = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex);
|
||||
|
||||
if (graphicsAllocation->peekSharedHandle() != 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -654,8 +656,8 @@ uint32_t Buffer::getMocsValue(bool disableL3Cache, bool isReadOnlyArgument) cons
|
||||
}
|
||||
}
|
||||
|
||||
bool Buffer::isCompressed() const {
|
||||
auto graphicsAllocation = multiGraphicsAllocation.getDefaultGraphicsAllocation();
|
||||
bool Buffer::isCompressed(uint32_t rootDeviceIndex) const {
|
||||
auto graphicsAllocation = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex);
|
||||
if (graphicsAllocation->getDefaultGmm()) {
|
||||
return graphicsAllocation->getDefaultGmm()->isRenderCompressed;
|
||||
}
|
||||
|
||||
@@ -149,12 +149,12 @@ class Buffer : public MemObj {
|
||||
void transferDataToHostPtr(MemObjSizeArray ©Size, MemObjOffsetArray ©Offset) override;
|
||||
void transferDataFromHostPtr(MemObjSizeArray ©Size, MemObjOffsetArray ©Offset) override;
|
||||
|
||||
bool isReadWriteOnCpuAllowed();
|
||||
bool isReadWriteOnCpuAllowed(uint32_t rootDeviceIndex);
|
||||
bool isReadWriteOnCpuPreffered(void *ptr, size_t size);
|
||||
|
||||
uint32_t getMocsValue(bool disableL3Cache, bool isReadOnlyArgument) const;
|
||||
|
||||
bool isCompressed() const;
|
||||
bool isCompressed(uint32_t rootDeviceIndex) const;
|
||||
|
||||
protected:
|
||||
Buffer(Context *context,
|
||||
|
||||
Reference in New Issue
Block a user