2019-04-03 21:59:31 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-06-26 17:37:46 +08:00
|
|
|
#include "runtime/helpers/csr_deps.h"
|
|
|
|
#include "runtime/memory_manager/memory_constants.h"
|
|
|
|
|
2019-04-03 21:59:31 +08:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace NEO {
|
2019-06-27 22:08:20 +08:00
|
|
|
class CommandStreamReceiver;
|
2019-04-03 21:59:31 +08:00
|
|
|
class GraphicsAllocation;
|
|
|
|
class LinearStream;
|
2019-06-26 17:37:46 +08:00
|
|
|
class TimestampPacketContainer;
|
|
|
|
|
|
|
|
struct BlitProperties {
|
|
|
|
BlitProperties() = delete;
|
|
|
|
|
2019-06-27 22:08:20 +08:00
|
|
|
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitWithHostPtrDirection copyDirection,
|
|
|
|
CommandStreamReceiver &commandStreamReceiver,
|
|
|
|
GraphicsAllocation *memObjAllocation, void *hostPtr, bool blocking,
|
|
|
|
size_t offset, uint64_t copySize);
|
2019-06-26 17:37:46 +08:00
|
|
|
|
|
|
|
TimestampPacketContainer *outputTimestampPacket = nullptr;
|
|
|
|
BlitterConstants::BlitWithHostPtrDirection copyDirection;
|
|
|
|
CsrDependencies csrDependencies;
|
|
|
|
|
2019-06-27 22:08:20 +08:00
|
|
|
GraphicsAllocation *dstAllocation = nullptr;
|
|
|
|
GraphicsAllocation *srcAllocation = nullptr;
|
2019-06-26 17:37:46 +08:00
|
|
|
void *hostPtr = nullptr;
|
|
|
|
bool blocking = false;
|
|
|
|
size_t dstOffset = 0;
|
|
|
|
size_t srcOffset = 0;
|
|
|
|
uint64_t copySize = 0;
|
|
|
|
};
|
2019-04-03 21:59:31 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct BlitCommandsHelper {
|
2019-06-27 22:08:20 +08:00
|
|
|
static size_t estimateBlitCommandsSize(uint64_t copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket);
|
|
|
|
static void dispatchBlitCommandsForBuffer(const BlitProperties &blitProperites, LinearStream &linearStream);
|
|
|
|
static void appendBlitCommandsForBuffer(const BlitProperties &blitProperites, typename GfxFamily::XY_COPY_BLT &blitCmd);
|
2019-04-03 21:59:31 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|