DRM Graphic allocation assigns original hostPtr as cpuPtr

Change-Id: I9ba282b130b5fb9b674e1ceb2f87183f218ab140
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
This commit is contained in:
Dongwon Kim
2019-08-14 16:23:57 -07:00
committed by sys_ocldev
parent 04c45967b9
commit 25d9e4533d
5 changed files with 6 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::setupContext(OsContext &
template <typename GfxFamily>
bool CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getParametersForWriteMemory(GraphicsAllocation &graphicsAllocation, uint64_t &gpuAddress, void *&cpuAddress, size_t &size) const {
cpuAddress = ptrOffset(graphicsAllocation.getUnderlyingBuffer(), static_cast<size_t>(graphicsAllocation.getAllocationOffset()));
cpuAddress = graphicsAllocation.getUnderlyingBuffer();
gpuAddress = GmmHelper::decanonize(graphicsAllocation.getGpuAddress());
size = graphicsAllocation.getUnderlyingBufferSize();
auto gmm = graphicsAllocation.getDefaultGmm();

View File

@@ -18,8 +18,7 @@ bool isL3Capable(void *ptr, size_t size) {
}
bool isL3Capable(const NEO::GraphicsAllocation &graphicsAllocation) {
auto ptr = ptrOffset(graphicsAllocation.getUnderlyingBuffer(), static_cast<size_t>(graphicsAllocation.getAllocationOffset()));
return isL3Capable(ptr, graphicsAllocation.getUnderlyingBufferSize());
return isL3Capable(graphicsAllocation.getUnderlyingBuffer(), graphicsAllocation.getUnderlyingBufferSize());
}
} // namespace NEO

View File

@@ -74,7 +74,7 @@ class OsAgnosticMemoryManager : public MemoryManager {
GraphicsAllocation *allocateGraphicsMemory64kb(const AllocationData &allocationData) override;
GraphicsAllocation *allocateGraphicsMemoryForImageImpl(const AllocationData &allocationData, std::unique_ptr<Gmm> gmm) override;
void *lockResourceImpl(GraphicsAllocation &graphicsAllocation) override { return ptrOffset(graphicsAllocation.getUnderlyingBuffer(), static_cast<size_t>(graphicsAllocation.getAllocationOffset())); }
void *lockResourceImpl(GraphicsAllocation &graphicsAllocation) override { return graphicsAllocation.getUnderlyingBuffer(); }
void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) override {}
GraphicsAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData) override;
GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override;

View File

@@ -249,7 +249,7 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(const Al
bo->gpuAddress = gpuVirtualAddress;
auto allocation = new DrmAllocation(allocationData.type, bo, const_cast<void *>(alignedPtr), gpuVirtualAddress,
auto allocation = new DrmAllocation(allocationData.type, bo, const_cast<void *>(allocationData.hostPtr), gpuVirtualAddress,
allocationData.size, MemoryPool::System4KBPages, false);
allocation->setAllocationOffset(offsetInPage);