fix: get gmm resource type using ResourceInfo interface

GMM_RESOURCE_INFO interface should be used only within ResourceInfo class

Related-To: NEO-7951
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2023-05-11 15:20:13 +00:00 committed by Compute-Runtime-Automation
parent c4f36a6808
commit b1543289d2
2 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,7 @@
namespace NEO {
void *UnifiedImage::swapGmm(GraphicsAllocation *graphicsAllocation, Context *context, ImageInfo *imgInfo) {
if (graphicsAllocation->getDefaultGmm()->gmmResourceInfo->peekGmmResourceInfo()->GetResourceType() == RESOURCE_BUFFER) {
if (graphicsAllocation->getDefaultGmm()->gmmResourceInfo->getResourceType() == RESOURCE_BUFFER) {
auto gmmHelper = context->getDevice(0)->getRootDeviceEnvironment().getGmmHelper();
auto gmm = std::make_unique<Gmm>(gmmHelper, *imgInfo, StorageInfo{}, false);
gmm->updateImgInfoAndDesc(*imgInfo, 0);

View File

@ -111,6 +111,7 @@ struct MemoryManagerReturningCompressedAllocations : UnifiedSharingMockMemoryMan
auto gmm = allocation->getDefaultGmm();
auto mockGmmResourceInfo = std::make_unique<MockGmmResourceInfo>(gmm->gmmResourceInfo->peekGmmResourceInfo());
mockGmmResourceInfo->mockResourceCreateParams.Type = RESOURCE_1D;
mockGmmResourceInfo->setUnifiedAuxTranslationCapable();
gmm->gmmResourceInfo = std::move(mockGmmResourceInfo);