fix: allow ringBuffer in coherent memory only for Xe2+
Related-To: NEO-9421 Signed-off-by: Tomasz Biernacik <tomasz.biernacik@intel.com>
This commit is contained in:
parent
ccedc7c8f7
commit
310d8c2e58
|
@ -60,7 +60,7 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
|
|||
}
|
||||
|
||||
if (hwInfo->capabilityTable.isIntegratedDevice) {
|
||||
if (AllocationType::ringBuffer == allocationType || AllocationType::semaphoreBuffer == allocationType) {
|
||||
if (AllocationType::semaphoreBuffer == allocationType || (AllocationType::ringBuffer == allocationType && productHelper.allowSharedResourcesInCoherentMemory())) {
|
||||
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,6 +246,7 @@ class ProductHelper {
|
|||
virtual std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const = 0;
|
||||
virtual bool isCachingOnCpuAvailable() const = 0;
|
||||
virtual bool isNewCoherencyModelSupported() const = 0;
|
||||
virtual bool allowSharedResourcesInCoherentMemory() const = 0;
|
||||
virtual bool deferMOCSToPatIndex() const = 0;
|
||||
virtual const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const = 0;
|
||||
|
|
|
@ -45,4 +45,9 @@ bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwI
|
|||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::allowSharedResourcesInCoherentMemory() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -184,6 +184,7 @@ class ProductHelperHw : public ProductHelper {
|
|||
std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const override;
|
||||
bool isCachingOnCpuAvailable() const override;
|
||||
bool isNewCoherencyModelSupported() const override;
|
||||
bool allowSharedResourcesInCoherentMemory() const override;
|
||||
bool deferMOCSToPatIndex() const override;
|
||||
bool supportReadOnlyAllocations() const override;
|
||||
const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const override;
|
||||
|
|
|
@ -49,4 +49,9 @@ bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwI
|
|||
return isCompressionForbiddenCommon(false);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::allowSharedResourcesInCoherentMemory() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -508,6 +508,11 @@ bool ProductHelperHw<IGFX_UNKNOWN>::isCompressionForbidden(const HardwareInfo &h
|
|||
template <>
|
||||
void ProductHelperHw<IGFX_UNKNOWN>::setRenderCompressedFlags(HardwareInfo &hwInfo) const {}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<IGFX_UNKNOWN>::allowSharedResourcesInCoherentMemory() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
#include "shared/source/os_interface/product_helper.inl"
|
||||
|
|
|
@ -766,13 +766,23 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) {
|
|||
case AllocationType::fillPattern:
|
||||
case AllocationType::internalHostMemory:
|
||||
case AllocationType::mapAllocation:
|
||||
case AllocationType::ringBuffer:
|
||||
case AllocationType::semaphoreBuffer:
|
||||
case AllocationType::svmCpu:
|
||||
case AllocationType::svmZeroCopy:
|
||||
case AllocationType::tagBuffer:
|
||||
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
case AllocationType::ringBuffer:
|
||||
if (forceUncached) {
|
||||
expectedUsage = uncachedGmmUsageType;
|
||||
break;
|
||||
}
|
||||
|
||||
if (productHelper.allowSharedResourcesInCoherentMemory()) {
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
break;
|
||||
|
@ -883,7 +893,6 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu
|
|||
case AllocationType::timestampPacketTagBuffer:
|
||||
expectedUsage = uncachedGmmUsageType;
|
||||
break;
|
||||
|
||||
case AllocationType::linearStream:
|
||||
case AllocationType::internalHeap:
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED;
|
||||
|
@ -895,10 +904,15 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu
|
|||
expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE;
|
||||
break;
|
||||
case AllocationType::fillPattern:
|
||||
case AllocationType::ringBuffer:
|
||||
case AllocationType::semaphoreBuffer:
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
case AllocationType::ringBuffer:
|
||||
if (productHelper.allowSharedResourcesInCoherentMemory()) {
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
break;
|
||||
|
@ -920,13 +934,18 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu
|
|||
case AllocationType::fillPattern:
|
||||
case AllocationType::internalHostMemory:
|
||||
case AllocationType::mapAllocation:
|
||||
case AllocationType::ringBuffer:
|
||||
case AllocationType::semaphoreBuffer:
|
||||
case AllocationType::svmCpu:
|
||||
case AllocationType::svmZeroCopy:
|
||||
case AllocationType::tagBuffer:
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
case AllocationType::ringBuffer:
|
||||
if (productHelper.allowSharedResourcesInCoherentMemory()) {
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
default:
|
||||
expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
break;
|
||||
|
|
|
@ -1180,3 +1180,11 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingIsPrimaryContextsAggreg
|
|||
HWTEST_F(ProductHelperTest, givenProductHelperWhenCallingUseAdditionalBlitPropertiesThenFalseReturned) {
|
||||
EXPECT_FALSE(productHelper->useAdditionalBlitProperties());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingAllowSharedResourcesInCoherentMemoryThenFalseReturned, IsBeforeXe2HpgCore) {
|
||||
EXPECT_FALSE(productHelper->allowSharedResourcesInCoherentMemory());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingAllowSharedResourcesInCoherentMemoryThenTrueReturned, IsAtLeastXe2HpgCore) {
|
||||
EXPECT_TRUE(productHelper->allowSharedResourcesInCoherentMemory());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue