mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user