mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Fix using offsetted host memory for multiple mem copy calls
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e99c224c0a
commit
e51f8ceb0d
@@ -1757,6 +1757,10 @@ inline AlignedAllocationData CommandListCoreFamily<gfxCoreFamily>::getAlignedAll
|
||||
} else {
|
||||
alloc = getHostPtrAlloc(buffer, bufferSize, hostCopyAllowed);
|
||||
alignedPtr = static_cast<uintptr_t>(alignDown(alloc->getGpuAddress(), NEO::EncodeSurfaceState<GfxFamily>::getSurfaceBaseAddressAlignment()));
|
||||
auto hostAllocCpuPtr = reinterpret_cast<uintptr_t>(alloc->getUnderlyingBuffer());
|
||||
hostAllocCpuPtr = alignDown(hostAllocCpuPtr, NEO::EncodeSurfaceState<GfxFamily>::getSurfaceBaseAddressAlignment());
|
||||
auto allignedPtrOffset = sourcePtr - hostAllocCpuPtr;
|
||||
alignedPtr = ptrOffset(alignedPtr, allignedPtrOffset);
|
||||
}
|
||||
|
||||
hostPointerNeedsFlush = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -230,6 +230,8 @@ HWTEST2_F(CommandListCreate,
|
||||
size_t offset = 0x21u;
|
||||
void *offsetMemory = ptrOffset(startMemory, offset);
|
||||
expectedOffset = ptrDiff(offsetMemory, baseAddress);
|
||||
size_t alignedOffset = offset & EncodeSurfaceState<FamilyType>::getSurfaceBaseAddressAlignmentMask();
|
||||
expectedGpuAddress = ptrOffset(expectedGpuAddress, alignedOffset);
|
||||
EXPECT_EQ(outData.offset + offset, expectedOffset);
|
||||
|
||||
outData = commandList->getAlignedAllocation(device, offsetMemory, 4u, false);
|
||||
|
||||
Reference in New Issue
Block a user