From 2a6b6b1c23316bed2c4e431d32e8517a110bd7ba Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 9 Jun 2015 10:41:49 -0400
Subject: [PATCH] P4 to Git Change 1159286 by gandryey@gera-ubuntu14 on
2015/06/09 10:30:28
ECR #304775 - Mipmaps support
- Fix clCopyImages failures under Linux. Unmap for READ was skipping the view destruction. Combine READ/WRITE map/unmap paths for mipmap textures
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#179 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#364 edit
---
rocclr/runtime/device/device.cpp | 2 +-
rocclr/runtime/device/gpu/gpuvirtual.cpp | 8 +-------
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/rocclr/runtime/device/device.cpp b/rocclr/runtime/device/device.cpp
index 0b8d9b6ef9..8246e2072d 100644
--- a/rocclr/runtime/device/device.cpp
+++ b/rocclr/runtime/device/device.cpp
@@ -615,13 +615,13 @@ Memory::saveMapInfo(
if (mapFlags & (CL_MAP_WRITE | CL_MAP_WRITE_INVALIDATE_REGION)) {
writeMapInfo_.origin_ = origin;
writeMapInfo_.region_ = region;
- writeMapInfo_.baseMip_ = baseMip;
writeMapInfo_.entire_ = entire;
flags_ |= UnmapWrite;
}
if (mapFlags & CL_MAP_READ) {
flags_ |= UnmapRead;
}
+ writeMapInfo_.baseMip_ = baseMip;
}
Program::Program(amd::Device& device)
diff --git a/rocclr/runtime/device/gpu/gpuvirtual.cpp b/rocclr/runtime/device/gpu/gpuvirtual.cpp
index 6678ec86c2..f519f0ffe4 100644
--- a/rocclr/runtime/device/gpu/gpuvirtual.cpp
+++ b/rocclr/runtime/device/gpu/gpuvirtual.cpp
@@ -1163,7 +1163,7 @@ VirtualGPU::submitMapMemory(amd::MapMemoryCommand& vcmd)
}
else {
// Validate if it's a view for a map of mip level
- if (memory->isUnmapWrite() && (vcmd.memory().parent() != NULL)) {
+ if (vcmd.memory().parent() != NULL) {
amd::Image* amdImage = vcmd.memory().parent()->asImage();
if ((amdImage != NULL) && (amdImage->getMipLevels() > 1)) {
// Save map write info in the parent object
@@ -1203,7 +1203,6 @@ VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd)
// Check if image is a mipmap and assign a saved view
amd::Image* amdImage = owner->asImage();
if ((amdImage != NULL) && (amdImage->getMipLevels() > 1) &&
- memory->isUnmapWrite() &&
(memory->writeMapInfo()->baseMip_ != NULL)) {
// Clear unmap flags from the parent image
memory->clearUnmapFlags();
@@ -1286,11 +1285,6 @@ VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd)
}
}
}
- else if ((amdImage != NULL) && (amdImage->getMipLevels() > 1) &&
- (!memory->isUnmapWrite())) {
- // Release a view for a mipmap map
- amdImage->release();
- }
else {
LogError("Unhandled unmap!");
vcmd.setStatus(CL_INVALID_VALUE);